|
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 |
c9428d |
files_file_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 |
6b9383 |
kernel_read_system_state(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
kernel_read_kernel_sysctl(hotplug_t)
|
|
Chris PeBenito |
8bd678 |
dev_read_sysfs(hotplug_t)
|
|
Chris PeBenito |
0fd9dc |
kernel_read_net_sysctl(hotplug_t)
|
|
Chris PeBenito |
8bd678 |
dev_read_usbfs(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 |
6b9383 |
# for SSP
|
|
Karl MacMillan |
f0c985 |
dev_read_urand(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
0fd9dc |
fs_getattr_all_fs(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 |
c9428d |
files_read_generic_etc_files(hotplug_t)
|
|
Chris PeBenito |
c9428d |
files_manage_etc_runtime_files(hotplug_t)
|
|
Chris PeBenito |
c9428d |
files_exec_generic_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 |
6b9383 |
modutils_read_kernel_module_dependencies(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 |
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 |
763c44 |
fs_use_tmpfs_character_devices(hotplug_t)
|
|
Chris PeBenito |
0c73cd |
')
|
|
Chris PeBenito |
c9428d |
files_getattr_generic_lock_files(hotplug_t)
|
|
Chris PeBenito |
0c73cd |
')
|
|
Chris PeBenito |
dc771f |
|
|
Chris PeBenito |
254bbc |
ifdef(`targeted_policy', `
|
|
Chris PeBenito |
0fd9dc |
term_dontaudit_use_unallocated_tty(hotplug_t)
|
|
Chris PeBenito |
31908b |
term_dontaudit_use_generic_pty(hotplug_t)
|
|
Chris PeBenito |
c9428d |
files_dontaudit_read_root_file(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 |
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 |
6b9383 |
optional_policy(`selinux.te',`
|
|
Chris PeBenito |
5e0da6 |
seutil_newrole_sigchld(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
13e94c |
optional_policy(`sysnetwork.te',`
|
|
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 |
0c73cd |
updfstab_transition(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
ifdef(`TODO',`
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t autofs_t:dir { search getattr };
|
|
Chris PeBenito |
6b9383 |
dontaudit hotplug_t sysadm_home_dir_t:dir search;
|
|
Chris PeBenito |
6b9383 |
optional_policy(`rhgb.te', `
|
|
Chris PeBenito |
0c73cd |
allow hotplug_t rhgb_t:process sigchld;
|
|
Chris PeBenito |
0c73cd |
allow hotplug_t rhgb_t:fd use;
|
|
Chris PeBenito |
0c73cd |
allow hotplug_t rhgb_t:fifo_file { read write };
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
allow kernel_t hotplug_etc_t:dir search;
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t sound_device_t:chr_file setattr;
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
can_ypbind(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
dbusd_client(system, hotplug)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t kernel_t:process sigchld;
|
|
Chris PeBenito |
6b9383 |
|
|
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 |
daa0e0 |
# this goes to hald:
|
|
Chris PeBenito |
daa0e0 |
optional_policy(`hotplug.te',`
|
|
Chris PeBenito |
0c73cd |
allow hald_t hotplug_etc_t:dir search;
|
|
Chris PeBenito |
0c73cd |
allow hald_t hotplug_etc_t:file { getattr read };
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`fsadm.te', `
|
|
Chris PeBenito |
0c73cd |
domain_auto_trans(hotplug_t, fsadm_exec_t, fsadm_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`lpd.te', `
|
|
Chris PeBenito |
0c73cd |
allow hotplug_t printer_device_t:chr_file setattr;
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
') dnl end TODO
|