Chris PeBenito 29af4c
policy_module(selinuxutil, 1.14.0)
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
Dan Walsh 3eaa99
type selinux_var_lib_t;
Dan Walsh 3eaa99
files_type(selinux_var_lib_t)
Dan Walsh 3eaa99
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 3f67f7
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 3f67f7
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
# policy_config_t is the type of /etc/security/selinux/*
Chris PeBenito 17de1b
# the security server policy configuration.
Chris PeBenito 17de1b
#
Dan Walsh 3eaa99
#type policy_config_t;
Dan Walsh 3eaa99
#files_type(policy_config_t)
Dan Walsh 3eaa99
typealias semanage_store_t alias 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 3f67f7
init_daemon_domain(restorecond_t, restorecond_exec_t)
Chris PeBenito 17de1b
domain_obj_id_change_exemption(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 3f67f7
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 3f67f7
application_domain(semanage_t, semanage_exec_t)
Dan Walsh 3eaa99
dbus_system_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
Dan Walsh 3eaa99
type setsebool_t;
Dan Walsh 3eaa99
type setsebool_exec_t;
Dan Walsh 3eaa99
init_system_domain(setsebool_t, setsebool_exec_t)
Dan Walsh 3eaa99
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 3f67f7
init_system_domain(setfiles_t, setfiles_exec_t)
Chris PeBenito 17de1b
domain_obj_id_change_exemption(setfiles_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
type setfiles_mac_t;
Dan Walsh 3eaa99
domain_type(setfiles_mac_t)
Dan Walsh 3eaa99
domain_entry_file(setfiles_mac_t, setfiles_exec_t)
Dan Walsh 3eaa99
domain_obj_id_change_exemption(setfiles_mac_t)
Dan Walsh 3eaa99
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 3f67f7
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 3f67f7
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 3f67f7
read_files_pattern(checkpolicy_t, policy_src_t, policy_src_t)
Chris PeBenito 3f67f7
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
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 389ad7
fs_getattr_xattr_fs(checkpolicy_t)
Chris PeBenito 389ad7
Chris PeBenito 389ad7
term_use_console(checkpolicy_t)
Chris PeBenito 389ad7
Chris PeBenito 17de1b
init_use_fds(checkpolicy_t)
Chris PeBenito 17de1b
init_use_script_ptys(checkpolicy_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
userdom_use_user_terminals(checkpolicy_t)
Chris PeBenito 17de1b
userdom_use_all_users_fds(checkpolicy_t)
Chris PeBenito 17de1b
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(checkpolicy_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
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 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_load_policy(load_policy_t)
Chris PeBenito f0435b
selinux_set_all_booleans(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)
Dan Walsh 3eaa99
init_write_script_pipes(load_policy_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(load_policy_t)
Chris PeBenito 17de1b
Chris PeBenito eeef8d
seutil_libselinux_linked(load_policy_t)
Chris PeBenito eeef8d
Chris PeBenito 296273
userdom_use_user_terminals(load_policy_t)
Chris PeBenito 17de1b
userdom_use_all_users_fds(load_policy_t)
Chris PeBenito 17de1b
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(load_policy_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
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 389ad7
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 };
Dan Walsh 3eaa99
logging_send_audit_msgs(newrole_t)
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
read_files_pattern(newrole_t, default_context_t, default_context_t)
Chris PeBenito 3f67f7
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 389ad7
corecmd_list_bin(newrole_t)
Chris PeBenito 389ad7
corecmd_read_bin_symlinks(newrole_t)
Chris PeBenito 389ad7
Chris PeBenito 17de1b
dev_read_urand(newrole_t)
Chris PeBenito 17de1b
Chris PeBenito 389ad7
domain_use_interactive_fds(newrole_t)
Chris PeBenito 389ad7
# for when the user types "exec newrole" at the command line:
Chris PeBenito 389ad7
domain_sigchld_interactive_fds(newrole_t)
Chris PeBenito 389ad7
Chris PeBenito 389ad7
files_read_etc_files(newrole_t)
Chris PeBenito 389ad7
files_read_var_files(newrole_t)
Chris PeBenito 389ad7
files_read_var_symlinks(newrole_t)
Chris PeBenito 389ad7
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_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 c3c753
term_use_all_ttys(newrole_t)
Chris PeBenito c3c753
term_use_all_ptys(newrole_t)
Chris PeBenito c3c753
term_relabel_all_ttys(newrole_t)
Chris PeBenito c3c753
term_relabel_all_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
Dan Walsh 3eaa99
auth_use_pam(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
miscfiles_read_localization(newrole_t)
Chris PeBenito 17de1b
Chris PeBenito eeef8d
seutil_libselinux_linked(newrole_t)
Chris PeBenito eeef8d
Dan Walsh 3eaa99
userdom_use_unpriv_users_fds(newrole_t)
Chris PeBenito 17de1b
# for some PAM modules and for cwd
Chris PeBenito 296273
userdom_dontaudit_search_user_home_content(newrole_t)
Chris PeBenito 296273
userdom_search_user_home_dirs(newrole_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	xserver_dontaudit_exec_xauth(newrole_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(newrole_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
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
########################################
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 17de1b
Chris PeBenito c0868a
allow restorecond_t restorecond_var_run_t:file manage_file_perms;
Chris PeBenito 3f67f7
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
Dan Walsh 3eaa99
files_dontaudit_read_all_symlinks(restorecond_t)
Dan Walsh 3eaa99
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_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 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 eeef8d
seutil_libselinux_linked(restorecond_t)
Chris PeBenito a5e213
Dan Walsh 3eaa99
userdom_read_user_home_content_symlinks(restorecond_t)
Dan Walsh 3eaa99
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(restorecond_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Chris PeBenito a5e213
optional_policy(`
Chris PeBenito eeef8d
	rpm_use_script_fds(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;
Dan Walsh 3eaa99
logging_send_audit_msgs(run_init_t)
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
corecmd_exec_bin(run_init_t)
Chris PeBenito 93ddc6
corecmd_exec_shell(run_init_t)
Chris PeBenito 17de1b
Chris PeBenito 389ad7
dev_dontaudit_list_all_dev_nodes(run_init_t)
Chris PeBenito 389ad7
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 389ad7
fs_getattr_xattr_fs(run_init_t)
Chris PeBenito 389ad7
Chris PeBenito 389ad7
mls_rangetrans_source(run_init_t)
Chris PeBenito 389ad7
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 013783
auth_use_nsswitch(run_init_t)
Chris PeBenito 389ad7
auth_domtrans_chk_passwd(run_init_t)
Chris PeBenito 9323a5
auth_domtrans_upd_passwd(run_init_t)
Chris PeBenito 389ad7
auth_dontaudit_read_shadow(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 389ad7
logging_send_syslog_msg(run_init_t)
Chris PeBenito 17de1b
Chris PeBenito 93ddc6
miscfiles_read_localization(run_init_t)
Chris PeBenito 17de1b
Chris PeBenito 389ad7
seutil_libselinux_linked(run_init_t)
Chris PeBenito 389ad7
seutil_read_default_contexts(run_init_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
userdom_use_user_terminals(run_init_t)
Chris PeBenito 296273
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
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	rpm_domtrans(run_init_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(run_init_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Chris PeBenito 93ddc6
optional_policy(`
Chris PeBenito 93ddc6
	daemontools_domtrans_start(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
Dan Walsh 3eaa99
seutil_semanage_policy(semanage_t)
Dan Walsh 3eaa99
allow semanage_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
Dan Walsh 3eaa99
manage_dirs_pattern(semanage_t, selinux_var_lib_t,  selinux_var_lib_t)
Dan Walsh 3eaa99
manage_files_pattern(semanage_t, selinux_var_lib_t,  selinux_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito f0435b
selinux_set_all_booleans(semanage_t)
Dan Walsh 3eaa99
can_exec(semanage_t, semanage_exec_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
# Admins are creating pp files in random locations
Dan Walsh 3eaa99
auth_read_all_files_except_shadow(semanage_t)
Chris PeBenito 465510
Chris PeBenito 17de1b
seutil_manage_file_contexts(semanage_t)
Chris PeBenito 389ad7
seutil_manage_config(semanage_t)
Chris PeBenito 17de1b
seutil_domtrans_setfiles(semanage_t)
Dan Walsh 3eaa99
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
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	setrans_initrc_domtrans(semanage_t)
Dan Walsh 3eaa99
        domain_system_change_exemption(semanage_t)
Dan Walsh 3eaa99
	consoletype_exec(semanage_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(semanage_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	#signal mcstrans on reload
Dan Walsh 3eaa99
	init_spec_domtrans_script(semanage_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
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 296273
	userdom_read_user_home_content_files(semanage_t)
Chris PeBenito 296273
	userdom_read_user_tmp_files(semanage_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Dan Walsh 3eaa99
userdom_search_admin_dir(semanage_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
####################################n####
Chris PeBenito 17de1b
#
Dan Walsh 3eaa99
# setsebool local policy
Chris PeBenito 17de1b
#
Dan Walsh 3eaa99
seutil_semanage_policy(setsebool_t)
Dan Walsh 3eaa99
selinux_set_all_booleans(setsebool_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
init_dontaudit_use_fds(setsebool_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
# Bug in semanage
Dan Walsh 3eaa99
seutil_domtrans_setfiles(setsebool_t)
Dan Walsh 3eaa99
seutil_manage_file_contexts(setsebool_t)
Dan Walsh 3eaa99
seutil_manage_default_contexts(setsebool_t)
Dan Walsh 3eaa99
seutil_manage_config(setsebool_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
# Setfiles local policy
Dan Walsh 3eaa99
#
Chris PeBenito 6b19be
Dan Walsh 3eaa99
seutil_setfiles(setfiles_t)
Dan Walsh 3eaa99
# During boot in Rawhide
Dan Walsh 3eaa99
term_use_generic_ptys(setfiles_t)
Chris PeBenito 1483be
Dan Walsh 3eaa99
seutil_setfiles(setfiles_mac_t)
Dan Walsh 3eaa99
allow setfiles_mac_t self:capability2 mac_admin;
Dan Walsh 3eaa99
kernel_relabelto_unlabeled(setfiles_mac_t)
Chris PeBenito 762d2c
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	files_dontaudit_write_isid_chr_files(setfiles_mac_t)
Dan Walsh 3eaa99
	livecd_dontaudit_leaks(setfiles_mac_t)
Dan Walsh 3eaa99
	livecd_rw_tmp_files(setfiles_mac_t)
Dan Walsh 3eaa99
	dev_dontaudit_write_all_chr_files(setfiles_mac_t)
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Chris PeBenito 6b19be
ifdef(`hide_broken_symptoms',`
Chris PeBenito 762d2c
	optional_policy(`
Dan Walsh 3eaa99
		setroubleshoot_fixit_dontaudit_leaks(setfiles_t)
Dan Walsh 3eaa99
		setroubleshoot_fixit_dontaudit_leaks(setsebool_t)
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
')
Chris PeBenito 762d2c
Chris PeBenito 762d2c
optional_policy(`
Dan Walsh 3eaa99
	unconfined_domain(setfiles_mac_t)
Dan Walsh 3eaa99
')