selinux-refpolicy/refpolicy/policy/modules/system/init.te

735 lines
17 KiB
Plaintext
Raw Normal View History

2005-04-20 19:07:16 +00:00
policy_module(init,1.3.1)
2005-10-18 15:07:11 +00:00
gen_require(`
class passwd rootok;
')
########################################
#
# Declarations
#
2005-07-07 15:25:28 +00:00
# used for direct running of init scripts
# by admin domains
attribute direct_run_init;
attribute direct_init;
attribute direct_init_entry;
2005-04-22 22:00:09 +00:00
#
2005-04-14 20:18:17 +00:00
# init_t is the domain of the init process.
#
2005-10-21 17:55:15 +00:00
# real declaration moved to mls until
# range_transition works in loadable modules
gen_require(`
type init_t;
')
2005-06-13 17:35:46 +00:00
domain_type(init_t)
2005-04-14 20:18:17 +00:00
role system_r types init_t;
2005-04-22 22:00:09 +00:00
#
# init_exec_t is the type of the init program.
#
# real declaration moved to mls until
# range_transition works in loadable modules
gen_require(`
type init_exec_t;
')
kernel_domtrans_to(init_t,init_exec_t)
2005-06-13 17:35:46 +00:00
domain_entry_file(init_t,init_exec_t)
2005-04-14 20:18:17 +00:00
2005-05-25 20:58:21 +00:00
#
# init_var_run_t is the type for /var/run/shutdown.pid.
#
type init_var_run_t;
2005-06-13 17:35:46 +00:00
files_pid_file(init_var_run_t)
2005-05-25 20:58:21 +00:00
2005-04-22 22:00:09 +00:00
#
# initctl_t is the type of the named pipe created
# by init during initialization. This pipe is used
# to communicate with init.
#
2005-09-26 20:26:32 +00:00
type initctl_t;
files_type(initctl_t)
2005-09-26 20:26:32 +00:00
mls_trusted_object(initctl_t)
2005-04-14 20:18:17 +00:00
# real declaration moved to mls until
# range_transition works in loadable modules
gen_require(`
type initrc_t;
')
2005-06-13 17:35:46 +00:00
domain_type(initrc_t)
2005-04-22 22:00:09 +00:00
role system_r types initrc_t;
2005-12-02 22:06:05 +00:00
# real declaration moved to mls until
# range_transition works in loadable modules
gen_require(`
type initrc_exec_t;
')
2005-06-13 17:35:46 +00:00
domain_entry_file(initrc_t,initrc_exec_t)
2005-04-22 22:00:09 +00:00
type initrc_devpts_t;
2005-06-10 01:01:13 +00:00
term_pty(initrc_devpts_t)
2005-09-05 18:17:17 +00:00
files_type(initrc_devpts_t)
2005-04-22 22:00:09 +00:00
type initrc_state_t;
files_type(initrc_state_t)
2005-04-22 22:00:09 +00:00
type initrc_tmp_t;
2005-06-13 17:35:46 +00:00
files_tmp_file(initrc_tmp_t)
2005-04-22 22:00:09 +00:00
2005-09-19 21:17:45 +00:00
type initrc_var_run_t;
files_pid_file(initrc_var_run_t)
2005-04-22 22:00:09 +00:00
########################################
#
# Init local policy
#
# Use capabilities. old rule:
allow init_t self:capability ~sys_module;
# is ~sys_module really needed? observed:
# sys_boot
# sys_tty_config
# kill: now provided by domain_kill_all_domains()
# setuid (from /sbin/shutdown)
2005-06-13 17:35:46 +00:00
# sys_chroot (from /usr/bin/chroot): now provided by corecmd_chroot_exec_chroot()
2005-06-09 14:50:48 +00:00
allow init_t self:fifo_file rw_file_perms;
2005-05-26 20:38:45 +00:00
2005-04-19 18:58:16 +00:00
# Re-exec itself
2005-05-30 21:17:20 +00:00
allow init_t init_exec_t:file { getattr read ioctl execute execute_no_trans };
2005-04-19 18:58:16 +00:00
2005-09-13 13:06:07 +00:00
allow init_t initrc_t:unix_stream_socket connectto;
2005-04-19 18:58:16 +00:00
# For /var/run/shutdown.pid.
allow init_t init_var_run_t:file { create getattr read append write setattr unlink };
files_pid_filetrans(init_t,init_var_run_t,file)
2005-04-19 18:58:16 +00:00
2005-05-25 20:58:21 +00:00
allow init_t initctl_t:fifo_file { create getattr read append write setattr unlink };
2005-06-10 01:01:13 +00:00
fs_associate_tmpfs(initctl_t)
2006-02-21 18:40:44 +00:00
dev_filetrans(init_t,initctl_t,fifo_file)
2005-05-25 20:58:21 +00:00
# Modify utmp.
2005-06-10 01:01:13 +00:00
allow init_t initrc_var_run_t:file { rw_file_perms setattr };
2005-06-09 20:50:17 +00:00
# Run init scripts.
domain_auto_trans(init_t,initrc_exec_t,initrc_t)
2005-04-14 20:18:17 +00:00
kernel_read_system_state(init_t)
kernel_share_state(init_t)
dev_read_sysfs(init_t)
mls_process_write_down(init_t)
selinux_set_boolean(init_t)
2005-06-10 01:01:13 +00:00
term_use_all_terms(init_t)
2005-04-14 20:18:17 +00:00
corecmd_exec_chroot(init_t)
2005-06-13 17:35:46 +00:00
corecmd_exec_bin(init_t)
corecmd_exec_sbin(init_t)
2005-05-24 22:22:26 +00:00
2005-04-14 20:18:17 +00:00
domain_kill_all_domains(init_t)
2005-05-27 20:44:05 +00:00
domain_signal_all_domains(init_t)
domain_signull_all_domains(init_t)
domain_sigstop_all_domains(init_t)
domain_sigstop_all_domains(init_t)
domain_sigchld_all_domains(init_t)
2005-04-14 20:18:17 +00:00
files_read_etc_files(init_t)
2005-06-13 17:35:46 +00:00
files_rw_generic_pids(init_t)
files_dontaudit_search_isid_type_dirs(init_t)
2005-06-13 17:35:46 +00:00
files_manage_etc_runtime_files(init_t)
2005-05-30 21:17:20 +00:00
# Run /etc/X11/prefdm:
files_exec_etc_files(init_t)
2005-05-24 22:22:26 +00:00
# file descriptors inherited from the rootfs:
files_dontaudit_rw_root_files(init_t)
files_dontaudit_rw_root_chr_files(init_t)
2005-04-19 18:58:16 +00:00
2005-06-13 17:35:46 +00:00
libs_use_ld_so(init_t)
libs_use_shared_libs(init_t)
libs_rw_ld_so_cache(init_t)
2005-04-14 20:18:17 +00:00
2005-06-13 17:35:46 +00:00
logging_send_syslog_msg(init_t)
logging_rw_generic_logs(init_t)
2005-04-19 20:43:44 +00:00
mcs_killall(init_t)
2005-09-26 20:26:32 +00:00
mls_file_read_up(init_t)
mls_file_write_down(init_t)
mls_rangetrans_target(init_t)
seutil_read_config(init_t)
2005-04-14 20:18:17 +00:00
miscfiles_read_localization(init_t)
ifdef(`distro_redhat',`
fs_rw_tmpfs_chr_files(init_t)
2006-02-21 18:40:44 +00:00
fs_tmpfs_filetrans(init_t,initctl_t,fifo_file)
2005-05-24 22:22:26 +00:00
')
ifdef(`targeted_policy',`
unconfined_domain(init_t)
')
optional_policy(`authlogin',`
2005-06-13 17:35:46 +00:00
auth_rw_login_records(init_t)
')
optional_policy(`nscd',`
2006-02-02 21:08:12 +00:00
nscd_socket_use(init_t)
2005-10-24 17:06:34 +00:00
')
optional_policy(`portmap',`
2006-02-02 21:08:12 +00:00
portmap_udp_send(init_t)
2005-09-08 17:12:38 +00:00
')
2005-05-26 20:38:45 +00:00
# Run the shell in the sysadm_t domain for single-user mode.
optional_policy(`userdomain',`
2005-06-13 17:35:46 +00:00
userdom_shell_domtrans_sysadm(init_t)
2005-05-26 20:38:45 +00:00
')
2005-09-13 13:06:07 +00:00
ifdef(`TODO',`
allow init_t ramfs_t:sock_file write;
')
2005-04-22 22:00:09 +00:00
########################################
2005-04-19 18:58:16 +00:00
#
2005-04-22 22:00:09 +00:00
# Init script local policy
2005-04-19 18:58:16 +00:00
#
2005-04-14 20:18:17 +00:00
allow initrc_t self:process { getpgid setsched setpgid setrlimit getsched };
allow initrc_t self:capability ~{ sys_admin sys_module };
allow initrc_t self:passwd rootok;
# Allow IPC with self
2005-06-09 14:50:48 +00:00
allow initrc_t self:unix_dgram_socket create_socket_perms;
2005-04-14 20:18:17 +00:00
allow initrc_t self:unix_stream_socket { create listen accept ioctl read getattr write setattr append bind connect getopt setopt shutdown connectto };
2005-06-09 14:50:48 +00:00
allow initrc_t self:tcp_socket create_stream_socket_perms;
allow initrc_t self:udp_socket create_socket_perms;
allow initrc_t self:fifo_file rw_file_perms;
allow initrc_t self:netlink_route_socket r_netlink_socket_perms;
2005-04-14 20:18:17 +00:00
2005-05-26 20:38:45 +00:00
allow initrc_t init_t:fd use;
allow initrc_t initrc_devpts_t:chr_file rw_term_perms;
term_create_pty(initrc_t,initrc_devpts_t)
can_exec(initrc_t,initrc_exec_t)
2005-05-30 21:17:20 +00:00
2005-06-09 14:50:48 +00:00
allow initrc_t initrc_state_t:dir create_dir_perms;
allow initrc_t initrc_state_t:file create_file_perms;
2005-04-14 20:18:17 +00:00
allow initrc_t initrc_state_t:lnk_file { create read getattr setattr unlink rename };
2005-06-09 14:50:48 +00:00
allow initrc_t initrc_var_run_t:file create_file_perms;
files_pid_filetrans(initrc_t,initrc_var_run_t,file)
can_exec(initrc_t,initrc_tmp_t)
2005-06-09 14:50:48 +00:00
allow initrc_t initrc_tmp_t:file create_file_perms;
allow initrc_t initrc_tmp_t:dir create_dir_perms;
2006-02-21 18:40:44 +00:00
files_tmp_filetrans(initrc_t,initrc_tmp_t, { file dir })
init_write_initctl(initrc_t)
2005-04-14 20:18:17 +00:00
kernel_read_system_state(initrc_t)
kernel_read_software_raid_state(initrc_t)
kernel_read_network_state(initrc_t)
kernel_read_ring_buffer(initrc_t)
kernel_change_ring_buffer_level(initrc_t)
kernel_clear_ring_buffer(initrc_t)
kernel_get_sysvipc_info(initrc_t)
kernel_read_all_sysctls(initrc_t)
kernel_rw_all_sysctls(initrc_t)
# for lsof which is used by alsa shutdown:
2005-06-10 01:01:13 +00:00
kernel_dontaudit_getattr_message_if(initrc_t)
2005-04-14 20:18:17 +00:00
files_read_kernel_symbol_table(initrc_t)
2005-04-14 20:18:17 +00:00
2005-06-10 01:01:13 +00:00
corenet_tcp_sendrecv_all_if(initrc_t)
corenet_raw_sendrecv_all_if(initrc_t)
corenet_udp_sendrecv_all_if(initrc_t)
corenet_tcp_sendrecv_all_nodes(initrc_t)
corenet_raw_sendrecv_all_nodes(initrc_t)
corenet_udp_sendrecv_all_nodes(initrc_t)
corenet_tcp_sendrecv_all_ports(initrc_t)
corenet_udp_sendrecv_all_ports(initrc_t)
2005-12-06 19:59:50 +00:00
corenet_non_ipsec_sendrecv(initrc_t)
2005-06-10 01:01:13 +00:00
corenet_tcp_bind_all_nodes(initrc_t)
corenet_udp_bind_all_nodes(initrc_t)
2005-09-13 13:06:07 +00:00
corenet_tcp_connect_all_ports(initrc_t)
2005-04-14 20:18:17 +00:00
2005-06-13 16:22:32 +00:00
dev_read_rand(initrc_t)
dev_read_urand(initrc_t)
dev_write_rand(initrc_t)
dev_write_urand(initrc_t)
2005-09-13 13:06:07 +00:00
dev_rw_sysfs(initrc_t)
dev_list_usbfs(initrc_t)
2005-06-13 16:22:32 +00:00
dev_read_framebuffer(initrc_t)
dev_read_realtime_clock(initrc_t)
dev_read_sound_mixer(initrc_t)
dev_write_sound_mixer(initrc_t)
2005-06-13 16:22:32 +00:00
dev_setattr_all_chr_files(initrc_t)
dev_read_lvm_control(initrc_t)
dev_delete_lvm_control_dev(initrc_t)
2005-09-15 15:34:31 +00:00
dev_manage_generic_symlinks(initrc_t)
dev_manage_generic_files(initrc_t)
2005-05-24 15:55:57 +00:00
# Wants to remove udev.tbl:
dev_delete_generic_symlinks(initrc_t)
2005-06-08 13:12:00 +00:00
fs_register_binary_executable_type(initrc_t)
2005-10-28 14:34:26 +00:00
# rhgb-console writes to ramfs
fs_write_ramfs_pipes(initrc_t)
# cjp: not sure why these are here; should use mount policy
2005-06-08 13:12:00 +00:00
fs_mount_all_fs(initrc_t)
fs_unmount_all_fs(initrc_t)
fs_remount_all_fs(initrc_t)
2005-06-10 01:01:13 +00:00
fs_getattr_all_fs(initrc_t)
2005-09-13 13:06:07 +00:00
selinux_get_enforce_mode(initrc_t)
2006-02-02 21:08:12 +00:00
storage_getattr_fixed_disk_dev(initrc_t)
storage_setattr_fixed_disk_dev(initrc_t)
storage_setattr_removable_dev(initrc_t)
2005-04-14 20:18:17 +00:00
2005-06-10 01:01:13 +00:00
term_use_all_terms(initrc_t)
term_reset_tty_labels(initrc_t)
2005-04-14 20:18:17 +00:00
2005-06-13 17:35:46 +00:00
auth_rw_login_records(initrc_t)
2006-01-17 17:50:10 +00:00
auth_setattr_login_records(initrc_t)
2005-06-13 17:35:46 +00:00
auth_rw_lastlog(initrc_t)
auth_read_pam_pid(initrc_t)
auth_delete_pam_pid(initrc_t)
2005-09-19 21:17:45 +00:00
auth_delete_pam_console_data(initrc_t)
2005-05-26 20:38:45 +00:00
2005-06-13 17:35:46 +00:00
corecmd_exec_bin(initrc_t)
corecmd_exec_sbin(initrc_t)
corecmd_exec_shell(initrc_t)
corecmd_exec_ls(initrc_t)
2005-04-14 20:18:17 +00:00
2005-05-05 17:44:11 +00:00
domain_kill_all_domains(initrc_t)
2005-05-30 21:17:20 +00:00
domain_signal_all_domains(initrc_t)
domain_signull_all_domains(initrc_t)
domain_sigstop_all_domains(initrc_t)
domain_sigstop_all_domains(initrc_t)
domain_sigchld_all_domains(initrc_t)
2005-06-13 17:35:46 +00:00
domain_read_all_domains_state(initrc_t)
2005-09-16 14:54:36 +00:00
domain_getattr_all_domains(initrc_t)
domain_dontaudit_ptrace_all_domains(initrc_t)
2005-06-13 17:35:46 +00:00
domain_getsession_all_domains(initrc_t)
2006-02-20 21:33:25 +00:00
domain_use_interactive_fds(initrc_t)
2005-09-01 20:13:42 +00:00
domain_exec_all_entry_files(initrc_t)
2005-05-30 21:17:20 +00:00
# for lsof which is used by alsa shutdown:
2005-06-13 17:35:46 +00:00
domain_dontaudit_getattr_all_udp_sockets(initrc_t)
domain_dontaudit_getattr_all_tcp_sockets(initrc_t)
2005-11-25 19:38:45 +00:00
domain_dontaudit_getattr_all_dgram_sockets(initrc_t)
domain_dontaudit_getattr_all_pipes(initrc_t)
2005-06-13 17:35:46 +00:00
files_getattr_all_dirs(initrc_t)
2005-06-13 17:35:46 +00:00
files_getattr_all_files(initrc_t)
files_getattr_all_symlinks(initrc_t)
files_getattr_all_pipes(initrc_t)
files_getattr_all_sockets(initrc_t)
2005-08-05 15:32:27 +00:00
files_purge_tmp(initrc_t)
files_delete_all_locks(initrc_t)
2005-06-13 17:35:46 +00:00
files_read_all_pids(initrc_t)
files_delete_all_pids(initrc_t)
2005-09-19 21:17:45 +00:00
files_delete_all_pid_dirs(initrc_t)
files_read_etc_files(initrc_t)
2005-06-13 17:35:46 +00:00
files_manage_etc_runtime_files(initrc_t)
files_manage_generic_locks(initrc_t)
files_exec_etc_files(initrc_t)
2005-06-13 17:35:46 +00:00
files_read_usr_files(initrc_t)
files_manage_urandom_seed(initrc_t)
files_manage_generic_spool(initrc_t)
2005-07-08 20:44:57 +00:00
# Mount and unmount file systems.
# cjp: not sure why these are here; should use mount policy
files_list_isid_type_dirs(initrc_t)
files_mounton_isid_type_dirs(initrc_t)
2005-07-08 20:44:57 +00:00
files_list_default(initrc_t)
files_mounton_default(initrc_t)
2005-06-13 17:35:46 +00:00
libs_rw_ld_so_cache(initrc_t)
libs_use_ld_so(initrc_t)
libs_use_shared_libs(initrc_t)
libs_exec_lib_files(initrc_t)
logging_send_syslog_msg(initrc_t)
2005-09-13 13:06:07 +00:00
logging_manage_generic_logs(initrc_t)
2005-05-26 20:38:45 +00:00
logging_read_all_logs(initrc_t)
logging_append_all_logs(initrc_t)
2006-02-02 21:08:12 +00:00
logging_read_audit_config(initrc_t)
2005-04-19 20:43:44 +00:00
2005-05-26 20:38:45 +00:00
miscfiles_read_localization(initrc_t)
# slapd needs to read cert files from its initscript
miscfiles_read_certs(initrc_t)
2005-04-25 21:28:25 +00:00
mcs_killall(initrc_t)
2005-09-26 20:26:32 +00:00
mls_file_read_up(initrc_t)
mls_file_write_down(initrc_t)
mls_process_read_up(initrc_t)
mls_process_write_down(initrc_t)
2006-01-06 22:51:40 +00:00
mls_rangetrans_source(initrc_t)
2005-09-26 20:26:32 +00:00
2006-02-02 21:08:12 +00:00
modutils_read_module_config(initrc_t)
2005-11-08 22:00:30 +00:00
modutils_domtrans_insmod(initrc_t)
2005-04-14 20:18:17 +00:00
seutil_read_config(initrc_t)
2005-04-14 20:18:17 +00:00
2005-06-13 17:35:46 +00:00
sysnet_read_config(initrc_t)
2005-04-14 20:18:17 +00:00
2005-06-13 17:35:46 +00:00
udev_rw_db(initrc_t)
2005-05-04 13:16:34 +00:00
2006-02-21 18:40:44 +00:00
userdom_read_all_users_home_content_files(initrc_t)
# Allow access to the sysadm TTYs. Note that this will give access to the
# TTYs to any process in the initrc_t domain. Therefore, daemons and such
# started from init should be placed in their own domain.
2005-06-13 17:35:46 +00:00
userdom_use_sysadm_terms(initrc_t)
ifdef(`distro_debian',`
dev_setattr_generic_dirs(initrc_t)
2005-07-08 20:44:57 +00:00
2006-02-21 18:40:44 +00:00
fs_tmpfs_filetrans(initrc_t,initrc_var_run_t,dir)
2005-07-08 20:44:57 +00:00
# for storing state under /dev/shm
fs_setattr_tmpfs_dirs(initrc_t)
storage_manage_fixed_disk(initrc_t)
storage_tmpfs_filetrans_fixed_disk(initrc_t)
2005-07-08 20:44:57 +00:00
files_setattr_etc_dirs(initrc_t)
')
2005-09-02 14:52:08 +00:00
ifdef(`distro_gentoo',`
optional_policy(`arpwatch',`
arpwatch_manage_data_files(initrc_t)
')
optional_policy(`dhcp',`
2005-09-02 14:52:08 +00:00
dhcpd_setattr_state_files(initrc_t)
')
')
ifdef(`distro_redhat',`
2005-06-01 13:51:54 +00:00
# this is from kmodule, which should get its own policy:
allow initrc_t self:capability sys_admin;
2005-05-31 23:02:11 +00:00
# Red Hat systems seem to have a stray
# fd open from the initrd
kernel_dontaudit_use_fds(initrc_t)
files_dontaudit_read_root_files(initrc_t)
2005-04-14 20:18:17 +00:00
selinux_set_enforce_mode(initrc_t)
2005-05-31 23:02:11 +00:00
# Create and read /boot/kernel.h and /boot/System.map.
# Redhat systems typically create this file at boot time.
2005-06-14 17:36:21 +00:00
bootloader_create_runtime_file(initrc_t)
files_rw_boot_symlinks(initrc_t)
2005-05-30 21:17:20 +00:00
2005-05-31 23:02:11 +00:00
# These seem to be from the initrd
# during device initialization:
dev_create_generic_dirs(initrc_t)
dev_rwx_zero(initrc_t)
2005-06-13 16:22:32 +00:00
dev_rx_raw_memory(initrc_t)
dev_wx_raw_memory(initrc_t)
2005-05-31 23:02:11 +00:00
storage_raw_read_fixed_disk(initrc_t)
storage_raw_write_fixed_disk(initrc_t)
2005-05-31 23:02:11 +00:00
files_create_boot_flag(initrc_t)
2005-10-28 14:34:26 +00:00
# wants to read /.fonts directory
files_read_default_files(initrc_t)
2005-11-11 16:08:03 +00:00
files_mountpoint(initrc_tmp_t)
2006-02-07 21:48:00 +00:00
fs_rw_tmpfs_chr_files(initrc_t)
storage_manage_fixed_disk(initrc_t)
storage_dev_filetrans_fixed_disk(initrc_t)
2006-02-07 21:48:00 +00:00
storage_getattr_removable_dev(initrc_t)
2006-01-06 22:51:40 +00:00
2005-05-31 23:02:11 +00:00
# readahead asks for these
2006-01-06 22:51:40 +00:00
auth_dontaudit_read_shadow(initrc_t)
2005-09-15 21:03:29 +00:00
2006-02-07 21:48:00 +00:00
miscfiles_read_fonts(initrc_t)
miscfiles_read_hwdata(initrc_t)
optional_policy(`bind',`
2006-02-02 21:08:12 +00:00
bind_manage_config_dirs(initrc_t)
2006-02-07 21:48:00 +00:00
bind_write_config(initrc_t)
2005-09-15 21:03:29 +00:00
')
2005-10-24 01:53:13 +00:00
optional_policy(`rpc',`
2005-10-24 01:53:13 +00:00
#for /etc/rc.d/init.d/nfs to create /etc/exports
rpc_write_exports(initrc_t)
')
2006-02-07 21:48:00 +00:00
optional_policy(`sysnetwork',`
sysnet_rw_dhcp_config(initrc_t)
')
optional_policy(`xserver',`
xserver_delete_log(initrc_t)
')
')
ifdef(`distro_suse',`
optional_policy(`xserver',`
# set permissions on /tmp/.X11-unix
xserver_setattr_xdm_tmp_dirs(initrc_t)
')
2005-06-01 13:51:54 +00:00
')
2005-05-13 14:37:13 +00:00
2005-07-08 20:44:57 +00:00
ifdef(`targeted_policy',`
2006-02-02 21:08:12 +00:00
domain_subj_id_change_exemption(initrc_t)
unconfined_domain(initrc_t)
2005-10-28 14:34:26 +00:00
',`
# cjp: require doesnt work in optionals :\
# this also would result in a type transition
# conflict if sendmail is enabled
# optional_policy(`sendmail',`',`
2005-10-28 14:34:26 +00:00
# mta_send_mail(initrc_t)
# ')
')
optional_policy(`amavis',`
amavis_search_lib(initrc_t)
amavis_setattr_pid_files(initrc_t)
')
optional_policy(`apm',`
2005-10-28 14:34:26 +00:00
dev_rw_apm_bios(initrc_t)
2005-07-08 20:44:57 +00:00
')
optional_policy(`apache',`
2005-10-05 21:17:22 +00:00
apache_read_config(initrc_t)
apache_list_modules(initrc_t)
')
2005-12-09 20:08:10 +00:00
optional_policy(`automount',`
2005-12-12 16:52:25 +00:00
automount_exec_config(initrc_t)
2005-12-09 20:08:10 +00:00
')
optional_policy(`bind',`
2005-08-23 17:26:19 +00:00
bind_read_config(initrc_t)
# for chmod in start script
2006-02-02 21:08:12 +00:00
bind_setattr_pid_dirs(initrc_t)
2005-08-23 17:26:19 +00:00
')
optional_policy(`bluetooth',`
2005-10-07 21:45:04 +00:00
dev_read_usbfs(initrc_t)
2006-01-06 22:51:40 +00:00
bluetooth_read_config(initrc_t)
2005-10-07 21:45:04 +00:00
')
optional_policy(`clamav',`
clamav_read_config(initrc_t)
')
optional_policy(`cpucontrol',`
2005-11-08 22:00:30 +00:00
cpucontrol_stub(initrc_t)
dev_getattr_cpu_dev(initrc_t)
2005-09-20 18:15:35 +00:00
')
2005-11-29 21:27:15 +00:00
optional_policy(`cups',`
cups_read_log(initrc_t)
')
optional_policy(`daemontools',`
daemontools_manage_svc(initrc_t)
')
optional_policy(`dbus',`
2005-10-28 14:34:26 +00:00
dbus_connect_system_bus(initrc_t)
2006-02-02 21:08:12 +00:00
dbus_send_system_bus(initrc_t)
2005-11-25 16:43:03 +00:00
dbus_system_bus_client_template(initrc,initrc_t)
2006-01-06 22:51:40 +00:00
dbus_read_config(initrc_t)
2005-10-28 14:34:26 +00:00
2005-11-25 16:43:03 +00:00
optional_policy(`networkmanager',`
networkmanager_dbus_chat(initrc_t)
2005-10-28 14:34:26 +00:00
')
')
optional_policy(`ftp',`
2005-09-27 22:29:45 +00:00
ftp_read_config(initrc_t)
')
optional_policy(`gpm',`
2005-08-17 21:28:31 +00:00
gpm_setattr_gpmctl(initrc_t)
')
optional_policy(`hotplug',`
dev_read_usbfs(initrc_t)
2005-05-31 23:02:11 +00:00
# init scripts run /etc/hotplug/usb.rc
hotplug_read_config(initrc_t)
2006-02-02 21:08:12 +00:00
modutils_read_module_deps(initrc_t)
')
optional_policy(`inn',`
inn_exec_config(initrc_t)
')
optional_policy(`ipsec',`
2005-07-18 18:31:49 +00:00
ipsec_read_config(initrc_t)
ipsec_manage_pid(initrc_t)
')
optional_policy(`kerberos',`
2005-07-01 13:31:34 +00:00
kerberos_use(initrc_t)
')
optional_policy(`ldap',`
2005-08-17 18:33:43 +00:00
ldap_read_config(initrc_t)
2006-02-02 21:08:12 +00:00
ldap_list_db(initrc_t)
2005-08-17 18:33:43 +00:00
')
optional_policy(`loadkeys',`
2005-08-15 14:46:17 +00:00
loadkeys_exec(initrc_t)
')
optional_policy(`lpd',`
2005-10-22 21:09:03 +00:00
# This is needed to permit chown to read /var/spool/lpd/lp.
# This is opens up security more than necessary; this means that ANYTHING
# running in the initrc_t domain can read the printer spool directory.
# Perhaps executing /etc/rc.d/init.d/lpd should transition
# to domain lpd_t, instead of waiting for executing lpd.
lpd_list_spool(initrc_t)
lpd_read_config(initrc_t)
')
optional_policy(`lvm',`
2005-05-31 23:02:11 +00:00
#allow initrc_t lvm_control_t:chr_file unlink;
2005-06-13 16:22:32 +00:00
dev_read_lvm_control(initrc_t)
dev_create_generic_chr_files(initrc_t)
2006-01-11 15:28:14 +00:00
lvm_read_config(initrc_t)
2005-05-30 21:17:20 +00:00
')
optional_policy(`mailman',`
2005-10-11 15:36:53 +00:00
mailman_list_data(initrc_t)
mailman_read_data_symlinks(initrc_t)
')
optional_policy(`mta',`
2006-01-06 22:51:40 +00:00
mta_read_config(initrc_t)
2006-02-02 21:08:12 +00:00
mta_dontaudit_read_spool_symlinks(initrc_t)
2005-07-08 20:44:57 +00:00
')
optional_policy(`mysql',`
2005-08-03 17:56:26 +00:00
ifdef(`distro_redhat',`
2006-02-02 21:08:12 +00:00
mysql_manage_db_dirs(initrc_t)
2005-08-03 17:56:26 +00:00
')
mysql_stream_connect(initrc_t)
mysql_write_log(initrc_t)
')
optional_policy(`nis',`
nis_use_ypbind(initrc_t)
2006-02-02 21:08:12 +00:00
nis_udp_send_ypbind(initrc_t)
2005-06-24 20:37:09 +00:00
nis_list_var_yp(initrc_t)
')
optional_policy(`nscd',`
2006-02-02 21:08:12 +00:00
nscd_socket_use(initrc_t)
2005-10-25 18:33:13 +00:00
')
optional_policy(`raid',`
2005-07-18 18:31:49 +00:00
raid_manage_mdadm_pid(initrc_t)
')
optional_policy(`rpc',`
2005-10-24 01:53:13 +00:00
rpc_read_exports(initrc_t)
')
optional_policy(`postgresql',`
2005-09-19 21:17:45 +00:00
postgresql_manage_db(initrc_t)
postgresql_read_config(initrc_t)
')
optional_policy(`postfix',`
2005-10-23 20:18:36 +00:00
postfix_list_spool(initrc_t)
')
optional_policy(`quota',`
2005-08-11 14:49:58 +00:00
quota_manage_flags(initrc_t)
')
optional_policy(`rhgb',`
2005-06-13 17:35:46 +00:00
corecmd_shell_entry_type(initrc_t)
2006-03-09 19:02:29 +00:00
fs_write_ramfs_sockets(initrc_t)
fs_search_ramfs(initrc_t)
rhgb_rw_stream_sockets(initrc_t)
rhgb_stream_connect(initrc_t)
2005-05-26 20:38:45 +00:00
')
optional_policy(`rpm',`
2005-05-31 23:02:11 +00:00
# bash tries to access a block device in the initrd
kernel_dontaudit_getattr_unlabeled_blk_files(initrc_t)
2005-05-31 23:02:11 +00:00
# for a bug in rm
2005-06-13 17:35:46 +00:00
files_dontaudit_write_all_pids(initrc_t)
2005-05-31 23:02:11 +00:00
# bash tries ioctl for some reason
2005-06-13 17:35:46 +00:00
files_dontaudit_ioctl_all_pids(initrc_t)
2005-05-31 23:02:11 +00:00
# why is this needed:
2005-06-13 17:35:46 +00:00
rpm_manage_db(initrc_t)
2005-07-08 20:44:57 +00:00
')
2005-05-24 15:55:57 +00:00
optional_policy(`samba',`
2005-09-14 18:33:53 +00:00
samba_rw_config(initrc_t)
2005-09-28 18:22:58 +00:00
samba_read_winbind_pid(initrc_t)
2005-09-14 18:33:53 +00:00
')
optional_policy(`squid',`
2005-09-02 19:11:07 +00:00
squid_read_config(initrc_t)
squid_manage_logs(initrc_t)
')
optional_policy(`ssh',`
2005-10-18 15:07:11 +00:00
ssh_dontaudit_read_server_keys(initrc_t)
')
2005-10-24 11:55:53 +00:00
# allow init scripts to su
optional_policy(`su',`
2005-10-24 11:55:53 +00:00
su_restricted_domain_template(initrc,initrc_t,system_r)
')
optional_policy(`sysnetwork',`
2005-06-29 20:53:53 +00:00
sysnet_read_dhcpc_state(initrc_t)
')
2006-02-16 21:33:18 +00:00
optional_policy(`uml',`
uml_setattr_util_sockets(initrc_t)
')
2005-11-25 19:09:08 +00:00
optional_policy(`xfs',`
miscfiles_manage_fonts(initrc_t)
# cjp: is this really needed?
2006-02-02 21:08:12 +00:00
xfs_read_sockets(initrc_t)
2005-11-25 19:09:08 +00:00
')
2006-02-07 21:48:00 +00:00
optional_policy(`xserver',`
# init s cript wants to check if it needs to update windowmanagerlist
xserver_read_xdm_rw_config(initrc_t)
')
optional_policy(`zebra',`
zebra_read_config(initrc_t)
')
2005-04-14 20:18:17 +00:00
ifdef(`TODO',`
# Set device ownerships/modes.
allow initrc_t xconsole_device_t:fifo_file setattr;
ifdef(`distro_redhat', `
2005-09-13 13:06:07 +00:00
allow initrc_t device_t:dir create;
2005-05-31 23:02:11 +00:00
')
2005-04-22 22:00:09 +00:00
') dnl end TODO