selinux-policy/refpolicy/policy/modules/system/hotplug.te

200 lines
5.3 KiB
Plaintext
Raw Normal View History

2005-05-02 19:24:29 +00:00
policy_module(hotplug, 1.0)
########################################
#
# Declarations
#
type hotplug_t;
type hotplug_exec_t;
kernel_make_userland_entrypoint(hotplug_t,hotplug_exec_t)
init_make_system_domain(hotplug_t,hotplug_exec_t)
2005-05-02 19:24:29 +00:00
type hotplug_etc_t; #, usercanread;
files_make_file(hotplug_etc_t)
type hotplug_var_run_t;
files_make_daemon_runtime_file(hotplug_var_run_t)
2005-05-02 19:24:29 +00:00
########################################
#
# Local policy
#
allow hotplug_t self:capability { net_admin sys_tty_config mknod };
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 };
allow hotplug_t self:process { getsession getattr };
2005-06-09 14:50:48 +00:00
allow hotplug_t self:fifo_file r_file_perms;
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-05-02 19:24:29 +00:00
2005-05-30 21:17:20 +00:00
allow hotplug_t hotplug_exec_t:file { getattr read ioctl execute execute_no_trans };
allow hotplug_t hotplug_etc_t:file { getattr read execute execute_no_trans };
2005-05-02 19:24:29 +00:00
allow hotplug_t hotplug_var_run_t:file { getattr create read write append setattr unlink };
files_create_daemon_runtime_data(hotplug_t,hotplug_var_run_t)
kernel_read_system_state(hotplug_t)
kernel_read_kernel_sysctl(hotplug_t)
kernel_read_hardware_state(hotplug_t)
kernel_read_network_sysctl(hotplug_t)
kernel_read_usb_hardware_state(hotplug_t)
bootloader_read_kernel_modules(hotplug_t)
corenetwork_sendrecv_tcp_on_all_interfaces(hotplug_t)
corenetwork_sendrecv_raw_on_all_interfaces(hotplug_t)
corenetwork_sendrecv_tcp_on_all_nodes(hotplug_t)
corenetwork_sendrecv_raw_on_all_nodes(hotplug_t)
corenetwork_sendrecv_tcp_on_all_ports(hotplug_t)
2005-05-24 15:55:57 +00:00
corenetwork_bind_tcp_on_all_nodes(hotplug_t)
2005-05-02 19:24:29 +00:00
# for SSP
devices_get_pseudorandom_data(hotplug_t)
2005-06-08 13:12:00 +00:00
fs_get_all_fs_attributes(hotplug_t)
2005-05-02 19:24:29 +00:00
storage_set_fixed_disk_attributes(hotplug_t)
storage_set_removable_device_attributes(hotplug_t)
terminal_ignore_use_console(hotplug_t)
corecommands_execute_general_programs(hotplug_t)
corecommands_execute_shell(hotplug_t)
corecommands_execute_system_programs(hotplug_t)
2005-05-02 19:24:29 +00:00
domain_use_widely_inheritable_file_descriptors(hotplug_t)
files_read_general_system_config(hotplug_t)
2005-05-26 20:38:45 +00:00
files_manage_runtime_system_config(hotplug_t)
2005-05-02 19:24:29 +00:00
files_execute_system_config_script(hotplug_t)
# for when filesystems are not mounted early in the boot:
files_ignore_search_isid_type_dir(hotplug_t)
2005-05-02 19:24:29 +00:00
init_use_file_descriptors(hotplug_t)
init_script_use_pseudoterminal(hotplug_t)
init_script_read_process_state(hotplug_t)
# Allow hotplug (including /sbin/ifup-local) to start/stop services and
# run sendmail -q
init_script_transition(hotplug_t)
# kernel threads inherit from shared descriptor table used by init
init_ignore_use_control_channel(hotplug_t)
2005-05-02 19:24:29 +00:00
logging_send_system_log_message(hotplug_t)
logging_search_system_log_directory(hotplug_t)
2005-05-02 19:24:29 +00:00
libraries_use_dynamic_loader(hotplug_t)
libraries_use_shared_libraries(hotplug_t)
2005-05-11 15:46:51 +00:00
# Read /usr/lib/gconv/.*
libraries_read_library_resources(hotplug_t)
2005-05-02 19:24:29 +00:00
modutils_insmod_transition(hotplug_t)
modutils_read_kernel_module_dependencies(hotplug_t)
miscfiles_read_localization(hotplug_t)
mount_transition(hotplug_t)
2005-05-24 15:55:57 +00:00
sysnetwork_read_network_config(hotplug_t)
userdomain_ignore_use_all_unprivileged_users_file_descriptors(hotplug_t)
ifdef(`distro_redhat', `
optional_policy(`netutils.te', `
# for arping used for static IP addresses on PCMCIA ethernet
netutils_transition(hotplug_t)
2005-06-08 13:12:00 +00:00
fs_use_tmpfs_character_devices(hotplug_t)
')
files_get_system_lock_file_attributes(hotplug_t)
')
2005-05-24 15:55:57 +00:00
ifdef(`targeted_policy', `
terminal_ignore_use_general_physical_terminal(hotplug_t)
terminal_ignore_use_general_pseudoterminal(hotplug_t)
files_ignore_read_rootfs_file(hotplug_t)
')
2005-05-02 19:24:29 +00:00
optional_policy(`consoletype.te',`
consoletype_transition(hotplug_t)
2005-05-02 19:24:29 +00:00
')
2005-05-09 21:07:53 +00:00
optional_policy(`hostname.te',`
hostname_execute(hotplug_t)
2005-05-09 21:07:53 +00:00
')
2005-05-02 19:24:29 +00:00
optional_policy(`iptables.te',`
iptables_transition(hotplug_t)
2005-05-02 19:24:29 +00:00
')
optional_policy(`mta.te', `
mta_send_mail(hotplug_t)
')
2005-05-02 19:24:29 +00:00
optional_policy(`selinux.te',`
selinux_newrole_sigchld(hotplug_t)
2005-05-02 19:24:29 +00:00
')
2005-05-09 21:07:53 +00:00
optional_policy(`sysnetwork.te',`
sysnetwork_ifconfig_transition(hotplug_t)
2005-05-09 21:07:53 +00:00
')
2005-05-02 19:24:29 +00:00
optional_policy(`udev.te', `
udev_transition(hotplug_t)
udev_read_database(hotplug_t)
2005-05-02 19:24:29 +00:00
')
optional_policy(`updfstab.te', `
updfstab_transition(hotplug_t)
2005-05-02 19:24:29 +00:00
')
ifdef(`TODO',`
allow hotplug_t autofs_t:dir { search getattr };
dontaudit hotplug_t sysadm_home_dir_t:dir search;
optional_policy(`rhgb.te', `
allow hotplug_t rhgb_t:process sigchld;
allow hotplug_t rhgb_t:fd use;
allow hotplug_t rhgb_t:fifo_file { read write };
2005-05-02 19:24:29 +00:00
')
allow kernel_t hotplug_etc_t:dir search;
allow hotplug_t sound_device_t:chr_file setattr;
can_ypbind(hotplug_t)
dbusd_client(system, hotplug)
allow hotplug_t kernel_t:process sigchld;
# for ps
dontaudit hotplug_t domain:dir { getattr search };
dontaudit hotplug_t { init_t kernel_t }:file read;
optional_policy(`hald.te', `
allow hotplug_t hald_t:unix_dgram_socket sendto;
')
# this goes to hald:
optional_policy(`hotplug.te',`
allow hald_t hotplug_etc_t:dir search;
allow hald_t hotplug_etc_t:file { getattr read };
2005-05-02 19:24:29 +00:00
')
optional_policy(`fsadm.te', `
domain_auto_trans(hotplug_t, fsadm_exec_t, fsadm_t)
2005-05-02 19:24:29 +00:00
')
optional_policy(`lpd.te', `
allow hotplug_t printer_device_t:chr_file setattr;
2005-05-02 19:24:29 +00:00
')
') dnl end TODO