Chris PeBenito da12b5
policy_module(init, 1.15.3)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
gen_require(`
Chris PeBenito 17de1b
	class passwd rootok;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 47333d
## <desc>
Chris PeBenito 47333d
## 

Chris PeBenito 47333d
## Enable support for upstart as the init program.
Chris PeBenito 47333d
## 

Chris PeBenito 47333d
## </desc>
Chris PeBenito 3f67f7
gen_tunable(init_upstart, false)
Chris PeBenito 47333d
Dan Walsh 3eaa99
## <desc>
Dan Walsh 3eaa99
## 

Dan Walsh 3eaa99
## Enable support for systemd as the init program.
Dan Walsh 3eaa99
## 

Dan Walsh 3eaa99
## </desc>
Dan Walsh 3eaa99
gen_tunable(init_systemd, false)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
## <desc>
Dan Walsh 3eaa99
## 

Dan Walsh 3eaa99
## Allow all daemons the ability to read/write terminals
Dan Walsh 3eaa99
## 

Dan Walsh 3eaa99
## </desc>
Dan Walsh 3eaa99
gen_tunable(allow_daemons_use_tty, false)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
## <desc>
Dan Walsh 3eaa99
## 

Dan Walsh 3eaa99
## Allow all daemons to write corefiles to /
Dan Walsh 3eaa99
## 

Dan Walsh 3eaa99
## </desc>
Dan Walsh 3eaa99
gen_tunable(allow_daemons_dump_core, false)
Dan Walsh 3eaa99
Chris PeBenito 17de1b
# used for direct running of init scripts
Chris PeBenito 17de1b
# by admin domains
Chris PeBenito 17de1b
attribute direct_run_init;
Chris PeBenito 17de1b
attribute direct_init;
Chris PeBenito 17de1b
attribute direct_init_entry;
Chris PeBenito 17de1b
Chris PeBenito 6cc3f3
attribute init_script_domain_type;
Chris PeBenito 6cc3f3
attribute init_script_file_type;
Chris PeBenito 6cc3f3
attribute init_run_all_scripts_domain;
Dan Walsh 3eaa99
attribute initrc_transition_domain;
Chris PeBenito 6cc3f3
Chris PeBenito 693d4a
# Mark process types as daemons
Chris PeBenito 693d4a
attribute daemon;
Chris PeBenito 693d4a
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# init_t is the domain of the init process.
Chris PeBenito 17de1b
#
Dan Walsh 3eaa99
type init_t, initrc_transition_domain;
Chris PeBenito e070dd
type init_exec_t;
Chris PeBenito 17de1b
domain_type(init_t)
Chris PeBenito 3f67f7
domain_entry_file(init_t, init_exec_t)
Chris PeBenito 3f67f7
kernel_domtrans_to(init_t, init_exec_t)
Chris PeBenito e070dd
role system_r types init_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# init_var_run_t is the type for /var/run/shutdown.pid.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type init_var_run_t;
Chris PeBenito 17de1b
files_pid_file(init_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 04dcd7
# initctl_t is the type of the named pipe created
Chris PeBenito 17de1b
# by init during initialization.  This pipe is used
Chris PeBenito 17de1b
# to communicate with init.
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type initctl_t;
Chris PeBenito 17de1b
files_type(initctl_t)
Chris PeBenito 17de1b
mls_trusted_object(initctl_t)
Chris PeBenito 17de1b
Chris PeBenito 6cc3f3
type initrc_t, init_script_domain_type, init_run_all_scripts_domain;
Chris PeBenito 6cc3f3
type initrc_exec_t, init_script_file_type;
Chris PeBenito 17de1b
domain_type(initrc_t)
Chris PeBenito 3f67f7
domain_entry_file(initrc_t, initrc_exec_t)
Chris PeBenito e070dd
role system_r types initrc_t;
Chris PeBenito 47333d
# should be part of the true block
Chris PeBenito 47333d
# of the below init_upstart tunable
Chris PeBenito 47333d
# but this has a typeattribute in it
Chris PeBenito 47333d
corecmd_shell_entry_type(initrc_t)
Dan Walsh 3eaa99
corecmd_bin_entry_type(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type initrc_devpts_t;
Chris PeBenito 17de1b
term_pty(initrc_devpts_t)
Chris PeBenito 17de1b
files_type(initrc_devpts_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type initrc_state_t;
Chris PeBenito 17de1b
files_type(initrc_state_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type initrc_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(initrc_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type initrc_var_run_t;
Chris PeBenito 17de1b
files_pid_file(initrc_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito e070dd
ifdef(`enable_mls',`
Chris PeBenito 3f67f7
	kernel_ranged_domtrans_to(init_t, init_exec_t, s0 - mls_systemhigh)
Chris PeBenito e070dd
')
Chris PeBenito e070dd
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Init local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Use capabilities. old rule:
Dan Walsh 3eaa99
allow init_t self:capability ~{ audit_control audit_write sys_module };
Chris PeBenito 04dcd7
# is ~sys_module really needed? observed:
Chris PeBenito 17de1b
# sys_boot
Chris PeBenito 17de1b
# sys_tty_config
Chris PeBenito 17de1b
# kill: now provided by domain_kill_all_domains()
Chris PeBenito 17de1b
# setuid (from /sbin/shutdown)
Chris PeBenito 17de1b
# sys_chroot (from /usr/bin/chroot): now provided by corecmd_chroot_exec_chroot()
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow init_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Re-exec itself
Chris PeBenito 3f67f7
can_exec(init_t, init_exec_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
allow init_t initrc_t:unix_stream_socket { connectto rw_stream_socket_perms };
Dan Walsh 3eaa99
allow initrc_t init_t:unix_stream_socket { connectto rw_stream_socket_perms };
Dan Walsh 3eaa99
allow initrc_t init_t:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# For /var/run/shutdown.pid.
Chris PeBenito c0868a
allow init_t init_var_run_t:file manage_file_perms;
Chris PeBenito 3f67f7
files_pid_filetrans(init_t, init_var_run_t, file)
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow init_t initctl_t:fifo_file manage_fifo_file_perms;
Chris PeBenito 3f67f7
dev_filetrans(init_t, initctl_t, fifo_file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Modify utmp.
Chris PeBenito 17de1b
allow init_t initrc_var_run_t:file { rw_file_perms setattr };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(init_t)
Chris PeBenito 17de1b
kernel_share_state(init_t)
Dan Walsh 55e9f0
kernel_stream_connect(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_chroot(init_t)
Chris PeBenito 17de1b
corecmd_exec_bin(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(init_t)
Dan Walsh 3eaa99
dev_read_urand(init_t)
Jeremy Solt 2fc79f
# Early devtmpfs
Jeremy Solt 2fc79f
dev_rw_generic_chr_files(init_t)
Chris PeBenito 17de1b
Chris PeBenito ddd786
domain_getpgid_all_domains(init_t)
Chris PeBenito 17de1b
domain_kill_all_domains(init_t)
Chris PeBenito 17de1b
domain_signal_all_domains(init_t)
Chris PeBenito 17de1b
domain_signull_all_domains(init_t)
Chris PeBenito 17de1b
domain_sigstop_all_domains(init_t)
Dan Walsh 3eaa99
domain_sigstop_all_domains(init_t)
Chris PeBenito 17de1b
domain_sigchld_all_domains(init_t)
Dan Walsh 3eaa99
domain_read_all_domains_state(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(init_t)
Dan Walsh 3eaa99
files_read_all_pids(init_t)
Chris PeBenito 17de1b
files_rw_generic_pids(init_t)
Chris PeBenito 17de1b
files_dontaudit_search_isid_type_dirs(init_t)
Chris PeBenito 17de1b
files_manage_etc_runtime_files(init_t)
Chris PeBenito 3f67f7
files_etc_filetrans_etc_runtime(init_t, file)
Chris PeBenito 17de1b
# Run /etc/X11/prefdm:
Chris PeBenito 17de1b
files_exec_etc_files(init_t)
Chris PeBenito 17de1b
# file descriptors inherited from the rootfs:
Chris PeBenito 17de1b
files_dontaudit_rw_root_files(init_t)
Chris PeBenito 17de1b
files_dontaudit_rw_root_chr_files(init_t)
Chris PeBenito 17de1b
Chris PeBenito ddd786
fs_list_inotifyfs(init_t)
Chris PeBenito 17de1b
# cjp: this may be related to /dev/log
Chris PeBenito 17de1b
fs_write_ramfs_sockets(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
mcs_process_set_categories(init_t)
Chris PeBenito 2d0c9c
mcs_killall(init_t)
Chris PeBenito 17de1b
Chris PeBenito f8233a
mls_file_read_all_levels(init_t)
Chris PeBenito f8233a
mls_file_write_all_levels(init_t)
Chris PeBenito 17de1b
mls_process_write_down(init_t)
Chris PeBenito d9845a
mls_fd_use_all_levels(init_t)
Chris PeBenito 17de1b
Chris PeBenito f0435b
selinux_set_all_booleans(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_use_all_terms(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Run init scripts.
Chris PeBenito 17de1b
init_domtrans_script(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_rw_ld_so_cache(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(init_t)
Dan Walsh d7f202
logging_send_audit_msgs(init_t)
Chris PeBenito 17de1b
logging_rw_generic_logs(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
seutil_read_config(init_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(init_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
allow init_t self:process setsched;
Dan Walsh 3eaa99
Chris PeBenito d15dd5
ifdef(`distro_gentoo',`
Chris PeBenito d15dd5
	allow init_t self:process { getcap setcap };
Chris PeBenito d15dd5
')
Chris PeBenito d15dd5
Chris PeBenito 17de1b
ifdef(`distro_redhat',`
Chris PeBenito ddd786
	fs_read_tmpfs_symlinks(init_t)
Chris PeBenito 17de1b
	fs_rw_tmpfs_chr_files(init_t)
Chris PeBenito 3f67f7
	fs_tmpfs_filetrans(init_t, initctl_t, fifo_file)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Dan Walsh 3eaa99
tunable_policy(`init_upstart || init_systemd',`
Chris PeBenito 3f67f7
	corecmd_shell_domtrans(init_t, initrc_t)
Chris PeBenito 47333d
',`
Chris PeBenito 12cf80
	# Run the shell in the sysadm role for single-user mode.
Chris PeBenito 12cf80
	# causes problems with upstart
Chris PeBenito e9c6cd
	sysadm_shell_domtrans(init_t)
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Dan Walsh 3eaa99
storage_raw_rw_fixed_disk(init_t)
Dan Walsh 3eaa99
modutils_domtrans_insmod(init_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
tunable_policy(`init_systemd',`
Dan Walsh ac498f
	allow init_t self:unix_dgram_socket { create_socket_perms sendto };
Dan Walsh 3eaa99
	allow init_t self:process { setsockcreate setfscreate };
Dan Walsh 3eaa99
	allow init_t self:unix_stream_socket { create_stream_socket_perms connectto };
Dan Walsh 3eaa99
	allow init_t self:netlink_kobject_uevent_socket create_socket_perms; 
Dan Walsh 3eaa99
	# Until systemd is fixed
Dan Walsh 3eaa99
	allow daemon init_t:socket_class_set { getopt read getattr ioctl setopt write };
Dan Walsh 3eaa99
	allow init_t self:netlink_route_socket create_netlink_socket_perms;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	kernel_list_unlabeled(init_t)
Dan Walsh 3eaa99
	kernel_read_network_state(init_t)
Dan Walsh 3eaa99
	kernel_unmount_debugfs(init_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	dev_write_kmsg(init_t)
Dan Walsh 3eaa99
	dev_rw_autofs(init_t)
Dan Walsh 3eaa99
	dev_manage_generic_dirs(init_t)
Dan Walsh 3eaa99
	dev_manage_generic_files(init_t)
Dan Walsh 3eaa99
	dev_read_generic_chr_files(init_t)
Dan Walsh 3eaa99
	dev_relabelfrom_generic_chr_files(init_t)
Dan Walsh 3eaa99
	dev_relabel_autofs_dev(init_t)
Dan Walsh ac498f
	dev_manage_sysfs_dirs(init_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	files_mounton_all_mountpoints(init_t)
Dan Walsh 3eaa99
	files_manage_all_pids_dirs(init_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	fs_manage_cgroup_dirs(init_t)
Dan Walsh ee4b1e
	fs_manage_hugetlbfs_dirs(init_t)
Dan Walsh 3eaa99
	fs_manage_tmpfs_dirs(init_t)
Dan Walsh 3eaa99
	fs_mount_all_fs(init_t)
Dan Walsh 3eaa99
	fs_list_auto_mountpoints(init_t)
Dan Walsh 3eaa99
	fs_read_cgroup_files(init_t)
Dan Walsh 3eaa99
	fs_write_cgroup_files(init_t)
Dan Walsh ac498f
	fs_search_cgroup_dirs(daemon)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	selinux_compute_create_context(init_t)
Dan Walsh 3eaa99
	selinux_validate_context(init_t)
Dan Walsh 3eaa99
	selinux_unmount_fs(init_t)
Dan Walsh 3eaa99
Dan Walsh ac498f
	storage_getattr_removable_dev(init_t)
Dan Walsh ac498f
Dan Walsh 3eaa99
	init_read_script_state(init_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	seutil_read_file_contexts(init_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	auth_rw_login_records(init_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Dan Walsh 3eaa99
	consolekit_manage_log(init_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	dbus_connect_system_bus(init_t)
Chris PeBenito ddd786
	dbus_system_bus_client(init_t)
Dan Walsh ee4b1e
	dbus_delete_pid_files(init_t)
Chris PeBenito ddd786
')
Chris PeBenito ddd786
Chris PeBenito ddd786
optional_policy(`
Dan Walsh 3eaa99
	# /var/run/dovecot/login/ssl-parameters.dat is a hard link to
Dan Walsh 3eaa99
	# /var/lib/dovecot/ssl-parameters.dat and init tries to clean up
Dan Walsh 3eaa99
	# the directory. But we do not want to allow this.
Dan Walsh 3eaa99
	# The master process of dovecot will manage this file.
Dan Walsh 3eaa99
	dovecot_dontaudit_unlink_lib_files(initrc_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 17de1b
	nscd_socket_use(init_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 350b6a
optional_policy(`
Dan Walsh ac498f
	plymouthd_stream_connect(init_t)
Dan Walsh ac498f
	plymouthd_exec_plymouth(init_t)
Dan Walsh ac498f
')
Dan Walsh ac498f
Dan Walsh ac498f
optional_policy(`
Chris PeBenito ddd786
	sssd_stream_connect(init_t)
Chris PeBenito ddd786
')
Chris PeBenito ddd786
Chris PeBenito ddd786
optional_policy(`
Dan Walsh 3eaa99
	udev_read_db(init_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 350b6a
	unconfined_domain(init_t)
Chris PeBenito 350b6a
')
Chris PeBenito 350b6a
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Init script local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow initrc_t self:process { getpgid setsched setpgid setrlimit getsched };
Dan Walsh 3eaa99
allow initrc_t self:capability ~{ audit_control audit_write sys_admin sys_module };
Chris PeBenito 693d4a
dontaudit initrc_t self:capability sys_module; # sysctl is triggering this
Chris PeBenito 17de1b
allow initrc_t self:passwd rootok;
Chris PeBenito ddd786
allow initrc_t self:key manage_key_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Allow IPC with self
Chris PeBenito 17de1b
allow initrc_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow initrc_t self:unix_stream_socket { create listen accept ioctl read getattr write setattr append bind connect getopt setopt shutdown connectto };
Chris PeBenito 17de1b
allow initrc_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow initrc_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
allow initrc_t self:fifo_file rw_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow initrc_t initrc_devpts_t:chr_file rw_term_perms;
Chris PeBenito 3f67f7
term_create_pty(initrc_t, initrc_devpts_t)
Chris PeBenito 17de1b
Chris PeBenito d6d16b
# Going to single user mode
Chris PeBenito ddd786
init_telinit(initrc_t)
Chris PeBenito d6d16b
Chris PeBenito 6cc3f3
can_exec(initrc_t, init_script_file_type)
Chris PeBenito 6cc3f3
Chris PeBenito 6cc3f3
domtrans_pattern(init_run_all_scripts_domain, initrc_exec_t, initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
manage_dirs_pattern(initrc_t, initrc_state_t, initrc_state_t)
Chris PeBenito 3f67f7
manage_files_pattern(initrc_t, initrc_state_t, initrc_state_t)
Chris PeBenito 3f67f7
manage_lnk_files_pattern(initrc_t, initrc_state_t, initrc_state_t)
Chris PeBenito 3f67f7
manage_fifo_files_pattern(initrc_t, initrc_state_t, initrc_state_t)
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow initrc_t initrc_var_run_t:file manage_file_perms;
Chris PeBenito 3f67f7
files_pid_filetrans(initrc_t, initrc_var_run_t, file)
Dan Walsh 3eaa99
files_manage_generic_pids_symlinks(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
can_exec(initrc_t, initrc_tmp_t)
Chris PeBenito ddd786
manage_files_pattern(initrc_t, initrc_tmp_t, initrc_tmp_t)
Chris PeBenito ddd786
manage_dirs_pattern(initrc_t, initrc_tmp_t, initrc_tmp_t)
Chris PeBenito ddd786
manage_lnk_files_pattern(initrc_t, initrc_tmp_t, initrc_tmp_t)
Chris PeBenito 3f67f7
files_tmp_filetrans(initrc_t, initrc_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_write_initctl(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(initrc_t)
Chris PeBenito 17de1b
kernel_read_software_raid_state(initrc_t)
Chris PeBenito 17de1b
kernel_read_network_state(initrc_t)
Chris PeBenito 17de1b
kernel_read_ring_buffer(initrc_t)
Chris PeBenito 17de1b
kernel_change_ring_buffer_level(initrc_t)
Chris PeBenito 17de1b
kernel_clear_ring_buffer(initrc_t)
Chris PeBenito 17de1b
kernel_get_sysvipc_info(initrc_t)
Chris PeBenito 17de1b
kernel_read_all_sysctls(initrc_t)
Dan Walsh 3eaa99
kernel_request_load_module(initrc_t)
Chris PeBenito 17de1b
kernel_rw_all_sysctls(initrc_t)
Chris PeBenito 17de1b
# for lsof which is used by alsa shutdown:
Chris PeBenito 17de1b
kernel_dontaudit_getattr_message_if(initrc_t)
Dan Walsh 3eaa99
kernel_stream_connect(initrc_t)
Dan Walsh 3eaa99
files_read_kernel_modules(initrc_t)
Dan Walsh 3eaa99
files_read_config_files(initrc_t)
Dan Walsh 3eaa99
files_read_var_lib_symlinks(initrc_t)
Dan Walsh 3eaa99
files_setattr_pid_dirs(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_kernel_symbol_table(initrc_t)
Dan Walsh 3eaa99
files_exec_etc_files(initrc_t)
Dan Walsh 3eaa99
files_manage_etc_symlinks(initrc_t)
Dan Walsh 20f707
files_manage_system_conf_files(initrc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
fs_manage_tmpfs_dirs(initrc_t)
Dan Walsh 3eaa99
fs_tmpfs_filetrans(initrc_t, initrc_state_t, file)
Chris PeBenito 17de1b
Chris PeBenito 464ffa
corecmd_exec_all_executables(initrc_t)
Chris PeBenito 464ffa
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(initrc_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(initrc_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_if(initrc_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_if(initrc_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(initrc_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(initrc_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(initrc_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(initrc_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(initrc_t)
Chris PeBenito 17de1b
corenet_sendrecv_all_client_packets(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_rand(initrc_t)
Chris PeBenito 17de1b
dev_read_urand(initrc_t)
Chris PeBenito ddd786
dev_write_kmsg(initrc_t)
Chris PeBenito 17de1b
dev_write_rand(initrc_t)
Chris PeBenito 17de1b
dev_write_urand(initrc_t)
Chris PeBenito 17de1b
dev_rw_sysfs(initrc_t)
Chris PeBenito 17de1b
dev_list_usbfs(initrc_t)
Chris PeBenito 17de1b
dev_read_framebuffer(initrc_t)
Chris PeBenito ddd786
dev_write_framebuffer(initrc_t)
Chris PeBenito 17de1b
dev_read_realtime_clock(initrc_t)
Chris PeBenito 17de1b
dev_read_sound_mixer(initrc_t)
Chris PeBenito 17de1b
dev_write_sound_mixer(initrc_t)
Chris PeBenito 17de1b
dev_setattr_all_chr_files(initrc_t)
Chris PeBenito ddd786
dev_rw_lvm_control(initrc_t)
Dan Walsh 898c0d
dev_rw_generic_chr_files(initrc_t)
Chris PeBenito 17de1b
dev_delete_lvm_control_dev(initrc_t)
Chris PeBenito 17de1b
dev_manage_generic_symlinks(initrc_t)
Chris PeBenito 17de1b
dev_manage_generic_files(initrc_t)
Chris PeBenito 17de1b
# Wants to remove udev.tbl:
Chris PeBenito 17de1b
dev_delete_generic_symlinks(initrc_t)
Chris PeBenito ddd786
dev_getattr_all_blk_files(initrc_t)
Chris PeBenito ddd786
dev_getattr_all_chr_files(initrc_t)
Dan Walsh 3eaa99
dev_rw_xserver_misc(initrc_t)
Chris PeBenito ddd786
Chris PeBenito 17de1b
domain_kill_all_domains(initrc_t)
Chris PeBenito 17de1b
domain_signal_all_domains(initrc_t)
Chris PeBenito 17de1b
domain_signull_all_domains(initrc_t)
Chris PeBenito 17de1b
domain_sigstop_all_domains(initrc_t)
Dan Walsh 3eaa99
domain_sigstop_all_domains(initrc_t)
Chris PeBenito 17de1b
domain_sigchld_all_domains(initrc_t)
Chris PeBenito 17de1b
domain_read_all_domains_state(initrc_t)
Chris PeBenito 17de1b
domain_getattr_all_domains(initrc_t)
Chris PeBenito 17de1b
domain_dontaudit_ptrace_all_domains(initrc_t)
Chris PeBenito 17de1b
domain_getsession_all_domains(initrc_t)
Chris PeBenito 17de1b
domain_use_interactive_fds(initrc_t)
Chris PeBenito 17de1b
# for lsof which is used by alsa shutdown:
Chris PeBenito 17de1b
domain_dontaudit_getattr_all_udp_sockets(initrc_t)
Chris PeBenito 17de1b
domain_dontaudit_getattr_all_tcp_sockets(initrc_t)
Chris PeBenito 17de1b
domain_dontaudit_getattr_all_dgram_sockets(initrc_t)
Chris PeBenito 17de1b
domain_dontaudit_getattr_all_pipes(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_getattr_all_dirs(initrc_t)
Chris PeBenito 17de1b
files_getattr_all_files(initrc_t)
Chris PeBenito 17de1b
files_getattr_all_symlinks(initrc_t)
Chris PeBenito 17de1b
files_getattr_all_pipes(initrc_t)
Chris PeBenito 17de1b
files_getattr_all_sockets(initrc_t)
Chris PeBenito 17de1b
files_purge_tmp(initrc_t)
Dan Walsh 3eaa99
files_manage_all_locks(initrc_t)
Dan Walsh 3eaa99
files_manage_boot_files(initrc_t)
Chris PeBenito 17de1b
files_read_all_pids(initrc_t)
Dan Walsh 3eaa99
files_delete_root_files(initrc_t)
Chris PeBenito 17de1b
files_delete_all_pids(initrc_t)
Chris PeBenito 17de1b
files_delete_all_pid_dirs(initrc_t)
Chris PeBenito 17de1b
files_read_etc_files(initrc_t)
Chris PeBenito 17de1b
files_manage_etc_runtime_files(initrc_t)
Chris PeBenito 3f67f7
files_etc_filetrans_etc_runtime(initrc_t, file)
Chris PeBenito 17de1b
files_exec_etc_files(initrc_t)
Chris PeBenito 17de1b
files_read_usr_files(initrc_t)
Chris PeBenito 17de1b
files_manage_urandom_seed(initrc_t)
Chris PeBenito 17de1b
files_manage_generic_spool(initrc_t)
Chris PeBenito 17de1b
# Mount and unmount file systems.
Chris PeBenito 17de1b
# cjp: not sure why these are here; should use mount policy
Chris PeBenito 17de1b
files_list_isid_type_dirs(initrc_t)
Chris PeBenito 17de1b
files_mounton_isid_type_dirs(initrc_t)
Chris PeBenito 17de1b
files_list_default(initrc_t)
Chris PeBenito 17de1b
files_mounton_default(initrc_t)
Dan Walsh 3eaa99
files_manage_mnt_dirs(initrc_t)
Dan Walsh 3eaa99
files_manage_mnt_files(initrc_t)
Chris PeBenito 17de1b
Dan Walsh a947da
fs_delete_cgroup_dirs(initrc_t)
Dan Walsh a947da
fs_list_cgroup_dirs(initrc_t)
Dan Walsh a947da
fs_rw_cgroup_files(initrc_t)
Chris PeBenito ddd786
fs_list_inotifyfs(initrc_t)
Chris PeBenito 464ffa
fs_register_binary_executable_type(initrc_t)
Chris PeBenito 464ffa
# rhgb-console writes to ramfs
Chris PeBenito 464ffa
fs_write_ramfs_pipes(initrc_t)
Chris PeBenito 464ffa
# cjp: not sure why these are here; should use mount policy
Chris PeBenito 464ffa
fs_mount_all_fs(initrc_t)
Chris PeBenito 464ffa
fs_unmount_all_fs(initrc_t)
Chris PeBenito 464ffa
fs_remount_all_fs(initrc_t)
Chris PeBenito 464ffa
fs_getattr_all_fs(initrc_t)
Dan Walsh 3eaa99
fs_search_all(initrc_t)
Dan Walsh 3eaa99
fs_getattr_nfsd_files(initrc_t)
Chris PeBenito 464ffa
Chris PeBenito 464ffa
# initrc_t needs to do a pidof which requires ptrace
Chris PeBenito 464ffa
mcs_ptrace_all(initrc_t)
Chris PeBenito 464ffa
mcs_killall(initrc_t)
Chris PeBenito 464ffa
mcs_process_set_categories(initrc_t)
Chris PeBenito 464ffa
Chris PeBenito 464ffa
mls_file_read_all_levels(initrc_t)
Chris PeBenito 464ffa
mls_file_write_all_levels(initrc_t)
Chris PeBenito 464ffa
mls_process_read_up(initrc_t)
Chris PeBenito 464ffa
mls_process_write_down(initrc_t)
Chris PeBenito 464ffa
mls_rangetrans_source(initrc_t)
Chris PeBenito 464ffa
mls_fd_share_all_levels(initrc_t)
Dan Walsh 3eaa99
mls_socket_write_to_clearance(initrc_t)
Chris PeBenito 464ffa
Chris PeBenito 464ffa
selinux_get_enforce_mode(initrc_t)
Chris PeBenito 464ffa
Chris PeBenito 464ffa
storage_getattr_fixed_disk_dev(initrc_t)
Chris PeBenito 464ffa
storage_setattr_fixed_disk_dev(initrc_t)
Chris PeBenito 464ffa
storage_setattr_removable_dev(initrc_t)
Chris PeBenito 464ffa
Chris PeBenito 464ffa
term_use_all_terms(initrc_t)
Chris PeBenito 464ffa
term_reset_tty_labels(initrc_t)
Chris PeBenito 464ffa
Chris PeBenito 464ffa
auth_rw_login_records(initrc_t)
Chris PeBenito 464ffa
auth_setattr_login_records(initrc_t)
Chris PeBenito 464ffa
auth_rw_lastlog(initrc_t)
Chris PeBenito 464ffa
auth_read_pam_pid(initrc_t)
Chris PeBenito 464ffa
auth_delete_pam_pid(initrc_t)
Chris PeBenito 464ffa
auth_delete_pam_console_data(initrc_t)
Chris PeBenito c0cf6e
auth_use_nsswitch(initrc_t)
Dan Walsh 6ed3f1
auth_manage_faillog(initrc_t)
Chris PeBenito c0cf6e
Chris PeBenito 17de1b
libs_rw_ld_so_cache(initrc_t)
Chris PeBenito 17de1b
libs_exec_lib_files(initrc_t)
Chris PeBenito ddd786
libs_exec_ld_so(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito ddd786
logging_send_audit_msgs(initrc_t)
Chris PeBenito 17de1b
logging_send_syslog_msg(initrc_t)
Chris PeBenito 17de1b
logging_manage_generic_logs(initrc_t)
Chris PeBenito 17de1b
logging_read_all_logs(initrc_t)
Chris PeBenito 17de1b
logging_append_all_logs(initrc_t)
Chris PeBenito 17de1b
logging_read_audit_config(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(initrc_t)
Chris PeBenito 17de1b
# slapd needs to read cert files from its initscript
Dominick Grift 71f455
miscfiles_manage_generic_cert_files(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
modutils_read_module_config(initrc_t)
Chris PeBenito 17de1b
modutils_domtrans_insmod(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
seutil_read_config(initrc_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
userdom_read_admin_home_files(initrc_t)
Chris PeBenito 296273
userdom_read_user_home_content_files(initrc_t)
Chris PeBenito ddd786
# Allow access to the sysadm TTYs. Note that this will give access to the
Chris PeBenito 17de1b
# TTYs to any process in the initrc_t domain. Therefore, daemons and such
Chris PeBenito 17de1b
# started from init should be placed in their own domain.
Chris PeBenito 296273
userdom_use_user_terminals(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`distro_debian',`
Chris PeBenito 17de1b
	dev_setattr_generic_dirs(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
	fs_tmpfs_filetrans(initrc_t, initrc_var_run_t, dir)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# for storing state under /dev/shm
Chris PeBenito 17de1b
	fs_setattr_tmpfs_dirs(initrc_t)
Chris PeBenito 17de1b
	storage_manage_fixed_disk(initrc_t)
Chris PeBenito 17de1b
	storage_tmpfs_filetrans_fixed_disk(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_setattr_etc_dirs(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`distro_gentoo',`
Chris PeBenito d15dd5
	kernel_dontaudit_getattr_core_if(initrc_t)
Chris PeBenito d15dd5
Chris PeBenito d15dd5
	# seed udev /dev
Chris PeBenito d15dd5
	allow initrc_t self:process setfscreate;
Chris PeBenito d15dd5
	dev_create_null_dev(initrc_t)
Chris PeBenito d15dd5
	dev_create_zero_dev(initrc_t)
Chris PeBenito d15dd5
	dev_create_generic_dirs(initrc_t)
Chris PeBenito d15dd5
	term_create_console_dev(initrc_t)
Chris PeBenito d15dd5
Chris PeBenito bf469d
	# unfortunately /sbin/rc does stupid tricks
Chris PeBenito bf469d
	# with /dev/.rcboot to decide if we are in
Chris PeBenito bf469d
	# early init
Chris PeBenito bf469d
	dev_create_generic_dirs(initrc_t)
Chris PeBenito bf469d
	dev_delete_generic_dirs(initrc_t)
Chris PeBenito bf469d
Chris Richards 9b3e79
	# allow bootmisc to create /var/lock/.keep.
Chris Richards 9b3e79
	files_manage_generic_locks(initrc_t)
Chris Richards 9b3e79
Chris PeBenito cfdbf3
	# openrc uses tmpfs for its state data
Chris PeBenito cfdbf3
	fs_tmpfs_filetrans(initrc_t, initrc_state_t, { dir file fifo_file lnk_file })
Chris PeBenito e9b9e4
Chris PeBenito ce6bf7
	# init scripts touch this
Chris PeBenito ce6bf7
	clock_dontaudit_write_adjtime(initrc_t)
Chris PeBenito ce6bf7
Chris PeBenito efa0ac
	logging_send_audit_msgs(initrc_t)
Chris PeBenito efa0ac
Chris PeBenito e45324
	# for integrated run_init to read run_init_type.
Chris PeBenito e45324
	# happens during boot (/sbin/rc execs init scripts)
Chris PeBenito e45324
	seutil_read_default_contexts(initrc_t)
Chris PeBenito e45324
Chris PeBenito 2ed4f5
	# /lib/rcscripts/net/system.sh rewrites resolv.conf :(
Chris PeBenito 2ed4f5
	sysnet_create_config(initrc_t)
Chris PeBenito 2ed4f5
	sysnet_write_config(initrc_t)
Chris PeBenito ddd786
	sysnet_setattr_config(initrc_t)
Chris PeBenito 2ed4f5
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		arpwatch_manage_data_files(initrc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		dhcpd_setattr_state_files(initrc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`distro_redhat',`
Chris PeBenito 17de1b
	# this is from kmodule, which should get its own policy:
Chris PeBenito 17de1b
	allow initrc_t self:capability sys_admin;
Chris PeBenito 17de1b
Chris PeBenito 6b19be
	allow initrc_t self:process setfscreate;
Chris PeBenito 6b19be
Chris PeBenito 17de1b
	# Red Hat systems seem to have a stray
Chris PeBenito 17de1b
	# fd open from the initrd
Dan Walsh 3eaa99
	kernel_use_fds(initrc_t)
Chris PeBenito 17de1b
	files_dontaudit_read_root_files(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# These seem to be from the initrd
Chris PeBenito 17de1b
	# during device initialization:
Chris PeBenito 17de1b
	dev_create_generic_dirs(initrc_t)
Chris PeBenito 17de1b
	dev_rwx_zero(initrc_t)
Chris PeBenito 17de1b
	dev_rx_raw_memory(initrc_t)
Chris PeBenito 17de1b
	dev_wx_raw_memory(initrc_t)
Chris PeBenito 17de1b
	storage_raw_read_fixed_disk(initrc_t)
Chris PeBenito 17de1b
	storage_raw_write_fixed_disk(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito ddd786
	files_create_boot_dirs(initrc_t)
Chris PeBenito 17de1b
	files_create_boot_flag(initrc_t)
Chris PeBenito d9845a
	files_rw_boot_symlinks(initrc_t)
Chris PeBenito 17de1b
	# wants to read /.fonts directory
Chris PeBenito 17de1b
	files_read_default_files(initrc_t)
Chris PeBenito 17de1b
	files_mountpoint(initrc_tmp_t)
Chris PeBenito 6b19be
	# Needs to cp localtime to /var dirs
Chris PeBenito 6b19be
	files_write_var_dirs(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito ddd786
	fs_read_tmpfs_symlinks(initrc_t)
Chris PeBenito 17de1b
	fs_rw_tmpfs_chr_files(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	storage_manage_fixed_disk(initrc_t)
Chris PeBenito 17de1b
	storage_dev_filetrans_fixed_disk(initrc_t)
Chris PeBenito 17de1b
	storage_getattr_removable_dev(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# readahead asks for these
Chris PeBenito 17de1b
	auth_dontaudit_read_shadow(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
	# init scripts cp /etc/localtime over other directories localtime
Chris PeBenito 6b19be
	miscfiles_rw_localization(initrc_t)
Chris PeBenito 6b19be
	miscfiles_setattr_localization(initrc_t)
Chris PeBenito 6b19be
	miscfiles_relabel_localization(initrc_t)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
	miscfiles_read_fonts(initrc_t)
Chris PeBenito 17de1b
	miscfiles_read_hwdata(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito ddd786
		alsa_manage_rw_config(initrc_t)
Chris PeBenito ddd786
	')
Chris PeBenito ddd786
Chris PeBenito ddd786
	optional_policy(`
Chris PeBenito 17de1b
		bind_manage_config_dirs(initrc_t)
Chris PeBenito 17de1b
		bind_write_config(initrc_t)
Dan Walsh 3eaa99
		bind_setattr_zone_dirs(initrc_t)
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	optional_policy(`
Dan Walsh 3eaa99
		gnome_manage_gconf_config(initrc_t)
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	optional_policy(`
Dan Walsh 3eaa99
		ldap_read_db_files(initrc_t)
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	optional_policy(`
Dan Walsh 3eaa99
		pulseaudio_stream_connect(initrc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		#for /etc/rc.d/init.d/nfs to create /etc/exports
Chris PeBenito 17de1b
		rpc_write_exports(initrc_t)
Chris PeBenito ddd786
		rpc_manage_nfs_state_data(initrc_t)
Chris PeBenito 17de1b
	')
Dan Walsh 3eaa99
	optional_policy(`
Dan Walsh 3eaa99
		rpcbind_stream_connect(initrc_t)
Dan Walsh 3eaa99
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		sysnet_rw_dhcp_config(initrc_t)
Chris PeBenito ddd786
		sysnet_manage_config(initrc_t)
Dan Walsh 3eaa99
		sysnet_manage_dhcpc_state(initrc_t)
Dan Walsh 3eaa99
		sysnet_relabelfrom_dhcpc_state(initrc_t)
Dan Walsh 3eaa99
		sysnet_relabelfrom_net_conf(initrc_t)
Dan Walsh 3eaa99
		sysnet_relabelto_net_conf(initrc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		xserver_delete_log(initrc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`distro_suse',`
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		# set permissions on /tmp/.X11-unix
Chris PeBenito 17de1b
		xserver_setattr_xdm_tmp_dirs(initrc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Dan Walsh 3eaa99
domain_dontaudit_use_interactive_fds(daemon)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
userdom_dontaudit_list_admin_dir(daemon)
Dan Walsh 3eaa99
userdom_dontaudit_search_user_tmp(daemon)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
tunable_policy(`allow_daemons_use_tty',`
Dan Walsh 3eaa99
	term_use_unallocated_ttys(daemon)
Dan Walsh 3eaa99
	term_use_generic_ptys(daemon)
Dan Walsh 3eaa99
	term_use_all_ttys(daemon)
Dan Walsh 3eaa99
	term_use_all_ptys(daemon)
Dan Walsh 3eaa99
',`
Dan Walsh 3eaa99
	term_dontaudit_use_unallocated_ttys(daemon)
Dan Walsh 3eaa99
	term_dontaudit_use_generic_ptys(daemon)
Dan Walsh 3eaa99
	term_dontaudit_use_all_ttys(daemon)
Dan Walsh 3eaa99
	term_dontaudit_use_all_ptys(daemon)
Dan Walsh 3eaa99
 ')
Dan Walsh 3eaa99
 
Dan Walsh 3eaa99
# system-config-services causes avc messages that should be dontaudited
Dan Walsh 3eaa99
tunable_policy(`allow_daemons_dump_core',`
Dan Walsh 3eaa99
	files_manage_root_files(daemon)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	unconfined_dontaudit_rw_pipes(daemon)
Dan Walsh 3eaa99
	unconfined_dontaudit_rw_stream(daemon)
Dan Walsh 3eaa99
	userdom_dontaudit_read_user_tmp_files(daemon)
Dan Walsh 3eaa99
	userdom_dontaudit_write_user_tmp_files(daemon)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
 
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	amavis_search_lib(initrc_t)
Chris PeBenito 17de1b
	amavis_setattr_pid_files(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	dev_rw_apm_bios(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	apache_read_config(initrc_t)
Chris PeBenito 17de1b
	apache_list_modules(initrc_t)
Dan Walsh 3eaa99
	# webmin seems to cause this.
Dan Walsh 3eaa99
	apache_search_sys_content(daemon)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	bind_read_config(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# for chmod in start script
Chris PeBenito 17de1b
	bind_setattr_pid_dirs(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	dev_read_usbfs(initrc_t)
Chris PeBenito 17de1b
	bluetooth_read_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Dominick Grift 61d7ee
	cgroup_stream_connect_cgred(initrc_t)
Dan Walsh 3eaa99
	domain_setpriority_all_domains(initrc_t)
Dominick Grift 73f098
')
Dominick Grift 73f098
Dominick Grift 73f098
optional_policy(`
Chris PeBenito 17de1b
	clamav_read_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	cpucontrol_stub(initrc_t)
Chris PeBenito 17de1b
	dev_getattr_cpu_dev(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Dan Walsh 3eaa99
	chronyd_append_keys(initrc_t)
Dan Walsh 3eaa99
	chronyd_read_keys(initrc_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 17de1b
	dev_getattr_printer_dev(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	cups_read_log(initrc_t)
Chris PeBenito 17de1b
	cups_read_rw_config(initrc_t)
Chris PeBenito e2b84e
#cups init script clears error log
Chris PeBenito e2b84e
	cups_write_log(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	daemontools_manage_svc(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	dbus_connect_system_bus(initrc_t)
Chris PeBenito 296273
	dbus_system_bus_client(initrc_t)
Chris PeBenito 17de1b
	dbus_read_config(initrc_t)
Dan Walsh 3eaa99
	dbus_manage_lib_files(initrc_t)
Chris PeBenito 17de1b
Dan Walsh b36c20
	init_dbus_chat(initrc_t)
Dan Walsh b36c20
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito ddd786
		consolekit_dbus_chat(initrc_t)
Chris PeBenito ddd786
	')
Chris PeBenito ddd786
Chris PeBenito ddd786
	optional_policy(`
Chris PeBenito 17de1b
		networkmanager_dbus_chat(initrc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito ddd786
Chris PeBenito ddd786
	optional_policy(`
Chris PeBenito ddd786
		policykit_dbus_chat(initrc_t)
Chris PeBenito ddd786
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 834401
	# /var/run/dovecot/login/ssl-parameters.dat is a hard link to
Chris PeBenito 834401
	# /var/lib/dovecot/ssl-parameters.dat and init tries to clean up
Chris PeBenito 834401
	# the directory. But we do not want to allow this.
Chris PeBenito 834401
	# The master process of dovecot will manage this file.
Chris PeBenito 834401
	dovecot_dontaudit_unlink_lib_files(initrc_t)
Chris PeBenito 834401
')
Chris PeBenito 834401
Chris PeBenito 834401
optional_policy(`
Chris PeBenito 17de1b
	ftp_read_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	gpm_setattr_gpmctl(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito ddd786
	hal_write_log(initrc_t)
Chris PeBenito ddd786
')
Chris PeBenito ddd786
Chris PeBenito ddd786
optional_policy(`
Chris PeBenito 17de1b
	dev_read_usbfs(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# init scripts run /etc/hotplug/usb.rc
Chris PeBenito 17de1b
	hotplug_read_config(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	modutils_read_module_deps(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	inn_exec_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	ipsec_read_config(initrc_t)
Chris PeBenito 17de1b
	ipsec_manage_pid(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito ddd786
	iscsi_stream_connect(initrc_t)
Chris PeBenito ddd786
	iscsi_read_lib_files(initrc_t)
Chris PeBenito ddd786
')
Chris PeBenito ddd786
Chris PeBenito ddd786
optional_policy(`
Chris PeBenito 17de1b
	kerberos_use(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	ldap_read_config(initrc_t)
Chris PeBenito 17de1b
	ldap_list_db(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	loadkeys_exec(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito d46cfe
	# in emergency/recovery situations use sulogin
Chris PeBenito d46cfe
	locallogin_domtrans_sulogin(initrc_t)
Chris PeBenito d46cfe
')
Chris PeBenito d46cfe
Chris PeBenito d46cfe
optional_policy(`
Chris PeBenito 17de1b
	# This is needed to permit chown to read /var/spool/lpd/lp.
Chris PeBenito 17de1b
	# This is opens up security more than necessary; this means that ANYTHING
Chris PeBenito 17de1b
	# running in the initrc_t domain can read the printer spool directory.
Chris PeBenito 17de1b
	# Perhaps executing /etc/rc.d/init.d/lpd should transition
Chris PeBenito 17de1b
	# to domain lpd_t, instead of waiting for executing lpd.
Chris PeBenito 17de1b
	lpd_list_spool(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	lpd_read_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	#allow initrc_t lvm_control_t:chr_file unlink;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dev_read_lvm_control(initrc_t)
Chris PeBenito 17de1b
	dev_create_generic_chr_files(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	lvm_read_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	mailman_list_data(initrc_t)
Chris PeBenito 17de1b
	mailman_read_data_symlinks(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Dan Walsh dfe675
        milter_delete_dkim_pid_files(initrc_t)
Dan Walsh 3eaa99
	milter_setattr_all_dirs(initrc_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 17de1b
	mta_read_config(initrc_t)
Dan Walsh 3eaa99
	mta_write_config(initrc_t)
Chris PeBenito 17de1b
	mta_dontaudit_read_spool_symlinks(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	ifdef(`distro_redhat',`
Chris PeBenito 17de1b
		mysql_manage_db_dirs(initrc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	mysql_stream_connect(initrc_t)
Chris PeBenito 17de1b
	mysql_write_log(initrc_t)
Chris PeBenito ddd786
	mysql_read_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nis_list_var_yp(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	openvpn_read_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Dan Walsh 3eaa99
	plymouthd_stream_connect(initrc_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 17de1b
	postgresql_manage_db(initrc_t)
Chris PeBenito 17de1b
	postgresql_read_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	postfix_list_spool(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Craig Grube e87791
	puppet_rw_tmp(initrc_t)
Craig Grube e87791
')
Craig Grube e87791
Craig Grube e87791
optional_policy(`
Chris PeBenito 17de1b
	quota_manage_flags(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	raid_manage_mdadm_pid(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Dan Walsh 3eaa99
	ricci_manage_lib_files(initrc_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 17de1b
	fs_write_ramfs_sockets(initrc_t)
Chris PeBenito 17de1b
	fs_search_ramfs(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	rhgb_rw_stream_sockets(initrc_t)
Chris PeBenito 17de1b
	rhgb_stream_connect(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	rpc_read_exports(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	# bash tries to access a block device in the initrd
Chris PeBenito 17de1b
	kernel_dontaudit_getattr_unlabeled_blk_files(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# for a bug in rm
Chris PeBenito 17de1b
	files_dontaudit_write_all_pids(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# bash tries ioctl for some reason
Chris PeBenito 17de1b
	files_dontaudit_ioctl_all_pids(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	samba_rw_config(initrc_t)
Chris PeBenito 17de1b
	samba_read_winbind_pid(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Dan Walsh 3eaa99
    # shorewall-init script run /var/lib/shorewall/firewall
Dan Walsh 3eaa99
    shorewall_domtrans_lib(initrc_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 17de1b
	squid_read_config(initrc_t)
Chris PeBenito 17de1b
	squid_manage_logs(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Dan Walsh 3eaa99
ifdef(`enabled_mls',`
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 350b6a
	# allow init scripts to su
Chris PeBenito 3f67f7
	su_restricted_domain_template(initrc, initrc_t, system_r)
Chris PeBenito 350b6a
')
Dan Walsh 3eaa99
')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 17de1b
	ssh_dontaudit_read_server_keys(initrc_t)
Chris PeBenito ddd786
	ssh_setattr_key_files(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	sysnet_read_dhcpc_state(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_rw_db(initrc_t)
Chris PeBenito ddd786
	udev_manage_pid_files(initrc_t)
Chris Richards d56b33
	udev_manage_rules_files(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	uml_setattr_util_sockets(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Dan Walsh 3eaa99
	virt_manage_cache(initrc_t)
Dan Walsh 3eaa99
	virt_manage_lib_files(initrc_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
# Cron jobs used to start and stop services
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	cron_rw_pipes(daemon)
Dan Walsh 3eaa99
	cron_rw_inherited_user_spool_files(daemon)
Chris PeBenito ddd786
')
Chris PeBenito ddd786
Chris PeBenito ddd786
optional_policy(`
Chris PeBenito 350b6a
	unconfined_domain(initrc_t)
Dan Walsh 3eaa99
	domain_role_change_exemption(initrc_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	ifdef(`distro_redhat',`
Chris PeBenito 350b6a
		# system-config-services causes avc messages that should be dontaudited
Chris PeBenito 350b6a
		unconfined_dontaudit_rw_pipes(daemon)
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	optional_policy(`
Chris PeBenito 350b6a
		mono_domtrans(initrc_t)
Chris PeBenito 350b6a
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	# Allow SELinux aware applications to request rpm_script_t execution
Dan Walsh 3eaa99
	rpm_transition_script(initrc_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	
Dan Walsh 3eaa99
	optional_policy(`
Dan Walsh 3eaa99
		gen_require(`
Dan Walsh 3eaa99
			type unconfined_execmem_t, execmem_exec_t;		
Dan Walsh 3eaa99
		')
Dan Walsh 3eaa99
		init_system_domain(unconfined_execmem_t, execmem_exec_t)
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	optional_policy(`
Dan Walsh 3eaa99
		rtkit_scheduled(initrc_t)
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	rpm_delete_db(initrc_t)
Chris PeBenito 350b6a
')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 17de1b
	vmware_read_system_config(initrc_t)
Chris PeBenito 17de1b
	vmware_append_system_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	miscfiles_manage_fonts(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# cjp: is this really needed?
Chris PeBenito 17de1b
	xfs_read_sockets(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	# Set device ownerships/modes.
Chris PeBenito 17de1b
	xserver_setattr_console_pipes(initrc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# init script wants to check if it needs to update windowmanagerlist
Chris PeBenito 17de1b
	xserver_read_xdm_rw_config(initrc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	zebra_read_config(initrc_t)
Chris PeBenito 17de1b
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
userdom_inherit_append_user_home_content_files(daemon)
Dan Walsh 3eaa99
userdom_inherit_append_user_tmp_files(daemon)
Dan Walsh 3eaa99
userdom_dontaudit_rw_stream(daemon)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
logging_append_all_logs(daemon)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	# sudo service restart causes this 
Dan Walsh 3eaa99
	unconfined_signull(daemon)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	xserver_dontaudit_append_xdm_home_files(daemon)
Dan Walsh 3eaa99
	tunable_policy(`use_nfs_home_dirs',`
Dan Walsh 3eaa99
		fs_dontaudit_rw_nfs_files(daemon)
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
	tunable_policy(`use_samba_home_dirs',`
Dan Walsh 3eaa99
		fs_dontaudit_rw_cifs_files(daemon)
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
init_rw_script_stream_sockets(daemon)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
	fail2ban_read_lib_files(daemon)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
init_rw_stream_sockets(daemon)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
ifdef(`hide_broken_symptoms',`
Dan Walsh 3eaa99
optional_policy(`
Dan Walsh 3eaa99
gen_require(`
Dan Walsh 3eaa99
	type system_dbusd_var_run_t;
Dan Walsh 3eaa99
	type fsadm_t;
Dan Walsh 3eaa99
	type avahi_var_run_t;
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
fs_list_auto_mountpoints(fsadm_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
fs_list_auto_mountpoints(lvm_t)
Dan Walsh 3eaa99
fs_list_hugetlbfs(lvm_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
allow init_t avahi_var_run_t:dir { write add_name };
Dan Walsh 3eaa99
allow init_t avahi_var_run_t:sock_file create;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
allow init_t system_dbusd_var_run_t:dir { write add_name };
Dan Walsh 3eaa99
allow init_t system_dbusd_var_run_t:sock_file create;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
')