2005-05-02 19:24:29 +00:00
|
|
|
|
2005-12-09 16:38:39 +00:00
|
|
|
policy_module(hotplug,1.1.0)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type hotplug_t;
|
|
|
|
type hotplug_exec_t;
|
2006-01-27 19:55:42 +00:00
|
|
|
kernel_domtrans_to(hotplug_t,hotplug_exec_t)
|
2005-09-22 15:32:53 +00:00
|
|
|
init_daemon_domain(hotplug_t,hotplug_exec_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-10-24 18:40:24 +00:00
|
|
|
type hotplug_etc_t;
|
|
|
|
files_config_file(hotplug_etc_t)
|
2005-09-12 15:17:39 +00:00
|
|
|
kernel_search_from(hotplug_etc_t)
|
2005-11-08 22:00:30 +00:00
|
|
|
init_daemon_domain(hotplug_t,hotplug_etc_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
|
|
|
type hotplug_var_run_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_pid_file(hotplug_var_run_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
allow hotplug_t self:capability { net_admin sys_tty_config mknod sys_rawio };
|
2005-05-02 19:24:29 +00:00
|
|
|
dontaudit hotplug_t self:capability { sys_module sys_admin sys_tty_config };
|
|
|
|
# for access("/etc/bashrc", X_OK) on Red Hat
|
|
|
|
dontaudit hotplug_t self:capability { dac_override dac_read_search };
|
2005-10-21 21:35:25 +00:00
|
|
|
allow hotplug_t self:process { getsession getattr signal_perms };
|
2005-06-10 01:01:13 +00:00
|
|
|
allow hotplug_t self:fifo_file rw_file_perms;
|
2005-09-15 21:03:29 +00:00
|
|
|
allow hotplug_t self:netlink_route_socket r_netlink_socket_perms;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow hotplug_t self:udp_socket create_socket_perms;
|
|
|
|
allow hotplug_t self:tcp_socket connected_stream_socket_perms;
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow hotplug_t hotplug_etc_t:file r_file_perms;
|
|
|
|
allow hotplug_t hotplug_etc_t:dir r_dir_perms;
|
|
|
|
allow hotplug_t hotplug_etc_t:lnk_file r_file_perms;
|
2005-10-21 21:35:25 +00:00
|
|
|
can_exec(hotplug_t,hotplug_etc_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-10-21 21:35:25 +00:00
|
|
|
can_exec(hotplug_t,hotplug_exec_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-10-21 21:35:25 +00:00
|
|
|
allow hotplug_t hotplug_var_run_t:file manage_file_perms;
|
2005-10-31 22:44:03 +00:00
|
|
|
allow hotplug_t hotplug_var_run_t:dir rw_dir_perms;
|
2006-01-13 21:06:49 +00:00
|
|
|
files_filetrans_pid(hotplug_t,hotplug_var_run_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-20 17:41:29 +00:00
|
|
|
kernel_sigchld(hotplug_t)
|
2005-09-15 21:03:29 +00:00
|
|
|
kernel_setpgid(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
kernel_read_system_state(hotplug_t)
|
|
|
|
kernel_read_kernel_sysctl(hotplug_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
kernel_read_net_sysctl(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
|
|
|
bootloader_read_kernel_modules(hotplug_t)
|
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(hotplug_t)
|
2005-09-22 15:32:53 +00:00
|
|
|
corenet_udp_sendrecv_all_if(hotplug_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_raw_sendrecv_all_if(hotplug_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(hotplug_t)
|
2005-09-22 15:32:53 +00:00
|
|
|
corenet_udp_sendrecv_all_nodes(hotplug_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_raw_sendrecv_all_nodes(hotplug_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(hotplug_t)
|
2005-09-22 15:32:53 +00:00
|
|
|
corenet_udp_sendrecv_all_ports(hotplug_t)
|
2005-12-06 19:59:50 +00:00
|
|
|
corenet_non_ipsec_sendrecv(hotplug_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
corenet_tcp_bind_all_nodes(hotplug_t)
|
2005-09-22 15:32:53 +00:00
|
|
|
corenet_udp_bind_all_nodes(hotplug_t)
|
2005-05-24 15:55:57 +00:00
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
dev_rw_sysfs(hotplug_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
dev_read_usbfs(hotplug_t)
|
2005-07-08 20:44:57 +00:00
|
|
|
dev_setattr_printer(hotplug_t)
|
2005-06-20 17:41:29 +00:00
|
|
|
dev_setattr_snd_dev(hotplug_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
# for SSP:
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_read_urand(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_all_fs(hotplug_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
storage_setattr_fixed_disk(hotplug_t)
|
2005-06-13 20:00:36 +00:00
|
|
|
storage_setattr_removable_device(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
term_dontaudit_use_console(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
corecmd_exec_bin(hotplug_t)
|
|
|
|
corecmd_exec_shell(hotplug_t)
|
|
|
|
corecmd_exec_sbin(hotplug_t)
|
2005-10-31 20:54:33 +00:00
|
|
|
corecmd_exec_ls(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_use_wide_inherit_fd(hotplug_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
# for ps
|
|
|
|
domain_dontaudit_read_all_domains_state(hotplug_t)
|
2005-11-29 15:49:18 +00:00
|
|
|
domain_dontaudit_getattr_all_domains(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(hotplug_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_manage_etc_runtime_files(hotplug_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
files_exec_etc_files(hotplug_t)
|
2005-05-31 21:25:45 +00:00
|
|
|
# for when filesystems are not mounted early in the boot:
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_search_isid_type_dir(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
init_use_fd(hotplug_t)
|
|
|
|
init_use_script_pty(hotplug_t)
|
|
|
|
init_read_script_process_state(hotplug_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
# Allow hotplug (including /sbin/ifup-local) to start/stop services and
|
|
|
|
# run sendmail -q
|
2005-06-13 17:35:46 +00:00
|
|
|
init_domtrans_script(hotplug_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
# kernel threads inherit from shared descriptor table used by init
|
2005-06-13 17:35:46 +00:00
|
|
|
init_dontaudit_use_initctl(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(hotplug_t)
|
|
|
|
logging_search_logs(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(hotplug_t)
|
|
|
|
libs_use_shared_libs(hotplug_t)
|
2005-05-11 15:46:51 +00:00
|
|
|
# Read /usr/lib/gconv/.*
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_read_lib(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
miscfiles_read_hwdata(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
miscfiles_read_localization(hotplug_t)
|
|
|
|
|
2005-10-31 22:44:03 +00:00
|
|
|
modutils_domtrans_insmod(hotplug_t)
|
|
|
|
modutils_read_mods_deps(hotplug_t)
|
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
seutil_dontaudit_search_config(hotplug_t)
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
sysnet_read_config(hotplug_t)
|
2005-05-24 15:55:57 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fd(hotplug_t)
|
2005-07-11 19:02:50 +00:00
|
|
|
userdom_dontaudit_search_sysadm_home_dir(hotplug_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`distro_redhat', `
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`netutils',`
|
2005-06-03 12:25:14 +00:00
|
|
|
# for arping used for static IP addresses on PCMCIA ethernet
|
2005-06-13 17:35:46 +00:00
|
|
|
netutils_domtrans(hotplug_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
fs_use_tmpfs_chr_dev(hotplug_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
')
|
2005-06-29 14:26:41 +00:00
|
|
|
files_getattr_generic_locks(hotplug_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
')
|
2005-05-24 15:55:57 +00:00
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`targeted_policy', `
|
2005-10-31 20:54:33 +00:00
|
|
|
term_dontaudit_use_unallocated_tty(hotplug_t)
|
|
|
|
term_dontaudit_use_generic_pty(hotplug_t)
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`consoletype',`
|
2005-09-15 15:34:31 +00:00
|
|
|
consoletype_domtrans(hotplug_t)
|
|
|
|
')
|
2005-05-02 19:24:29 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`dbus',`
|
2005-08-31 20:58:12 +00:00
|
|
|
dbus_system_bus_client_template(hotplug,hotplug_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`fstools',`
|
2005-06-27 20:59:28 +00:00
|
|
|
fstools_domtrans(hotplug_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`hal',`
|
2005-11-08 22:00:30 +00:00
|
|
|
hal_dgram_sendto(hotplug_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`hostname',`
|
2005-06-13 17:35:46 +00:00
|
|
|
hostname_exec(hotplug_t)
|
2005-05-09 21:07:53 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`iptables',`
|
2005-06-13 17:35:46 +00:00
|
|
|
iptables_domtrans(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`mount',`
|
2005-09-12 21:40:56 +00:00
|
|
|
mount_domtrans(hotplug_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`mta',`
|
2005-06-03 12:25:14 +00:00
|
|
|
mta_send_mail(hotplug_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind(hotplug_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nscd',`
|
2005-10-13 20:59:36 +00:00
|
|
|
nscd_use_socket(hotplug_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`selinuxutil',`
|
2005-06-29 14:26:41 +00:00
|
|
|
seutil_sigchld_newrole(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`sysnetwork',`
|
2005-06-29 20:53:53 +00:00
|
|
|
sysnet_domtrans_dhcpc(hotplug_t)
|
|
|
|
sysnet_signal_dhcpc(hotplug_t)
|
|
|
|
sysnet_kill_dhcpc(hotplug_t)
|
|
|
|
sysnet_signull_dhcpc(hotplug_t)
|
|
|
|
sysnet_sigstop_dhcpc(hotplug_t)
|
|
|
|
sysnet_sigchld_dhcpc(hotplug_t)
|
|
|
|
sysnet_read_dhcpc_pid(hotplug_t)
|
|
|
|
sysnet_rw_dhcp_config(hotplug_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
sysnet_domtrans_ifconfig(hotplug_t)
|
2005-05-09 21:07:53 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`udev',`
|
2005-06-13 17:35:46 +00:00
|
|
|
udev_domtrans(hotplug_t)
|
2005-10-31 20:32:53 +00:00
|
|
|
udev_helper_domtrans(hotplug_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
udev_read_db(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`updfstab',`
|
2005-08-08 15:51:15 +00:00
|
|
|
updfstab_domtrans(hotplug_t)
|
2005-05-02 19:24:29 +00:00
|
|
|
')
|
2006-01-11 18:28:57 +00:00
|
|
|
|
|
|
|
optional_policy(`usbmodules',`
|
|
|
|
usbmodules_domtrans(hotplug_t)
|
|
|
|
')
|