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