1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
|
policy_module(hotplug, 1.19.0)
########################################
#
# Declarations
#
type hotplug_t;
type hotplug_exec_t;
kernel_domtrans_to(hotplug_t, hotplug_exec_t)
init_daemon_domain(hotplug_t, hotplug_exec_t)
type hotplug_etc_t;
files_config_file(hotplug_etc_t)
init_daemon_domain(hotplug_t, hotplug_etc_t)
type hotplug_var_run_t;
files_pid_file(hotplug_var_run_t)
########################################
#
# Local policy
#
allow hotplug_t self:capability { mknod net_admin sys_rawio sys_tty_config };
dontaudit hotplug_t self:capability { sys_admin sys_module sys_ptrace sys_tty_config };
# for access("/etc/bashrc", X_OK) on Red Hat
dontaudit hotplug_t self:capability { dac_override dac_read_search };
allow hotplug_t self:process { setpgid getsession getattr signal_perms };
allow hotplug_t self:fifo_file rw_file_perms;
allow hotplug_t self:netlink_route_socket r_netlink_socket_perms;
allow hotplug_t self:udp_socket create_socket_perms;
allow hotplug_t self:tcp_socket connected_stream_socket_perms;
read_files_pattern(hotplug_t, hotplug_etc_t, hotplug_etc_t)
read_lnk_files_pattern(hotplug_t, hotplug_etc_t, hotplug_etc_t)
can_exec(hotplug_t, hotplug_etc_t)
allow hotplug_t hotplug_etc_t:dir list_dir_perms;
can_exec(hotplug_t, hotplug_exec_t)
manage_dirs_pattern(hotplug_t, hotplug_var_run_t, hotplug_var_run_t)
manage_files_pattern(hotplug_t, hotplug_var_run_t, hotplug_var_run_t)
files_pid_filetrans(hotplug_t, hotplug_var_run_t, { dir file })
kernel_sigchld(hotplug_t)
kernel_setpgid(hotplug_t)
kernel_read_system_state(hotplug_t)
kernel_read_network_state(hotplug_t)
kernel_read_kernel_sysctls(hotplug_t)
kernel_rw_net_sysctls(hotplug_t)
# for when filesystems are not mounted early in the boot:
kernel_dontaudit_search_unlabeled(hotplug_t)
files_read_kernel_modules(hotplug_t)
corenet_all_recvfrom_unlabeled(hotplug_t)
corenet_all_recvfrom_netlabel(hotplug_t)
corenet_tcp_sendrecv_generic_if(hotplug_t)
corenet_udp_sendrecv_generic_if(hotplug_t)
corenet_tcp_sendrecv_generic_node(hotplug_t)
corenet_udp_sendrecv_generic_node(hotplug_t)
corenet_tcp_sendrecv_all_ports(hotplug_t)
corenet_udp_sendrecv_all_ports(hotplug_t)
dev_rw_sysfs(hotplug_t)
dev_read_usbfs(hotplug_t)
dev_setattr_printer_dev(hotplug_t)
dev_setattr_sound_dev(hotplug_t)
# for SSP:
dev_read_urand(hotplug_t)
fs_getattr_all_fs(hotplug_t)
fs_search_auto_mountpoints(hotplug_t)
storage_setattr_fixed_disk_dev(hotplug_t)
storage_setattr_removable_dev(hotplug_t)
corecmd_exec_bin(hotplug_t)
corecmd_exec_shell(hotplug_t)
domain_use_interactive_fds(hotplug_t)
# for ps
domain_dontaudit_read_all_domains_state(hotplug_t)
domain_dontaudit_getattr_all_domains(hotplug_t)
files_read_etc_files(hotplug_t)
files_manage_etc_runtime_files(hotplug_t)
files_etc_filetrans_etc_runtime(hotplug_t, file)
files_exec_etc_files(hotplug_t)
init_read_script_state(hotplug_t)
# Allow hotplug (including /sbin/ifup-local) to start/stop services and
# run sendmail -q
init_domtrans_script(hotplug_t)
# kernel threads inherit from shared descriptor table used by init
init_dontaudit_rw_initctl(hotplug_t)
logging_send_syslog_msg(hotplug_t)
logging_search_logs(hotplug_t)
# Read /usr/lib/gconv/.*
libs_read_lib_files(hotplug_t)
miscfiles_read_hwdata(hotplug_t)
miscfiles_read_localization(hotplug_t)
seutil_dontaudit_search_config(hotplug_t)
sysnet_read_config(hotplug_t)
userdom_dontaudit_use_unpriv_user_fds(hotplug_t)
userdom_dontaudit_search_user_home_dirs(hotplug_t)
ifdef(`distro_redhat', `
optional_policy(`
# for arping used for static IP addresses on PCMCIA ethernet
netutils_domtrans(hotplug_t)
netutils_signal(hotplug_t)
fs_rw_tmpfs_chr_files(hotplug_t)
')
files_getattr_generic_locks(hotplug_t)
')
optional_policy(`
brctl_domtrans(hotplug_t)
')
optional_policy(`
consoletype_exec(hotplug_t)
')
optional_policy(`
dbus_system_bus_client(hotplug_t)
')
optional_policy(`
fstools_domtrans(hotplug_t)
')
optional_policy(`
hal_dgram_send(hotplug_t)
')
optional_policy(`
hostname_exec(hotplug_t)
')
optional_policy(`
iptables_domtrans(hotplug_t)
')
optional_policy(`
modutils_domtrans(hotplug_t)
modutils_read_module_deps(hotplug_t)
')
optional_policy(`
mount_domtrans(hotplug_t)
')
optional_policy(`
mta_send_mail(hotplug_t)
')
optional_policy(`
nis_use_ypbind(hotplug_t)
')
optional_policy(`
nscd_use(hotplug_t)
')
optional_policy(`
seutil_sigchld_newrole(hotplug_t)
')
optional_policy(`
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)
sysnet_domtrans_ifconfig(hotplug_t)
sysnet_signal_ifconfig(hotplug_t)
')
optional_policy(`
udev_domtrans(hotplug_t)
udev_helper_domtrans(hotplug_t)
udev_read_db(hotplug_t)
')
optional_policy(`
updfstab_domtrans(hotplug_t)
')
optional_policy(`
usbmodules_domtrans(hotplug_t)
')
|