|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
# Macros for Rssh domains
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
# Author: Colin Walters <walters@verbum.org>
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
# rssh_domain(domain_prefix)
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
# Define a specific rssh domain.
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
# The type declaration for the executable type for this program is
|
|
Chris PeBenito |
31b7c0 |
# provided separately in domains/program/rssh.te.
|
|
Chris PeBenito |
31b7c0 |
#
|
|
Chris PeBenito |
31b7c0 |
undefine(`rssh_domain')
|
|
Chris PeBenito |
31b7c0 |
ifdef(`rssh.te', `
|
|
Chris PeBenito |
31b7c0 |
define(`rssh_domain',`
|
|
Chris PeBenito |
31b7c0 |
type rssh_$1_t, domain, userdomain, privlog, privfd;
|
|
Chris PeBenito |
31b7c0 |
role rssh_$1_r types rssh_$1_t;
|
|
Chris PeBenito |
31b7c0 |
allow system_r rssh_$1_r;
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
type rssh_$1_rw_t, file_type, sysadmfile, $1_file_type;
|
|
Chris PeBenito |
31b7c0 |
type rssh_$1_ro_t, file_type, sysadmfile, $1_file_type;
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
general_domain_access(rssh_$1_t);
|
|
Chris PeBenito |
31b7c0 |
uses_shlib(rssh_$1_t);
|
|
Chris PeBenito |
31b7c0 |
base_file_read_access(rssh_$1_t);
|
|
Chris PeBenito |
31b7c0 |
allow rssh_$1_t var_t:dir r_dir_perms;
|
|
Chris PeBenito |
31b7c0 |
r_dir_file(rssh_$1_t, etc_t);
|
|
Chris PeBenito |
31b7c0 |
allow rssh_$1_t etc_runtime_t:file { getattr read };
|
|
Chris PeBenito |
31b7c0 |
r_dir_file(rssh_$1_t, locale_t);
|
|
Chris PeBenito |
31b7c0 |
can_exec(rssh_$1_t, bin_t);
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
allow rssh_$1_t proc_t:dir { getattr search };
|
|
Chris PeBenito |
31b7c0 |
allow rssh_$1_t proc_t:lnk_file { getattr read };
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
r_dir_file(rssh_$1_t, rssh_$1_ro_t);
|
|
Chris PeBenito |
31b7c0 |
create_dir_file(rssh_$1_t, rssh_$1_rw_t);
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
can_create_pty(rssh_$1, `, userpty_type, user_tty_type')
|
|
Chris PeBenito |
31b7c0 |
# Use the type when relabeling pty devices.
|
|
Chris PeBenito |
31b7c0 |
type_change rssh_$1_t server_pty:chr_file rssh_$1_devpts_t;
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
ifdef(`ssh.te',`
|
|
Chris PeBenito |
31b7c0 |
allow rssh_$1_t sshd_t:fd use;
|
|
Chris PeBenito |
31b7c0 |
allow rssh_$1_t sshd_t:tcp_socket rw_stream_socket_perms;
|
|
Chris PeBenito |
31b7c0 |
allow rssh_$1_t sshd_t:unix_stream_socket rw_stream_socket_perms;
|
|
Chris PeBenito |
31b7c0 |
# For reading /home/user/.ssh
|
|
Chris PeBenito |
31b7c0 |
r_dir_file(sshd_t, rssh_$1_ro_t);
|
|
Chris PeBenito |
31b7c0 |
domain_trans(sshd_t, rssh_exec_t, rssh_$1_t);
|
|
Chris PeBenito |
31b7c0 |
')
|
|
Chris PeBenito |
31b7c0 |
')
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
', `
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
define(`rssh_domain',`')
|
|
Chris PeBenito |
31b7c0 |
|
|
Chris PeBenito |
31b7c0 |
')
|