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