Chris PeBenito 6b9383
Chris PeBenito ac9aa2
policy_module(hotplug,1.0.1)
Chris PeBenito 6b9383
Chris PeBenito 6b9383
########################################
Chris PeBenito 6b9383
#
Chris PeBenito 6b9383
# Declarations
Chris PeBenito 6b9383
#
Chris PeBenito 6b9383
Chris PeBenito 6b9383
type hotplug_t;
Chris PeBenito 6b9383
type hotplug_exec_t;
Chris PeBenito 0fd9dc
kernel_userland_entry(hotplug_t,hotplug_exec_t)
Chris PeBenito b53f93
init_daemon_domain(hotplug_t,hotplug_exec_t)
Chris PeBenito 6b9383
Chris PeBenito 9bbc75
type hotplug_etc_t;
Chris PeBenito 9bbc75
files_config_file(hotplug_etc_t)
Chris PeBenito 712566
kernel_search_from(hotplug_etc_t)
Chris PeBenito 725926
init_daemon_domain(hotplug_t,hotplug_etc_t)
Chris PeBenito 6b9383
Chris PeBenito 6b9383
type hotplug_var_run_t;
Chris PeBenito c9428d
files_pid_file(hotplug_var_run_t)
Chris PeBenito 6b9383
Chris PeBenito 6b9383
########################################
Chris PeBenito 6b9383
#
Chris PeBenito 6b9383
# Local policy
Chris PeBenito 6b9383
#
Chris PeBenito 6b9383
Chris PeBenito 98a8ea
allow hotplug_t self:capability { net_admin sys_tty_config mknod sys_rawio };
Chris PeBenito 6b9383
dontaudit hotplug_t self:capability { sys_module sys_admin sys_tty_config };
Chris PeBenito 6b9383
# for access("/etc/bashrc", X_OK) on Red Hat
Chris PeBenito 6b9383
dontaudit hotplug_t self:capability { dac_override dac_read_search };
Chris PeBenito e6a2ea
allow hotplug_t self:process { getsession getattr signal_perms };
Chris PeBenito 0fd9dc
allow hotplug_t self:fifo_file rw_file_perms;
Chris PeBenito 98a8ea
allow hotplug_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito dd8229
allow hotplug_t self:udp_socket create_socket_perms;
Chris PeBenito dd8229
allow hotplug_t self:tcp_socket connected_stream_socket_perms;
Chris PeBenito 6b9383
Chris PeBenito dd8229
allow hotplug_t hotplug_etc_t:file r_file_perms;
Chris PeBenito dd8229
allow hotplug_t hotplug_etc_t:dir r_dir_perms;
Chris PeBenito dd8229
allow hotplug_t hotplug_etc_t:lnk_file r_file_perms;
Chris PeBenito e6a2ea
can_exec(hotplug_t,hotplug_etc_t)
Chris PeBenito 6b9383
Chris PeBenito e6a2ea
can_exec(hotplug_t,hotplug_exec_t)
Chris PeBenito 6b9383
Chris PeBenito e6a2ea
allow hotplug_t hotplug_var_run_t:file manage_file_perms;
Chris PeBenito ce0ff1
allow hotplug_t hotplug_var_run_t:dir rw_dir_perms;
Chris PeBenito c9428d
files_create_pid(hotplug_t,hotplug_var_run_t)
Chris PeBenito 6b9383
Chris PeBenito 7a2f20
kernel_sigchld(hotplug_t)
Chris PeBenito 98a8ea
kernel_setpgid(hotplug_t)
Chris PeBenito 6b9383
kernel_read_system_state(hotplug_t)
Chris PeBenito 6b9383
kernel_read_kernel_sysctl(hotplug_t)
Chris PeBenito 0fd9dc
kernel_read_net_sysctl(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito 6b9383
bootloader_read_kernel_modules(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_if(hotplug_t)
Chris PeBenito b53f93
corenet_udp_sendrecv_all_if(hotplug_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_if(hotplug_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_nodes(hotplug_t)
Chris PeBenito b53f93
corenet_udp_sendrecv_all_nodes(hotplug_t)
Chris PeBenito 0fd9dc
corenet_raw_sendrecv_all_nodes(hotplug_t)
Chris PeBenito 0fd9dc
corenet_tcp_sendrecv_all_ports(hotplug_t)
Chris PeBenito b53f93
corenet_udp_sendrecv_all_ports(hotplug_t)
Chris PeBenito 0fd9dc
corenet_tcp_bind_all_nodes(hotplug_t)
Chris PeBenito b53f93
corenet_udp_bind_all_nodes(hotplug_t)
Chris PeBenito dc771f
Chris PeBenito 98a8ea
dev_rw_sysfs(hotplug_t)
Chris PeBenito d35c62
dev_read_usbfs(hotplug_t)
Chris PeBenito a42ca7
dev_setattr_printer(hotplug_t)
Chris PeBenito 7a2f20
dev_setattr_snd_dev(hotplug_t)
Chris PeBenito d35c62
# for SSP:
Karl MacMillan f0c985
dev_read_urand(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito 0fd9dc
fs_getattr_all_fs(hotplug_t)
Chris PeBenito ab940a
fs_search_auto_mountpoints(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito 0fd9dc
storage_setattr_fixed_disk(hotplug_t)
Chris PeBenito 5a45e7
storage_setattr_removable_device(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito 0fd9dc
term_dontaudit_use_console(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito c9428d
corecmd_exec_bin(hotplug_t)
Chris PeBenito c9428d
corecmd_exec_shell(hotplug_t)
Chris PeBenito c9428d
corecmd_exec_sbin(hotplug_t)
Chris PeBenito 9ca7e7
corecmd_exec_ls(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito c9428d
domain_use_wide_inherit_fd(hotplug_t)
Chris PeBenito 3774e4
# for ps
Chris PeBenito 3774e4
domain_dontaudit_read_all_domains_state(hotplug_t)
Chris PeBenito ac9aa2
domain_dontaudit_getattr_all_domains(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito 8fd367
files_read_etc_files(hotplug_t)
Chris PeBenito c9428d
files_manage_etc_runtime_files(hotplug_t)
Chris PeBenito 8fd367
files_exec_etc_files(hotplug_t)
Chris PeBenito 3b857e
# for when filesystems are not mounted early in the boot:
Chris PeBenito c9428d
files_dontaudit_search_isid_type_dir(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito c9428d
init_use_fd(hotplug_t)
Chris PeBenito c9428d
init_use_script_pty(hotplug_t)
Chris PeBenito c9428d
init_read_script_process_state(hotplug_t)
Chris PeBenito daa0e0
# Allow hotplug (including /sbin/ifup-local) to start/stop services and
Chris PeBenito daa0e0
# run sendmail -q
Chris PeBenito c9428d
init_domtrans_script(hotplug_t)
Chris PeBenito daa0e0
# kernel threads inherit from shared descriptor table used by init
Chris PeBenito c9428d
init_dontaudit_use_initctl(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito c9428d
logging_send_syslog_msg(hotplug_t)
Chris PeBenito c9428d
logging_search_logs(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito c9428d
libs_use_ld_so(hotplug_t)
Chris PeBenito c9428d
libs_use_shared_libs(hotplug_t)
Chris PeBenito 118186
# Read /usr/lib/gconv/.*
Chris PeBenito c9428d
libs_read_lib(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito 77f6e2
miscfiles_read_hwdata(hotplug_t)
Chris PeBenito 6b9383
miscfiles_read_localization(hotplug_t)
Chris PeBenito 6b9383
Chris PeBenito ce0ff1
modutils_domtrans_insmod(hotplug_t)
Chris PeBenito ce0ff1
modutils_read_mods_deps(hotplug_t)
Chris PeBenito ce0ff1
Chris PeBenito 98a8ea
seutil_dontaudit_search_config(hotplug_t)
Chris PeBenito 98a8ea
Chris PeBenito c9428d
sysnet_read_config(hotplug_t)
Chris PeBenito dc771f
Chris PeBenito c9428d
userdom_dontaudit_use_unpriv_user_fd(hotplug_t)
Chris PeBenito ae9e27
userdom_dontaudit_search_sysadm_home_dir(hotplug_t)
Chris PeBenito daa0e0
Chris PeBenito 254bbc
ifdef(`distro_redhat', `
Chris PeBenito 132880
	optional_policy(`netutils',`
Chris PeBenito 0c73cd
		# for arping used for static IP addresses on PCMCIA ethernet
Chris PeBenito c9428d
		netutils_domtrans(hotplug_t)
Chris PeBenito ebdc3b
		fs_use_tmpfs_chr_dev(hotplug_t)
Chris PeBenito 0c73cd
	')
Chris PeBenito 8fd367
	files_getattr_generic_locks(hotplug_t)
Chris PeBenito 0c73cd
')
Chris PeBenito dc771f
Chris PeBenito 254bbc
ifdef(`targeted_policy', `
Chris PeBenito 9ca7e7
	term_dontaudit_use_unallocated_tty(hotplug_t)
Chris PeBenito 9ca7e7
	term_dontaudit_use_generic_pty(hotplug_t)
Chris PeBenito 9ca7e7
Chris PeBenito 132880
	optional_policy(`consoletype',`
Chris PeBenito 605ba2
		consoletype_domtrans(hotplug_t)
Chris PeBenito 605ba2
	')
Chris PeBenito 6b9383
')
Chris PeBenito 6b9383
Chris PeBenito 132880
optional_policy(`dbus',`
Chris PeBenito 0c3d17
	dbus_system_bus_client_template(hotplug,hotplug_t)
Chris PeBenito 0c3d17
')
Chris PeBenito 0c3d17
Chris PeBenito 132880
optional_policy(`fstools',`
Chris PeBenito 58c3da
	fstools_domtrans(hotplug_t)
Chris PeBenito 58c3da
')
Chris PeBenito 58c3da
Chris PeBenito 132880
optional_policy(`hal',`
Chris PeBenito 725926
	hal_dgram_sendto(hotplug_t)
Chris PeBenito 725926
')
Chris PeBenito 725926
Chris PeBenito 132880
optional_policy(`hostname',`
Chris PeBenito c9428d
	hostname_exec(hotplug_t)
Chris PeBenito 13e94c
')
Chris PeBenito 13e94c
Chris PeBenito 132880
optional_policy(`iptables',`
Chris PeBenito c9428d
	iptables_domtrans(hotplug_t)
Chris PeBenito 6b9383
')
Chris PeBenito 6b9383
Chris PeBenito 132880
optional_policy(`mount',`
Chris PeBenito 2705f9
	mount_domtrans(hotplug_t)
Chris PeBenito 2705f9
')
Chris PeBenito 2705f9
Chris PeBenito 132880
optional_policy(`mta',`
Chris PeBenito 0c73cd
	mta_send_mail(hotplug_t)
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito 132880
optional_policy(`nis',`
Chris PeBenito ab940a
	nis_use_ypbind(hotplug_t)
Chris PeBenito ab940a
')
Chris PeBenito ab940a
Chris PeBenito 132880
optional_policy(`nscd',`
Chris PeBenito 77f6e2
	nscd_use_socket(hotplug_t)
Chris PeBenito 77f6e2
')
Chris PeBenito 77f6e2
Chris PeBenito 132880
optional_policy(`selinuxutil',`
Chris PeBenito 8fd367
	seutil_sigchld_newrole(hotplug_t)
Chris PeBenito 6b9383
')
Chris PeBenito 6b9383
Chris PeBenito 132880
optional_policy(`sysnetwork',`
Chris PeBenito ebdc3b
	sysnet_domtrans_dhcpc(hotplug_t)
Chris PeBenito ebdc3b
	sysnet_signal_dhcpc(hotplug_t)
Chris PeBenito ebdc3b
	sysnet_kill_dhcpc(hotplug_t)
Chris PeBenito ebdc3b
	sysnet_signull_dhcpc(hotplug_t)
Chris PeBenito ebdc3b
	sysnet_sigstop_dhcpc(hotplug_t)
Chris PeBenito ebdc3b
	sysnet_sigchld_dhcpc(hotplug_t)
Chris PeBenito ebdc3b
	sysnet_read_dhcpc_pid(hotplug_t)
Chris PeBenito ebdc3b
	sysnet_rw_dhcp_config(hotplug_t)
Chris PeBenito c9428d
	sysnet_domtrans_ifconfig(hotplug_t)
Chris PeBenito 13e94c
')
Chris PeBenito 13e94c
Chris PeBenito 132880
optional_policy(`udev',`
Chris PeBenito c9428d
	udev_domtrans(hotplug_t)
Chris PeBenito 0500e0
	udev_helper_domtrans(hotplug_t)
Chris PeBenito c9428d
	udev_read_db(hotplug_t)
Chris PeBenito 6b9383
')
Chris PeBenito 6b9383
Chris PeBenito 132880
optional_policy(`updfstab',`
Chris PeBenito dce68d
	updfstab_domtrans(hotplug_t)
Chris PeBenito 6b9383
')