Chris PeBenito dfb86a
Chris PeBenito 3a9aef
policy_module(udev,1.0)
Chris PeBenito 3a9aef
Chris PeBenito 3a9aef
########################################
Chris PeBenito 3a9aef
#
Chris PeBenito 3a9aef
# Declarations
Chris PeBenito 3a9aef
#
Chris PeBenito 3a9aef
Chris PeBenito 96b000
type udev_t; # nscd_client_domain
Chris PeBenito dfb86a
type udev_exec_t;
Chris PeBenito dfb86a
type udev_helper_exec_t;
Chris PeBenito 0fd9dc
kernel_userland_entry(udev_t,udev_exec_t)
Chris PeBenito c9428d
kernel_obj_id_change_exempt(udev_t)
Chris PeBenito c9428d
domain_entry_file(udev_t,udev_helper_exec_t)
Chris PeBenito c9428d
domain_wide_inherit_fd(udev_t)
Chris PeBenito c9428d
init_daemon_domain(udev_t,udev_exec_t)
Chris PeBenito dfb86a
Chris PeBenito dfb86a
type udev_etc_t alias etc_udev_t;
Chris PeBenito c9428d
files_file_type(udev_etc_t)
Chris PeBenito dfb86a
Chris PeBenito 0bc32e
# udev_runtime_t is the type of the udev table file
Chris PeBenito 0bc32e
# cjp: this is probably a copy of udev_tbl_t and can be removed
Chris PeBenito 0bc32e
type udev_runtime_t;
Chris PeBenito c9428d
files_file_type(udev_runtime_t)
Chris PeBenito 0bc32e
Chris PeBenito dfb86a
type udev_tbl_t alias udev_tdb_t;
Chris PeBenito c9428d
files_file_type(udev_tbl_t)
Chris PeBenito 3a9aef
Chris PeBenito 3a9aef
type udev_var_run_t;
Chris PeBenito c9428d
files_pid_file(udev_var_run_t)
Chris PeBenito 3a9aef
Chris PeBenito 3a9aef
########################################
Chris PeBenito 3a9aef
#
Chris PeBenito 3a9aef
# Local policy
Chris PeBenito 3a9aef
#
Chris PeBenito dfb86a
Chris PeBenito dfb86a
allow udev_t self:capability { chown dac_override dac_read_search fowner fsetid sys_admin mknod net_raw net_admin };
Chris PeBenito dfb86a
allow udev_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem dyntransition };
Chris PeBenito dfb86a
allow udev_t self:process { execmem setfscreate };
Chris PeBenito dfb86a
allow udev_t self:fd use;
Chris PeBenito 7edd02
allow udev_t self:fifo_file rw_file_perms;
Chris PeBenito dfb86a
allow udev_t self:unix_stream_socket { listen accept };
Chris PeBenito dfb86a
allow udev_t self:unix_dgram_socket sendto;
Chris PeBenito dfb86a
allow udev_t self:unix_stream_socket connectto;
Chris PeBenito 7edd02
allow udev_t self:shm create_shm_perms;
Chris PeBenito 7edd02
allow udev_t self:sem create_sem_perms;
Chris PeBenito 7edd02
allow udev_t self:msgq create_msgq_perms;
Chris PeBenito dfb86a
allow udev_t self:msg { send receive };
Chris PeBenito 7edd02
allow udev_t self:rawip_socket create_socket_perms;
Chris PeBenito dfb86a
Chris PeBenito 7edd02
allow udev_t udev_exec_t:file write;
Chris PeBenito 7edd02
can_exec(udev_t, udev_exec_t)
Chris PeBenito f5c42b
Chris PeBenito 7edd02
allow udev_t udev_helper_exec_t:dir r_dir_perms;
Chris PeBenito dfb86a
Chris PeBenito dfb86a
# read udev config
Chris PeBenito 7edd02
allow udev_t udev_etc_t:file r_file_perms;
Chris PeBenito dfb86a
Chris PeBenito dfb86a
# create udev database in /dev/.udevdb
Chris PeBenito 7edd02
allow udev_t udev_tbl_t:file create_file_perms;
Karl MacMillan f0c985
dev_create_dev_node(udev_t,udev_tbl_t,file)
Chris PeBenito dfb86a
Chris PeBenito 0fd9dc
allow udev_t udev_var_run_t:dir rw_dir_perms;
Chris PeBenito 0fd9dc
allow udev_t udev_var_run_t:file create_file_perms;
Chris PeBenito 3a9aef
Chris PeBenito dfb86a
kernel_read_system_state(udev_t)
Chris PeBenito 0fd9dc
kernel_getattr_core(udev_t)
Chris PeBenito 0fd9dc
kernel_use_fd(udev_t)
Chris PeBenito dfb86a
kernel_read_device_sysctl(udev_t)
Chris PeBenito dfb86a
kernel_read_hotplug_sysctl(udev_t)
Chris PeBenito dfb86a
kernel_read_modprobe_sysctl(udev_t)
Chris PeBenito dfb86a
kernel_read_kernel_sysctl(udev_t)
Chris PeBenito dfb86a
kernel_read_hardware_state(udev_t)
Chris PeBenito dfb86a
kernel_get_selinuxfs_mount_point(udev_t)
Chris PeBenito 0fd9dc
kernel_validate_context(udev_t)
Chris PeBenito 0fd9dc
kernel_compute_access_vector(udev_t)
Chris PeBenito 0fd9dc
kernel_compute_create_context(udev_t)
Chris PeBenito 0fd9dc
kernel_compute_relabel_context(udev_t)
Chris PeBenito 0fd9dc
kernel_compute_reachable_user_contexts(udev_t)
Chris PeBenito 3a9aef
Karl MacMillan f0c985
dev_manage_dev_nodes(udev_t)
Chris PeBenito dfb86a
Chris PeBenito 0fd9dc
fs_getattr_all_fs(udev_t)
Chris PeBenito f1470e
Chris PeBenito c9428d
corecmd_exec_bin(udev_t)
Chris PeBenito c9428d
corecmd_exec_sbin(udev_t)
Chris PeBenito c9428d
corecmd_exec_shell(udev_t)
Chris PeBenito d490eb
Chris PeBenito c9428d
domain_exec_all_entry_files(udev_t)
Chris PeBenito c9428d
domain_dontaudit_list_all_domains_proc(udev_t)
Chris PeBenito dfb86a
Chris PeBenito c9428d
files_read_etc_runtime_files(udev_t)
Chris PeBenito c9428d
files_read_generic_etc_files(udev_t)
Chris PeBenito c9428d
files_exec_generic_etc_files(udev_t)
Chris PeBenito c9428d
files_dontaudit_search_isid_type_dir(udev_t)
Chris PeBenito dfb86a
Chris PeBenito c9428d
init_use_fd(udev_t)
Chris PeBenito c9428d
init_read_script_pid(udev_t)
Chris PeBenito c9428d
init_dontaudit_write_script_pid(udev_t)
Chris PeBenito dfb86a
Chris PeBenito c9428d
libs_use_ld_so(udev_t)
Chris PeBenito c9428d
libs_use_shared_libs(udev_t)
Chris PeBenito cbeef6
Chris PeBenito c9428d
logging_send_syslog_msg(udev_t)
Chris PeBenito dfb86a
Chris PeBenito f5c42b
miscfiles_read_localization(udev_t)
Chris PeBenito f5c42b
Chris PeBenito c9428d
modutils_domtrans_insmod(udev_t)
Chris PeBenito f5c42b
Chris PeBenito f5c42b
selinux_read_config(udev_t)
Chris PeBenito f5c42b
selinux_read_default_contexts(udev_t)
Chris PeBenito f5c42b
selinux_read_file_contexts(udev_t)
Chris PeBenito c9428d
selinux_domtrans_restorecon(udev_t)
Chris PeBenito f5c42b
Chris PeBenito c9428d
sysnet_domtrans_ifconfig(udev_t)
Chris PeBenito 1e5c2a
Chris PeBenito 254bbc
ifdef(`distro_redhat',`
Chris PeBenito 763c44
	fs_manage_tmpfs_block_devices(udev_t)
Chris PeBenito 763c44
	fs_manage_tmpfs_character_devices(udev_t)
Chris PeBenito daa0e0
Chris PeBenito 0c73cd
	# for arping used for static IP addresses on PCMCIA ethernet
Chris PeBenito c9428d
	netutils_domtrans(udev_t)
Chris PeBenito 254bbc
')
Chris PeBenito daa0e0
Chris PeBenito 1e5c2a
optional_policy(`authlogin.te',`
Chris PeBenito c9428d
	auth_read_pam_console_data(udev_t)
Chris PeBenito c9428d
	auth_domtrans_pam_console(udev_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 0bc32e
optional_policy(`consoletype.te',`
Chris PeBenito c9428d
	consoletype_exec(udev_t)
Chris PeBenito dfb86a
')
Chris PeBenito dfb86a
Chris PeBenito 1e5c2a
optional_policy(`hotplug.te',`
Chris PeBenito 0c73cd
	hotplug_read_config(udev_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
optional_policy(`sysnetwork.te',`
Chris PeBenito c9428d
	sysnet_domtrans_dhcpc(udev_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito dfb86a
ifdef(`TODO',`
Chris PeBenito dfb86a
allow udev_t var_log_t:dir search;
Chris PeBenito dfb86a
allow udev_t var_lock_t:dir search;
Chris PeBenito dfb86a
allow udev_t var_lock_t:file getattr;
Chris PeBenito dfb86a
Chris PeBenito dfb86a
allow udev_t mnt_t:dir search;
Chris PeBenito dfb86a
Chris PeBenito dfb86a
allow udev_t devpts_t:dir { getattr search };
Chris PeBenito dfb86a
allow udev_t sysadm_tty_device_t:chr_file { read write };
Chris PeBenito dfb86a
Chris PeBenito dfb86a
# Dontaudits
Chris PeBenito dfb86a
dontaudit udev_t staff_home_dir_t:dir search;
Chris PeBenito dfb86a
dontaudit udev_t ttyfile:chr_file unlink;
Chris PeBenito dfb86a
Chris PeBenito dfb86a
allow udev_t kernel_t:unix_dgram_socket { sendto ioctl read write };
Chris PeBenito dfb86a
Chris PeBenito dfb86a
dbusd_client(system, udev)
Chris PeBenito dfb86a
Chris PeBenito 254bbc
ifdef(`distro_redhat',`
Chris PeBenito dfb86a
allow udev_t tmpfs_t:sock_file create_file_perms;
Chris PeBenito dfb86a
allow udev_t tmpfs_t:lnk_file create_lnk_perms;
Chris PeBenito daa0e0
allow udev_t tmpfs_t:{ chr_file blk_file } { relabelfrom relabelto };
Chris PeBenito 254bbc
')
Chris PeBenito dfb86a
Chris PeBenito 0bc32e
tunable_policy(`hide_broken_symptoms',`
Chris PeBenito dfb86a
dontaudit restorecon_t udev_t:unix_dgram_socket { read write };
Chris PeBenito dfb86a
dontaudit ifconfig_t udev_t:unix_dgram_socket { read write };
Chris PeBenito dfb86a
')
Chris PeBenito dfb86a
Chris PeBenito 0bc32e
optional_policy(`xdm.te',`
Chris PeBenito dfb86a
allow udev_t xdm_var_run_t:file { getattr read };
Chris PeBenito dfb86a
')
Chris PeBenito dfb86a
Chris PeBenito dfb86a
') dnl endif TODO