|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
12e9ea |
policy_module(selinuxutil,1.7.1)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
350b6a |
gen_require(`
|
|
Chris PeBenito |
350b6a |
bool secure_mode;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Declarations
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
attribute can_write_binary_policy;
|
|
Chris PeBenito |
17de1b |
attribute can_relabelto_binary_policy;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# selinux_config_t is the type applied to
|
|
Chris PeBenito |
17de1b |
# /etc/selinux/config
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# cjp: this is out of order due to rules
|
|
Chris PeBenito |
17de1b |
# in the domain_type interface
|
|
Chris PeBenito |
17de1b |
# (fix dup decl)
|
|
Chris PeBenito |
17de1b |
type selinux_config_t;
|
|
Chris PeBenito |
17de1b |
files_type(selinux_config_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type checkpolicy_t, can_write_binary_policy;
|
|
Chris PeBenito |
17de1b |
type checkpolicy_exec_t;
|
|
Chris PeBenito |
d46cfe |
application_domain(checkpolicy_t, checkpolicy_exec_t)
|
|
Chris PeBenito |
d46cfe |
role system_r types checkpolicy_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# default_context_t is the type applied to
|
|
Chris PeBenito |
17de1b |
# /etc/selinux/*/contexts/*
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
type default_context_t;
|
|
Chris PeBenito |
17de1b |
files_type(default_context_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# file_context_t is the type applied to
|
|
Chris PeBenito |
17de1b |
# /etc/selinux/*/contexts/files
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
type file_context_t;
|
|
Chris PeBenito |
17de1b |
files_type(file_context_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type load_policy_t;
|
|
Chris PeBenito |
17de1b |
type load_policy_exec_t;
|
|
Chris PeBenito |
d46cfe |
application_domain(load_policy_t,load_policy_exec_t)
|
|
Chris PeBenito |
d46cfe |
role system_r types load_policy_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type newrole_t;
|
|
Chris PeBenito |
d46cfe |
type newrole_exec_t;
|
|
Chris PeBenito |
d46cfe |
application_domain(newrole_t,newrole_exec_t)
|
|
Chris PeBenito |
17de1b |
domain_role_change_exemption(newrole_t)
|
|
Chris PeBenito |
17de1b |
domain_obj_id_change_exemption(newrole_t)
|
|
Chris PeBenito |
17de1b |
domain_interactive_fd(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# policy_config_t is the type of /etc/security/selinux/*
|
|
Chris PeBenito |
17de1b |
# the security server policy configuration.
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
type policy_config_t;
|
|
Chris PeBenito |
17de1b |
files_type(policy_config_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
neverallow ~can_relabelto_binary_policy policy_config_t:file relabelto;
|
|
Chris PeBenito |
17de1b |
#neverallow ~can_write_binary_policy policy_config_t:file { write append };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# policy_src_t is the type of the policy source
|
|
Chris PeBenito |
17de1b |
# files.
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
type policy_src_t;
|
|
Chris PeBenito |
17de1b |
files_type(policy_src_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type restorecond_t;
|
|
Chris PeBenito |
17de1b |
type restorecond_exec_t;
|
|
Chris PeBenito |
17de1b |
init_daemon_domain(restorecond_t,restorecond_exec_t)
|
|
Chris PeBenito |
17de1b |
domain_obj_id_change_exemption(restorecond_t)
|
|
Chris PeBenito |
17de1b |
role system_r types restorecond_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type restorecond_var_run_t;
|
|
Chris PeBenito |
17de1b |
files_pid_file(restorecond_var_run_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
e070dd |
type run_init_t;
|
|
Chris PeBenito |
17de1b |
type run_init_exec_t;
|
|
Chris PeBenito |
d46cfe |
application_domain(run_init_t,run_init_exec_t)
|
|
Chris PeBenito |
17de1b |
domain_system_change_exemption(run_init_t)
|
|
Chris PeBenito |
d46cfe |
role system_r types run_init_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type semanage_t;
|
|
Chris PeBenito |
17de1b |
type semanage_exec_t;
|
|
Chris PeBenito |
d46cfe |
application_domain(semanage_t,semanage_exec_t)
|
|
Chris PeBenito |
2d0c9c |
domain_interactive_fd(semanage_t)
|
|
Chris PeBenito |
17de1b |
role system_r types semanage_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type semanage_store_t;
|
|
Chris PeBenito |
17de1b |
files_type(semanage_store_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type semanage_read_lock_t;
|
|
Chris PeBenito |
17de1b |
files_type(semanage_read_lock_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type semanage_tmp_t;
|
|
Chris PeBenito |
17de1b |
files_tmp_file(semanage_tmp_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type semanage_trans_lock_t;
|
|
Chris PeBenito |
17de1b |
files_type(semanage_trans_lock_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
762d2c |
type setfiles_t alias restorecon_t, can_relabelto_binary_policy;
|
|
Chris PeBenito |
762d2c |
type setfiles_exec_t alias restorecon_exec_t;
|
|
Chris PeBenito |
762d2c |
init_system_domain(setfiles_t,setfiles_exec_t)
|
|
Chris PeBenito |
17de1b |
domain_obj_id_change_exemption(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`distro_redhat',`
|
|
Chris PeBenito |
17de1b |
init_system_domain(setfiles_t,setfiles_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Checkpolicy local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow checkpolicy_t self:capability dac_override;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# able to create and modify binary policy files
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(checkpolicy_t,policy_config_t,policy_config_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# allow test policies to be created in src directories
|
|
Chris PeBenito |
c0868a |
filetrans_add_pattern(checkpolicy_t,policy_src_t,policy_config_t,file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# only allow read of policy source files
|
|
Chris PeBenito |
c0868a |
read_files_pattern(checkpolicy_t,policy_src_t,policy_src_t)
|
|
Chris PeBenito |
c0868a |
read_lnk_files_pattern(checkpolicy_t,policy_src_t,policy_src_t)
|
|
Chris PeBenito |
c0868a |
allow checkpolicy_t selinux_config_t:dir search_dir_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_xattr_fs(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
term_use_console(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_list_usr(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
# directory search permissions for path to source and binary policy files
|
|
Chris PeBenito |
17de1b |
files_search_etc(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
init_use_fds(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
init_use_script_ptys(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_use_all_users_fds(checkpolicy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Load_policy local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow load_policy_t self:capability dac_override;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# only allow read of policy config files
|
|
Chris PeBenito |
c0868a |
read_files_pattern(load_policy_t,{ policy_src_t policy_config_t },policy_config_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
read_files_pattern(load_policy_t,selinux_config_t,selinux_config_t)
|
|
Chris PeBenito |
c0868a |
read_lnk_files_pattern(load_policy_t,selinux_config_t,selinux_config_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# for mcs.conf
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(load_policy_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_xattr_fs(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
f8233a |
mls_file_read_all_levels(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
selinux_get_fs_mount(load_policy_t)
|
|
Chris PeBenito |
17de1b |
selinux_load_policy(load_policy_t)
|
|
Chris PeBenito |
17de1b |
selinux_set_boolean(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
term_use_console(load_policy_t)
|
|
Chris PeBenito |
17de1b |
term_list_ptys(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
init_use_script_fds(load_policy_t)
|
|
Chris PeBenito |
17de1b |
init_use_script_ptys(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(load_policy_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_use_all_users_fds(load_policy_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`hide_broken_symptoms',`
|
|
Chris PeBenito |
17de1b |
# cjp: cover up stray file descriptors.
|
|
Chris PeBenito |
17de1b |
dontaudit load_policy_t selinux_config_t:file write;
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
unconfined_dontaudit_read_pipes(load_policy_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Newrole local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:capability { fowner setuid setgid dac_override };
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execheap execstack };
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:process setexec;
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:fd use;
|
|
Chris PeBenito |
c0868a |
allow newrole_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
c0868a |
allow newrole_t self:sock_file read_sock_file_perms;
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:shm create_shm_perms;
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:sem create_sem_perms;
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:msgq create_msgq_perms;
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:msg { send receive };
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:unix_dgram_socket sendto;
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:unix_stream_socket { create_stream_socket_perms connectto };
|
|
Chris PeBenito |
17de1b |
allow newrole_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
read_files_pattern(newrole_t,selinux_config_t,selinux_config_t)
|
|
Chris PeBenito |
c0868a |
read_lnk_files_pattern(newrole_t,selinux_config_t,selinux_config_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
read_files_pattern(newrole_t,default_context_t,default_context_t)
|
|
Chris PeBenito |
c0868a |
read_lnk_files_pattern(newrole_t,default_context_t,default_context_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(newrole_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_read_urand(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_xattr_fs(newrole_t)
|
|
Chris PeBenito |
17de1b |
fs_search_auto_mountpoints(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
f8233a |
mls_file_read_all_levels(newrole_t)
|
|
Chris PeBenito |
f8233a |
mls_file_write_all_levels(newrole_t)
|
|
Chris PeBenito |
17de1b |
mls_file_upgrade(newrole_t)
|
|
Chris PeBenito |
17de1b |
mls_file_downgrade(newrole_t)
|
|
Chris PeBenito |
17de1b |
mls_process_set_level(newrole_t)
|
|
Chris PeBenito |
d9845a |
mls_fd_share_all_levels(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
selinux_get_fs_mount(newrole_t)
|
|
Chris PeBenito |
17de1b |
selinux_validate_context(newrole_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_access_vector(newrole_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_create_context(newrole_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_relabel_context(newrole_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_user_contexts(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
term_use_all_user_ttys(newrole_t)
|
|
Chris PeBenito |
17de1b |
term_use_all_user_ptys(newrole_t)
|
|
Chris PeBenito |
17de1b |
term_relabel_all_user_ttys(newrole_t)
|
|
Chris PeBenito |
17de1b |
term_relabel_all_user_ptys(newrole_t)
|
|
Chris PeBenito |
17de1b |
term_getattr_unallocated_ttys(newrole_t)
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_unallocated_ttys(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
auth_domtrans_chk_passwd(newrole_t)
|
|
Chris PeBenito |
d9845a |
auth_rw_faillog(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_list_bin(newrole_t)
|
|
Chris PeBenito |
17de1b |
corecmd_read_bin_symlinks(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(newrole_t)
|
|
Chris PeBenito |
17de1b |
# for when the user types "exec newrole" at the command line:
|
|
Chris PeBenito |
17de1b |
domain_sigchld_interactive_fds(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# Write to utmp.
|
|
Chris PeBenito |
17de1b |
init_rw_utmp(newrole_t)
|
|
Chris PeBenito |
6b19be |
init_use_fds(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(newrole_t)
|
|
Chris PeBenito |
17de1b |
files_read_var_files(newrole_t)
|
|
Chris PeBenito |
17de1b |
files_read_var_symlinks(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(newrole_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_use_unpriv_users_fds(newrole_t)
|
|
Chris PeBenito |
17de1b |
# for some PAM modules and for cwd
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_search_all_users_home_content(newrole_t)
|
|
Chris PeBenito |
6b19be |
userdom_search_all_users_home_dirs(newrole_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
350b6a |
# if secure mode is enabled, then newrole
|
|
Chris PeBenito |
350b6a |
# can only transition to unprivileged users
|
|
Chris PeBenito |
350b6a |
if(secure_mode) {
|
|
Chris PeBenito |
350b6a |
userdom_spec_domtrans_unpriv_users(newrole_t)
|
|
Chris PeBenito |
350b6a |
} else {
|
|
Chris PeBenito |
350b6a |
userdom_spec_domtrans_all_users(newrole_t)
|
|
Chris PeBenito |
350b6a |
}
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
6b19be |
tunable_policy(`allow_polyinstantiation',`
|
|
Chris PeBenito |
6b19be |
files_polyinstantiate_all(newrole_t)
|
|
Chris PeBenito |
6b19be |
')
|
|
Chris PeBenito |
6b19be |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nis_use_ypbind(newrole_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nscd_socket_use(newrole_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Restorecond local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow restorecond_t self:capability { dac_override dac_read_search fowner };
|
|
Chris PeBenito |
c0868a |
allow restorecond_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
465510 |
allow restorecond_t self:netlink_route_socket r_netlink_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow restorecond_t restorecond_var_run_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
files_pid_filetrans(restorecond_t,restorecond_var_run_t, file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_use_fds(restorecond_t)
|
|
Chris PeBenito |
17de1b |
kernel_rw_pipes(restorecond_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(restorecond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
465510 |
fs_relabelfrom_noxattr_fs(restorecond_t)
|
|
Chris PeBenito |
465510 |
fs_dontaudit_list_nfs(restorecond_t)
|
|
Chris PeBenito |
17de1b |
fs_getattr_xattr_fs(restorecond_t)
|
|
Chris PeBenito |
17de1b |
fs_list_inotifyfs(restorecond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
selinux_get_fs_mount(restorecond_t)
|
|
Chris PeBenito |
17de1b |
selinux_validate_context(restorecond_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_access_vector(restorecond_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_create_context(restorecond_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_relabel_context(restorecond_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_user_contexts(restorecond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
465510 |
auth_relabel_all_files_except_shadow(restorecond_t )
|
|
Chris PeBenito |
465510 |
auth_read_all_files_except_shadow(restorecond_t)
|
|
Chris PeBenito |
d6d16b |
auth_use_nsswitch(restorecond_t)
|
|
Chris PeBenito |
465510 |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(restorecond_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(restorecond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
eac818 |
locallogin_dontaudit_use_fds(restorecond_t)
|
|
Chris PeBenito |
eac818 |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(restorecond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(restorecond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
465510 |
optional_policy(`
|
|
Chris PeBenito |
a5e213 |
rpm_use_script_fds(restorecond_t)
|
|
Chris PeBenito |
a5e213 |
')
|
|
Chris PeBenito |
a5e213 |
|
|
Chris PeBenito |
a5e213 |
optional_policy(`
|
|
Chris PeBenito |
465510 |
# restorecond watches for users logging in,
|
|
Chris PeBenito |
465510 |
# so it getspwnam when a user logs in to find his homedir
|
|
Chris PeBenito |
465510 |
nis_use_ypbind(restorecond_t)
|
|
Chris PeBenito |
465510 |
')
|
|
Chris PeBenito |
465510 |
|
|
Chris PeBenito |
17de1b |
#################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Run_init local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
allow run_init_t self:process setexec;
|
|
Chris PeBenito |
93ddc6 |
allow run_init_t self:capability setuid;
|
|
Chris PeBenito |
93ddc6 |
allow run_init_t self:fifo_file rw_file_perms;
|
|
Chris PeBenito |
93ddc6 |
allow run_init_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
# often the administrator runs such programs from a directory that is owned
|
|
Chris PeBenito |
93ddc6 |
# by a different user or has restrictive SE permissions, do not want to audit
|
|
Chris PeBenito |
93ddc6 |
# the failed access to the current directory
|
|
Chris PeBenito |
93ddc6 |
dontaudit run_init_t self:capability { dac_override dac_read_search };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
fs_getattr_xattr_fs(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
dev_dontaudit_list_all_dev_nodes(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
term_dontaudit_list_ptys(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
auth_domtrans_chk_passwd(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
auth_dontaudit_read_shadow(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
corecmd_exec_bin(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
corecmd_exec_shell(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
domain_use_interactive_fds(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
files_read_etc_files(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
files_dontaudit_search_all_dirs(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
selinux_get_fs_mount(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
selinux_validate_context(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
selinux_compute_access_vector(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
selinux_compute_create_context(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
selinux_compute_relabel_context(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
selinux_compute_user_contexts(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
mls_rangetrans_source(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
init_spec_domtrans_script(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
# for utmp
|
|
Chris PeBenito |
93ddc6 |
init_rw_utmp(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
libs_use_ld_so(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
libs_use_shared_libs(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
seutil_read_config(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
seutil_read_default_contexts(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
miscfiles_read_localization(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
logging_send_syslog_msg(run_init_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
ifndef(`direct_sysadm_daemon',`
|
|
Chris PeBenito |
93ddc6 |
ifdef(`distro_gentoo',`
|
|
Chris PeBenito |
93ddc6 |
# Gentoo integrated run_init:
|
|
Chris PeBenito |
93ddc6 |
init_script_file_entry_type(run_init_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
93ddc6 |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
optional_policy(`
|
|
Chris PeBenito |
93ddc6 |
daemontools_domtrans_start(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
93ddc6 |
optional_policy(`
|
|
Chris PeBenito |
93ddc6 |
nscd_socket_use(run_init_t)
|
|
Chris PeBenito |
93ddc6 |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# semodule local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
da9bbc |
allow semanage_t self:capability { dac_override audit_write };
|
|
Chris PeBenito |
17de1b |
allow semanage_t self:unix_stream_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow semanage_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow semanage_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow semanage_t policy_config_t:file { read write };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow semanage_t semanage_tmp_t:dir manage_dir_perms;
|
|
Chris PeBenito |
c0868a |
allow semanage_t semanage_tmp_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
files_tmp_filetrans(semanage_t, semanage_tmp_t, { file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(semanage_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_read_urand(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
98de87 |
domain_use_interactive_fds(semanage_t)
|
|
Chris PeBenito |
98de87 |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(semanage_t)
|
|
Chris PeBenito |
13d7ce |
files_read_etc_runtime_files(semanage_t)
|
|
Chris PeBenito |
17de1b |
files_read_usr_files(semanage_t)
|
|
Chris PeBenito |
17de1b |
files_list_pids(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
f8233a |
mls_file_write_all_levels(semanage_t)
|
|
Chris PeBenito |
f8233a |
mls_file_read_all_levels(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
d9845a |
selinux_validate_context(semanage_t)
|
|
Chris PeBenito |
17de1b |
selinux_get_enforce_mode(semanage_t)
|
|
Chris PeBenito |
abc893 |
selinux_getattr_fs(semanage_t)
|
|
Chris PeBenito |
17de1b |
# for setsebool:
|
|
Chris PeBenito |
17de1b |
selinux_set_boolean(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
term_use_all_terms(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
465510 |
# Running genhomedircon requires this for finding all users
|
|
Chris PeBenito |
465510 |
auth_use_nsswitch(semanage_t)
|
|
Chris PeBenito |
465510 |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(semanage_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
465510 |
locallogin_use_fds(semanage_t)
|
|
Chris PeBenito |
465510 |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
seutil_manage_file_contexts(semanage_t)
|
|
Chris PeBenito |
17de1b |
seutil_manage_selinux_config(semanage_t)
|
|
Chris PeBenito |
17de1b |
seutil_domtrans_setfiles(semanage_t)
|
|
Chris PeBenito |
17de1b |
seutil_domtrans_loadpolicy(semanage_t)
|
|
Chris PeBenito |
17de1b |
seutil_read_config(semanage_t)
|
|
Chris PeBenito |
17de1b |
seutil_manage_bin_policy(semanage_t)
|
|
Chris PeBenito |
17de1b |
seutil_use_newrole_fds(semanage_t)
|
|
Chris PeBenito |
17de1b |
seutil_manage_module_store(semanage_t)
|
|
Chris PeBenito |
17de1b |
seutil_get_semanage_trans_lock(semanage_t)
|
|
Chris PeBenito |
17de1b |
seutil_get_semanage_read_lock(semanage_t)
|
|
Chris PeBenito |
4bc6e3 |
# netfilter_contexts:
|
|
Chris PeBenito |
4bc6e3 |
seutil_manage_default_contexts(semanage_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
abc893 |
ifdef(`distro_debian',`
|
|
Chris PeBenito |
abc893 |
files_read_var_lib_files(semanage_t)
|
|
Chris PeBenito |
abc893 |
files_read_var_lib_symlinks(semanage_t)
|
|
Chris PeBenito |
abc893 |
')
|
|
Chris PeBenito |
abc893 |
|
|
Chris PeBenito |
ed38ca |
# cjp: need a more general way to handle this:
|
|
Chris PeBenito |
ed38ca |
ifdef(`enable_mls',`
|
|
Chris PeBenito |
ed38ca |
# read secadm tmp files
|
|
Chris PeBenito |
ed38ca |
',`
|
|
Chris PeBenito |
465510 |
# Handle pp files created in homedir and /tmp
|
|
Chris PeBenito |
ed38ca |
userdom_read_sysadm_home_content_files(semanage_t)
|
|
Chris PeBenito |
ed38ca |
userdom_read_sysadm_tmp_files(semanage_t)
|
|
Chris PeBenito |
350b6a |
|
|
Chris PeBenito |
350b6a |
optional_policy(`
|
|
Chris PeBenito |
350b6a |
unconfined_read_home_content_files(semanage_t)
|
|
Chris PeBenito |
350b6a |
unconfined_read_tmp_files(semanage_t)
|
|
Chris PeBenito |
350b6a |
')
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Setfiles local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow setfiles_t self:capability { dac_override dac_read_search fowner };
|
|
Chris PeBenito |
762d2c |
dontaudit setfiles_t self:capability sys_tty_config;
|
|
Chris PeBenito |
17de1b |
allow setfiles_t self:fifo_file rw_file_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
ef659a |
allow setfiles_t { policy_src_t policy_config_t file_context_t selinux_config_t default_context_t }:dir list_dir_perms;
|
|
Chris PeBenito |
ef659a |
allow setfiles_t { policy_src_t policy_config_t file_context_t selinux_config_t default_context_t }:file read_file_perms;
|
|
Chris PeBenito |
ef659a |
allow setfiles_t { policy_src_t policy_config_t file_context_t selinux_config_t default_context_t }:lnk_file { read_lnk_file_perms ioctl lock };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(setfiles_t)
|
|
Chris PeBenito |
17de1b |
kernel_relabelfrom_unlabeled_dirs(setfiles_t)
|
|
Chris PeBenito |
17de1b |
kernel_relabelfrom_unlabeled_files(setfiles_t)
|
|
Chris PeBenito |
17de1b |
kernel_relabelfrom_unlabeled_symlinks(setfiles_t)
|
|
Chris PeBenito |
17de1b |
kernel_relabelfrom_unlabeled_pipes(setfiles_t)
|
|
Chris PeBenito |
17de1b |
kernel_relabelfrom_unlabeled_sockets(setfiles_t)
|
|
Chris PeBenito |
762d2c |
kernel_use_fds(setfiles_t)
|
|
Chris PeBenito |
762d2c |
kernel_rw_pipes(setfiles_t)
|
|
Chris PeBenito |
762d2c |
kernel_rw_unix_dgram_sockets(setfiles_t)
|
|
Chris PeBenito |
762d2c |
kernel_dontaudit_list_all_proc(setfiles_t)
|
|
Chris PeBenito |
762d2c |
kernel_dontaudit_list_all_sysctls(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_relabel_all_dev_nodes(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_xattr_fs(setfiles_t)
|
|
Chris PeBenito |
17de1b |
fs_list_all(setfiles_t)
|
|
Chris PeBenito |
762d2c |
fs_search_auto_mountpoints(setfiles_t)
|
|
Chris PeBenito |
762d2c |
fs_relabelfrom_noxattr_fs(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
f8233a |
mls_file_read_all_levels(setfiles_t)
|
|
Chris PeBenito |
f8233a |
mls_file_write_all_levels(setfiles_t)
|
|
Chris PeBenito |
17de1b |
mls_file_upgrade(setfiles_t)
|
|
Chris PeBenito |
17de1b |
mls_file_downgrade(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
selinux_get_fs_mount(setfiles_t)
|
|
Chris PeBenito |
17de1b |
selinux_validate_context(setfiles_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_access_vector(setfiles_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_create_context(setfiles_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_relabel_context(setfiles_t)
|
|
Chris PeBenito |
17de1b |
selinux_compute_user_contexts(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
term_use_all_user_ttys(setfiles_t)
|
|
Chris PeBenito |
17de1b |
term_use_all_user_ptys(setfiles_t)
|
|
Chris PeBenito |
17de1b |
term_use_unallocated_ttys(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# this is to satisfy the assertion:
|
|
Chris PeBenito |
17de1b |
auth_relabelto_shadow(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
init_use_fds(setfiles_t)
|
|
Chris PeBenito |
17de1b |
init_use_script_fds(setfiles_t)
|
|
Chris PeBenito |
17de1b |
init_use_script_ptys(setfiles_t)
|
|
Chris PeBenito |
6b19be |
init_exec_script_files(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(setfiles_t)
|
|
Chris PeBenito |
762d2c |
domain_dontaudit_search_all_domains_state(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(setfiles_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(setfiles_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(setfiles_t)
|
|
Chris PeBenito |
17de1b |
files_list_all(setfiles_t)
|
|
Chris PeBenito |
17de1b |
files_relabel_all_files(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(setfiles_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_use_all_users_fds(setfiles_t)
|
|
Chris PeBenito |
17de1b |
# for config files in a home directory
|
|
Chris PeBenito |
17de1b |
userdom_read_all_users_home_content_files(setfiles_t)
|
|
Chris PeBenito |
6b19be |
|
|
Chris PeBenito |
762d2c |
ifdef(`distro_redhat', `
|
|
Chris PeBenito |
762d2c |
fs_rw_tmpfs_chr_files(setfiles_t)
|
|
Chris PeBenito |
762d2c |
fs_rw_tmpfs_blk_files(setfiles_t)
|
|
Chris PeBenito |
762d2c |
fs_relabel_tmpfs_blk_file(setfiles_t)
|
|
Chris PeBenito |
762d2c |
fs_relabel_tmpfs_chr_file(setfiles_t)
|
|
Chris PeBenito |
762d2c |
')
|
|
Chris PeBenito |
762d2c |
|
|
Chris PeBenito |
6b19be |
ifdef(`hide_broken_symptoms',`
|
|
Chris PeBenito |
762d2c |
optional_policy(`
|
|
Chris PeBenito |
762d2c |
udev_dontaudit_rw_dgram_sockets(setfiles_t)
|
|
Chris PeBenito |
762d2c |
')
|
|
Chris PeBenito |
762d2c |
|
|
Chris PeBenito |
6b19be |
# cjp: cover up stray file descriptors.
|
|
Chris PeBenito |
6b19be |
optional_policy(`
|
|
Chris PeBenito |
6b19be |
unconfined_dontaudit_read_pipes(setfiles_t)
|
|
Chris PeBenito |
762d2c |
unconfined_dontaudit_rw_tcp_sockets(setfiles_t)
|
|
Chris PeBenito |
6b19be |
')
|
|
Chris PeBenito |
6b19be |
')
|
|
Chris PeBenito |
762d2c |
|
|
Chris PeBenito |
762d2c |
optional_policy(`
|
|
Chris PeBenito |
762d2c |
hotplug_use_fds(setfiles_t)
|
|
Chris PeBenito |
762d2c |
')
|