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