|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
policy_module(hotplug, 1.0)
|
|
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 |
c9428d |
init_system_domain(hotplug_t,hotplug_exec_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
type hotplug_etc_t; #, usercanread;
|
|
Chris PeBenito |
8fd367 |
files_type(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 |
6b9383 |
allow hotplug_t self:capability { net_admin sys_tty_config mknod };
|
|
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 |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t self:process { getsession getattr };
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
0fd9dc |
allow hotplug_t self:fifo_file rw_file_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 |
6b9383 |
|
|
Chris PeBenito |
f5c42b |
allow hotplug_t hotplug_exec_t:file { getattr read ioctl execute execute_no_trans };
|
|
Chris PeBenito |
f5c42b |
allow hotplug_t hotplug_etc_t:file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t hotplug_var_run_t:file { getattr create read write append setattr unlink };
|
|
Chris PeBenito |
c9428d |
files_create_pid(hotplug_t,hotplug_var_run_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
7a2f20 |
kernel_sigchld(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 |
0fd9dc |
corenet_raw_sendrecv_all_if(hotplug_t)
|
|
Chris PeBenito |
0fd9dc |
corenet_tcp_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 |
0fd9dc |
corenet_tcp_bind_all_nodes(hotplug_t)
|
|
Chris PeBenito |
dc771f |
|
|
Chris PeBenito |
d35c62 |
dev_read_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 |
6b9383 |
|
|
Chris PeBenito |
c9428d |
domain_use_wide_inherit_fd(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 |
c9428d |
modutils_domtrans_insmod(hotplug_t)
|
|
Chris PeBenito |
8fd367 |
modutils_read_mods_deps(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
miscfiles_read_localization(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
c9428d |
mount_domtrans(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
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 |
0c73cd |
optional_policy(`netutils.te', `
|
|
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 |
892266 |
unconfined_domain_template(hotplug_t)
|
|
Chris PeBenito |
07d6e3 |
')
|
|
Chris PeBenito |
07d6e3 |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`consoletype.te',`
|
|
Chris PeBenito |
c9428d |
consoletype_domtrans(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
58c3da |
optional_policy(`fstools.te',`
|
|
Chris PeBenito |
58c3da |
fstools_domtrans(hotplug_t)
|
|
Chris PeBenito |
58c3da |
')
|
|
Chris PeBenito |
58c3da |
|
|
Chris PeBenito |
13e94c |
optional_policy(`hostname.te',`
|
|
Chris PeBenito |
c9428d |
hostname_exec(hotplug_t)
|
|
Chris PeBenito |
13e94c |
')
|
|
Chris PeBenito |
13e94c |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`iptables.te',`
|
|
Chris PeBenito |
c9428d |
iptables_domtrans(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
daa0e0 |
optional_policy(`mta.te', `
|
|
Chris PeBenito |
0c73cd |
mta_send_mail(hotplug_t)
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
ab940a |
optional_policy(`nis.te',`
|
|
Chris PeBenito |
ab940a |
nis_use_ypbind(hotplug_t)
|
|
Chris PeBenito |
ab940a |
')
|
|
Chris PeBenito |
ab940a |
|
|
Chris PeBenito |
ae9e27 |
optional_policy(`selinuxutil.te',`
|
|
Chris PeBenito |
8fd367 |
seutil_sigchld_newrole(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
13e94c |
optional_policy(`sysnetwork.te',`
|
|
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 |
6b9383 |
optional_policy(`udev.te', `
|
|
Chris PeBenito |
c9428d |
udev_domtrans(hotplug_t)
|
|
Chris PeBenito |
c9428d |
udev_read_db(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
07d6e3 |
optional_policy(`updfstab.te', `
|
|
Chris PeBenito |
dce68d |
updfstab_domtrans(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
ifdef(`TODO',`
|
|
Chris PeBenito |
ab940a |
optional_policy(`rhgb.te',`
|
|
Chris PeBenito |
ab940a |
rhgb_domain(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
allow kernel_t hotplug_etc_t:dir search;
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
dbusd_client(system, hotplug)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
# for ps
|
|
Chris PeBenito |
6b9383 |
dontaudit hotplug_t domain:dir { getattr search };
|
|
Chris PeBenito |
6b9383 |
dontaudit hotplug_t { init_t kernel_t }:file read;
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`hald.te', `
|
|
Chris PeBenito |
0c73cd |
allow hotplug_t hald_t:unix_dgram_socket sendto;
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
ab940a |
# this block goes to hald:
|
|
Chris PeBenito |
daa0e0 |
optional_policy(`hotplug.te',`
|
|
Chris PeBenito |
ebdc3b |
hotplug_read_config(hald_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
') dnl end TODO
|