selinux-refpolicy/policy/modules/kernel/selinux.te

70 lines
2.2 KiB
Plaintext
Raw Normal View History

policy_module(selinux, 1.10.1)
2005-06-14 20:40:09 +00:00
########################################
#
# Declarations
#
## <desc>
## <p>
## Boolean to determine whether the system permits loading policy, setting
## enforcing mode, and changing boolean values. Set this to true and you
## have to reboot to set it back.
## </p>
## </desc>
gen_bool(secure_mode_policyload,false)
attribute boolean_type;
2005-07-05 20:59:51 +00:00
attribute can_load_policy;
attribute can_setenforce;
attribute can_setsecparam;
attribute selinux_unconfined_type;
2005-07-05 20:59:51 +00:00
type secure_mode_policyload_t;
selinux_labeled_boolean(secure_mode_policyload_t, secure_mode_policyload)
2005-06-14 20:40:09 +00:00
#
# security_t is the target type when checking
# the permissions in the security class. It is also
# applied to selinuxfs inodes.
#
type security_t, boolean_type;
fs_type(security_t)
2005-09-26 20:26:32 +00:00
mls_trusted_object(security_t)
sid security gen_context(system_u:object_r:security_t,mls_systemhigh)
genfscon selinuxfs / gen_context(system_u:object_r:security_t,s0)
genfscon securityfs / gen_context(system_u:object_r:security_t,s0)
2005-07-05 20:59:51 +00:00
neverallow ~{ selinux_unconfined_type can_load_policy } security_t:security load_policy;
neverallow ~{ selinux_unconfined_type can_setenforce } security_t:security setenforce;
neverallow ~{ selinux_unconfined_type can_setsecparam } security_t:security setsecparam;
########################################
#
# Unconfined access to this module
#
# use SELinuxfs
allow selinux_unconfined_type security_t:dir list_dir_perms;
allow selinux_unconfined_type security_t:file rw_file_perms;
allow selinux_unconfined_type boolean_type:file read_file_perms;
allow selinux_unconfined_type { boolean_type -secure_mode_policyload_t }:file write_file_perms;
# Access the security API.
allow selinux_unconfined_type security_t:security ~{ load_policy setenforce };
ifdef(`distro_rhel4',`
# needed for systems without audit support
auditallow selinux_unconfined_type security_t:security setbool;
')
if(!secure_mode_policyload) {
allow selinux_unconfined_type security_t:security { load_policy setenforce };
allow selinux_unconfined_type secure_mode_policyload_t:file write_file_perms;
ifdef(`distro_rhel4',`
# needed for systems without audit support
auditallow selinux_unconfined_type security_t:security { load_policy setenforce };
')
}