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

198 lines
4.9 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;
2005-06-10 01:01:13 +00:00
kernel_userland_entry(hotplug_t,hotplug_exec_t)
2005-06-13 17:35:46 +00:00
init_system_domain(hotplug_t,hotplug_exec_t)
2005-05-02 19:24:29 +00:00
type hotplug_etc_t; #, usercanread;
2005-06-13 17:35:46 +00:00
files_file_type(hotplug_etc_t)
2005-05-02 19:24:29 +00:00
type hotplug_var_run_t;
2005-06-13 17:35:46 +00:00
files_pid_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-10 01:01:13 +00:00
allow hotplug_t self:fifo_file rw_file_perms;
2005-06-09 14:50:48 +00:00
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 };
2005-06-13 17:35:46 +00:00
files_create_pid(hotplug_t,hotplug_var_run_t)
2005-05-02 19:24:29 +00:00
kernel_sigchld(hotplug_t)
2005-05-02 19:24:29 +00:00
kernel_read_system_state(hotplug_t)
kernel_read_kernel_sysctl(hotplug_t)
2005-06-10 01:01:13 +00:00
kernel_read_net_sysctl(hotplug_t)
2005-05-02 19:24:29 +00:00
bootloader_read_kernel_modules(hotplug_t)
2005-06-10 01:01:13 +00:00
corenet_tcp_sendrecv_all_if(hotplug_t)
corenet_raw_sendrecv_all_if(hotplug_t)
corenet_tcp_sendrecv_all_nodes(hotplug_t)
corenet_raw_sendrecv_all_nodes(hotplug_t)
corenet_tcp_sendrecv_all_ports(hotplug_t)
corenet_tcp_bind_all_nodes(hotplug_t)
2005-05-24 15:55:57 +00:00
dev_read_sysfs(hotplug_t)
dev_read_usbfs(hotplug_t)
dev_setattr_snd_dev(hotplug_t)
# for SSP:
2005-06-13 16:22:32 +00:00
dev_read_urand(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-10 01:01:13 +00:00
fs_getattr_all_fs(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-10 01:01:13 +00:00
storage_setattr_fixed_disk(hotplug_t)
2005-06-13 20:00:36 +00:00
storage_setattr_removable_device(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-10 01:01:13 +00:00
term_dontaudit_use_console(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-13 17:35:46 +00:00
corecmd_exec_bin(hotplug_t)
corecmd_exec_shell(hotplug_t)
corecmd_exec_sbin(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-13 17:35:46 +00:00
domain_use_wide_inherit_fd(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-13 17:35:46 +00:00
files_read_generic_etc_files(hotplug_t)
files_manage_etc_runtime_files(hotplug_t)
files_exec_generic_etc_files(hotplug_t)
# for when filesystems are not mounted early in the boot:
2005-06-13 17:35:46 +00:00
files_dontaudit_search_isid_type_dir(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-13 17:35:46 +00:00
init_use_fd(hotplug_t)
init_use_script_pty(hotplug_t)
init_read_script_process_state(hotplug_t)
# Allow hotplug (including /sbin/ifup-local) to start/stop services and
# run sendmail -q
2005-06-13 17:35:46 +00:00
init_domtrans_script(hotplug_t)
# kernel threads inherit from shared descriptor table used by init
2005-06-13 17:35:46 +00:00
init_dontaudit_use_initctl(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-13 17:35:46 +00:00
logging_send_syslog_msg(hotplug_t)
logging_search_logs(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-13 17:35:46 +00:00
libs_use_ld_so(hotplug_t)
libs_use_shared_libs(hotplug_t)
2005-05-11 15:46:51 +00:00
# Read /usr/lib/gconv/.*
2005-06-13 17:35:46 +00:00
libs_read_lib(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-13 17:35:46 +00:00
modutils_domtrans_insmod(hotplug_t)
2005-05-02 19:24:29 +00:00
modutils_read_kernel_module_dependencies(hotplug_t)
miscfiles_read_localization(hotplug_t)
2005-06-13 17:35:46 +00:00
mount_domtrans(hotplug_t)
2005-05-02 19:24:29 +00:00
2005-06-13 17:35:46 +00:00
sysnet_read_config(hotplug_t)
2005-05-24 15:55:57 +00:00
2005-06-13 17:35:46 +00:00
userdom_dontaudit_use_unpriv_user_fd(hotplug_t)
ifdef(`distro_redhat', `
optional_policy(`netutils.te', `
# for arping used for static IP addresses on PCMCIA ethernet
2005-06-13 17:35:46 +00:00
netutils_domtrans(hotplug_t)
2005-06-08 13:12:00 +00:00
fs_use_tmpfs_character_devices(hotplug_t)
')
2005-06-13 17:35:46 +00:00
files_getattr_generic_lock_files(hotplug_t)
')
2005-05-24 15:55:57 +00:00
ifdef(`targeted_policy', `
2005-06-10 01:01:13 +00:00
term_dontaudit_use_unallocated_tty(hotplug_t)
term_dontaudit_use_generic_pty(hotplug_t)
2005-06-13 17:35:46 +00:00
files_dontaudit_read_root_file(hotplug_t)
')
2005-05-02 19:24:29 +00:00
optional_policy(`consoletype.te',`
2005-06-13 17:35:46 +00:00
consoletype_domtrans(hotplug_t)
2005-05-02 19:24:29 +00:00
')
2005-05-09 21:07:53 +00:00
optional_policy(`hostname.te',`
2005-06-13 17:35:46 +00:00
hostname_exec(hotplug_t)
2005-05-09 21:07:53 +00:00
')
2005-05-02 19:24:29 +00:00
optional_policy(`iptables.te',`
2005-06-13 17:35:46 +00:00
iptables_domtrans(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',`
seutil_newrole_sigchld(hotplug_t)
2005-05-02 19:24:29 +00:00
')
2005-05-09 21:07:53 +00:00
optional_policy(`sysnetwork.te',`
2005-06-13 17:35:46 +00:00
sysnet_domtrans_ifconfig(hotplug_t)
2005-05-09 21:07:53 +00:00
')
2005-05-02 19:24:29 +00:00
optional_policy(`udev.te', `
2005-06-13 17:35:46 +00:00
udev_domtrans(hotplug_t)
udev_read_db(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;
can_ypbind(hotplug_t)
dbusd_client(system, hotplug)
# 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