|
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 |
ff3138 |
kernel_make_userland_entrypoint(hotplug_t,hotplug_exec_t)
|
|
Chris PeBenito |
ff3138 |
init_make_system_domain(hotplug_t,hotplug_exec_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
type hotplug_etc_t; #, usercanread;
|
|
Chris PeBenito |
6b9383 |
files_make_file(hotplug_etc_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
type hotplug_var_run_t;
|
|
Chris PeBenito |
d25dd9 |
files_make_daemon_runtime_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 |
6b9383 |
allow hotplug_t self:fifo_file { read write getattr ioctl };
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t self:udp_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
|
|
Chris PeBenito |
dc771f |
allow hotplug_t self:tcp_socket { create ioctl read getattr write setattr append bind getopt setopt shutdown listen accept };
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t hotplug_etc_t:file { read getattr lock ioctl };
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t hotplug_etc_t:dir { read getattr lock search ioctl };
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t hotplug_etc_t:lnk_file { getattr read };
|
|
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 |
6b9383 |
files_create_daemon_runtime_data(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 |
6b9383 |
kernel_read_hardware_state(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
kernel_read_network_sysctl(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
kernel_read_usb_hardware_state(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
bootloader_read_kernel_modules(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
dc771f |
corenetwork_network_tcp_on_all_interfaces(hotplug_t)
|
|
Chris PeBenito |
dc771f |
corenetwork_network_raw_on_all_interfaces(hotplug_t)
|
|
Chris PeBenito |
dc771f |
corenetwork_network_tcp_on_all_nodes(hotplug_t)
|
|
Chris PeBenito |
dc771f |
corenetwork_network_raw_on_all_nodes(hotplug_t)
|
|
Chris PeBenito |
dc771f |
corenetwork_network_tcp_on_all_ports(hotplug_t)
|
|
Chris PeBenito |
dc771f |
corenetwork_bind_tcp_on_all_nodes(hotplug_t)
|
|
Chris PeBenito |
dc771f |
|
|
Chris PeBenito |
6b9383 |
# for SSP
|
|
Chris PeBenito |
6b9383 |
devices_get_pseudorandom_data(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
filesystem_get_all_filesystems_attributes(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
storage_set_fixed_disk_attributes(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
storage_set_removable_device_attributes(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
terminal_ignore_use_console(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
daa0e0 |
corecommands_execute_general_programs(hotplug_t)
|
|
Chris PeBenito |
daa0e0 |
corecommands_execute_shell(hotplug_t)
|
|
Chris PeBenito |
daa0e0 |
corecommands_execute_system_programs(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
domain_use_widely_inheritable_file_descriptors(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
files_read_general_system_config(hotplug_t)
|
|
Chris PeBenito |
d490eb |
files_manage_runtime_system_config(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
files_execute_system_config_script(hotplug_t)
|
|
Chris PeBenito |
3b857e |
# for when filesystems are not mounted early in the boot:
|
|
Chris PeBenito |
3b857e |
files_ignore_search_isid_type_dir(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
daa0e0 |
init_use_file_descriptors(hotplug_t)
|
|
Chris PeBenito |
daa0e0 |
init_script_use_pseudoterminal(hotplug_t)
|
|
Chris PeBenito |
daa0e0 |
init_script_read_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 |
daa0e0 |
init_script_transition(hotplug_t)
|
|
Chris PeBenito |
daa0e0 |
# kernel threads inherit from shared descriptor table used by init
|
|
Chris PeBenito |
daa0e0 |
init_ignore_use_control_channel(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
logging_send_system_log_message(hotplug_t)
|
|
Chris PeBenito |
daa0e0 |
logging_search_system_log_directory(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
libraries_use_dynamic_loader(hotplug_t)
|
|
Chris PeBenito |
dd14d0 |
libraries_use_shared_libraries(hotplug_t)
|
|
Chris PeBenito |
118186 |
# Read /usr/lib/gconv/.*
|
|
Chris PeBenito |
118186 |
libraries_read_library_resources(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
modutils_insmod_transition(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 |
6b9383 |
mount_transition(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
dc771f |
sysnetwork_read_network_config(hotplug_t)
|
|
Chris PeBenito |
dc771f |
|
|
Chris PeBenito |
daa0e0 |
userdomain_ignore_use_all_unprivileged_users_file_descriptors(hotplug_t)
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
dc771f |
tunable_policy(`distro_redhat', `
|
|
Chris PeBenito |
dc771f |
optional_policy(`netutils.te', `
|
|
Chris PeBenito |
dc771f |
# for arping used for static IP addresses on PCMCIA ethernet
|
|
Chris PeBenito |
dc771f |
netutils_transition(hotplug_t)
|
|
Chris PeBenito |
dc771f |
filesystem_use_tmpfs_character_devices(hotplug_t)
|
|
Chris PeBenito |
dc771f |
') dnl endif netutils optional
|
|
Chris PeBenito |
efd8ed |
files_get_system_lock_file_attributes(hotplug_t)
|
|
Chris PeBenito |
dc771f |
')dnl end distro_redhat tunable
|
|
Chris PeBenito |
dc771f |
|
|
Chris PeBenito |
07d6e3 |
tunable_policy(`targeted_policy', `
|
|
Chris PeBenito |
07d6e3 |
terminal_ignore_use_general_physical_terminal(hotplug_t)
|
|
Chris PeBenito |
07d6e3 |
terminal_ignore_use_general_pseudoterminal(hotplug_t)
|
|
Chris PeBenito |
07d6e3 |
files_ignore_read_rootfs_file(hotplug_t)
|
|
Chris PeBenito |
07d6e3 |
')
|
|
Chris PeBenito |
07d6e3 |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`consoletype.te',`
|
|
Chris PeBenito |
6b9383 |
consoletype_transition(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
13e94c |
optional_policy(`hostname.te',`
|
|
Chris PeBenito |
13e94c |
hostname_execute(hotplug_t)
|
|
Chris PeBenito |
13e94c |
')
|
|
Chris PeBenito |
13e94c |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`iptables.te',`
|
|
Chris PeBenito |
6b9383 |
iptables_transition(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
daa0e0 |
optional_policy(`mta.te', `
|
|
Chris PeBenito |
daa0e0 |
mta_send_mail(hotplug_t)
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`selinux.te',`
|
|
Chris PeBenito |
6b9383 |
selinux_newrole_sigchld(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
13e94c |
optional_policy(`sysnetwork.te',`
|
|
Chris PeBenito |
13e94c |
sysnetwork_ifconfig_transition(hotplug_t)
|
|
Chris PeBenito |
13e94c |
')
|
|
Chris PeBenito |
13e94c |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`udev.te', `
|
|
Chris PeBenito |
6b9383 |
udev_transition(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
udev_read_database(hotplug_t)
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
07d6e3 |
optional_policy(`updfstab.te', `
|
|
Chris PeBenito |
07d6e3 |
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 |
6b9383 |
allow hotplug_t rhgb_t:process sigchld;
|
|
Chris PeBenito |
6b9383 |
allow hotplug_t rhgb_t:fd use;
|
|
Chris PeBenito |
6b9383 |
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 |
6b9383 |
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 |
6b9383 |
allow hald_t hotplug_etc_t:dir search;
|
|
Chris PeBenito |
6b9383 |
allow hald_t hotplug_etc_t:file { getattr read };
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
optional_policy(`fsadm.te', `
|
|
Chris PeBenito |
6b9383 |
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 |
6b9383 |
allow hotplug_t printer_device_t:chr_file setattr;
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
') dnl end TODO
|