Chris PeBenito 31b7c0
#DESC sulogin - Single-User login
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Authors:  Dan Walsh <dwalsh@redhat.com>
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# X-Debian-Packages: sysvinit
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#################################
Chris PeBenito 31b7c0
# 
Chris PeBenito 31b7c0
# Rules for the sulogin_t domain
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
type sulogin_t, domain, privrole, privowner, privlog, privfd, privuser, auth;
Chris PeBenito 31b7c0
type sulogin_exec_t, file_type, exec_type, sysadmfile;
Chris PeBenito 31b7c0
role system_r types sulogin_t;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
general_domain_access(sulogin_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
domain_auto_trans({ initrc_t init_t }, sulogin_exec_t, sulogin_t)
Chris PeBenito 31b7c0
allow sulogin_t initrc_t:process getpgid;
Chris PeBenito 31b7c0
uses_shlib(sulogin_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# suse and debian do not use pam with sulogin...
Chris PeBenito 31b7c0
ifdef(`distro_suse', `
Chris PeBenito 31b7c0
define(`sulogin_no_pam', `')
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
ifdef(`distro_debian', `
Chris PeBenito 31b7c0
define(`sulogin_no_pam', `')
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
ifdef(`sulogin_no_pam', `
Chris PeBenito 31b7c0
domain_auto_trans(sulogin_t, shell_exec_t, sysadm_t)
Chris PeBenito 31b7c0
allow sulogin_t init_t:process getpgid;
Chris PeBenito 31b7c0
allow sulogin_t self:capability sys_tty_config;
Chris PeBenito 31b7c0
', `
Chris PeBenito 31b7c0
domain_trans(sulogin_t, shell_exec_t, sysadm_t)
Chris PeBenito 31b7c0
allow sulogin_t shell_exec_t:file r_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
can_setexec(sulogin_t)
Chris PeBenito 31b7c0
can_getsecurity(sulogin_t)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
r_dir_file(sulogin_t, etc_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow sulogin_t bin_t:dir r_dir_perms;
Chris PeBenito 31b7c0
r_dir_file(sulogin_t, proc_t)
Chris PeBenito 31b7c0
allow sulogin_t root_t:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow sulogin_t sysadm_devpts_t:chr_file { getattr ioctl read write };
Chris PeBenito 31b7c0
allow sulogin_t { staff_home_dir_t sysadm_home_dir_t }:dir search;
Chris PeBenito 31b7c0
allow sulogin_t default_context_t:dir search;
Chris PeBenito 31b7c0
allow sulogin_t default_context_t:file { getattr read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
r_dir_file(sulogin_t, selinux_config_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# because file systems are not mounted
Chris PeBenito 31b7c0
dontaudit sulogin_t file_t:dir search;