Chris PeBenito ab58ad
#DESC LoadPolicy - SELinux policy loading utilities
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Authors:  Frank Mayer, mayerf@tresys.com
Chris PeBenito ab58ad
# X-Debian-Packages: policycoreutils
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
###########################
Chris PeBenito ab58ad
# load_policy_t is the domain type for load_policy 
Chris PeBenito ab58ad
# load_policy_exec_t is the file type for the executable
Chris PeBenito ab58ad
Chris PeBenito ab58ad
Chris PeBenito ab58ad
type load_policy_t, domain;
Chris PeBenito ab58ad
role sysadm_r types load_policy_t;
Chris PeBenito ab58ad
role secadm_r types load_policy_t;
Chris PeBenito ab58ad
role system_r types load_policy_t;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
type load_policy_exec_t, file_type, exec_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
##########################
Chris PeBenito ab58ad
# 
Chris PeBenito ab58ad
# Rules
Chris PeBenito ab58ad
Chris PeBenito ab58ad
domain_auto_trans(secadmin, load_policy_exec_t, load_policy_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow load_policy_t console_device_t:chr_file { read write };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Reload the policy configuration (sysadm_t no longer has this ability)
Chris PeBenito ab58ad
can_loadpol(load_policy_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Reset policy boolean values.
Chris PeBenito ab58ad
can_setbool(load_policy_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
Chris PeBenito ab58ad
###########################
Chris PeBenito ab58ad
# constrain from where load_policy can load a policy, specifically 
Chris PeBenito ab58ad
# policy_config_t files 
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# only allow read of policy config files
Chris PeBenito ab58ad
allow load_policy_t policy_src_t:dir search;
Chris PeBenito ab58ad
r_dir_file(load_policy_t, policy_config_t)
Chris PeBenito ab58ad
r_dir_file(load_policy_t, selinux_config_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# directory search permissions for path to binary policy files
Chris PeBenito ab58ad
allow load_policy_t root_t:dir search;
Chris PeBenito ab58ad
allow load_policy_t etc_t:dir search;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# for mcs.conf
Chris PeBenito ab58ad
allow load_policy_t etc_t:file { getattr read };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Other access
Chris PeBenito ab58ad
can_access_pty(load_policy_t, initrc)
Chris PeBenito ab58ad
allow load_policy_t { admin_tty_type devtty_t }:chr_file { read write ioctl getattr };
Chris PeBenito ab58ad
uses_shlib(load_policy_t)
Chris PeBenito ab58ad
allow load_policy_t self:capability dac_override;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow load_policy_t { userdomain privfd initrc_t }:fd use;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow load_policy_t fs_t:filesystem getattr;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
read_locale(load_policy_t)