Chris PeBenito 17de1b
Chris PeBenito 9570b2
policy_module(udev, 1.11.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type udev_t;
Chris PeBenito e070dd
type udev_exec_t;
Chris PeBenito 17de1b
type udev_helper_exec_t;
Chris PeBenito 3f67f7
kernel_domtrans_to(udev_t, udev_exec_t)
Chris PeBenito 17de1b
domain_obj_id_change_exemption(udev_t)
Chris PeBenito 3f67f7
domain_entry_file(udev_t, udev_helper_exec_t)
Chris PeBenito 17de1b
domain_interactive_fd(udev_t)
Chris PeBenito 3f67f7
init_daemon_domain(udev_t, udev_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type udev_etc_t alias etc_udev_t;
Chris PeBenito 17de1b
files_config_file(udev_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type udev_tbl_t alias udev_tdb_t;
Chris PeBenito 17de1b
files_type(udev_tbl_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type udev_var_run_t;
Chris PeBenito 17de1b
files_pid_file(udev_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito e070dd
ifdef(`enable_mcs',`
Chris PeBenito 3f67f7
	kernel_ranged_domtrans_to(udev_t, udev_exec_t, s0 - mcs_systemhigh)
Chris PeBenito 3f67f7
	init_ranged_daemon_domain(udev_t, udev_exec_t, s0 - mcs_systemhigh)
Chris PeBenito e070dd
')
Chris PeBenito e070dd
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 465510
allow udev_t self:capability { chown dac_override dac_read_search fowner fsetid sys_admin mknod net_raw net_admin sys_nice sys_rawio sys_resource setuid setgid sys_nice sys_ptrace };
Chris PeBenito 17de1b
dontaudit udev_t self:capability sys_tty_config;
Chris PeBenito 465510
allow udev_t self:process ~{ setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 17de1b
allow udev_t self:process { execmem setfscreate };
Chris PeBenito 17de1b
allow udev_t self:fd use;
Chris PeBenito c0868a
allow udev_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 0b36a2
allow udev_t self:sock_file read_sock_file_perms;
Chris PeBenito 17de1b
allow udev_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow udev_t self:sem create_sem_perms;
Chris PeBenito 17de1b
allow udev_t self:msgq create_msgq_perms;
Chris PeBenito 17de1b
allow udev_t self:msg { send receive };
Chris PeBenito 17de1b
allow udev_t self:unix_stream_socket { listen accept };
Chris PeBenito 17de1b
allow udev_t self:unix_dgram_socket sendto;
Chris PeBenito 17de1b
allow udev_t self:unix_stream_socket connectto;
Chris PeBenito 17de1b
allow udev_t self:netlink_kobject_uevent_socket create_socket_perms;
Chris PeBenito 17de1b
allow udev_t self:rawip_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow udev_t udev_exec_t:file write;
Chris PeBenito 17de1b
can_exec(udev_t, udev_exec_t)
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow udev_t udev_helper_exec_t:dir list_dir_perms;
Chris PeBenito 3c9b2e
can_exec(udev_t, udev_helper_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# read udev config
Chris PeBenito c0868a
allow udev_t udev_etc_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# create udev database in /dev/.udevdb
Chris PeBenito c0868a
allow udev_t udev_tbl_t:file manage_file_perms;
Chris PeBenito 3f67f7
dev_filetrans(udev_t, udev_tbl_t, file)
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
manage_dirs_pattern(udev_t, udev_var_run_t, udev_var_run_t)
Chris PeBenito 3f67f7
manage_files_pattern(udev_t, udev_var_run_t, udev_var_run_t)
Chris PeBenito 3f67f7
files_pid_filetrans(udev_t, udev_var_run_t, { dir file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(udev_t)
Chris PeBenito 17de1b
kernel_getattr_core_if(udev_t)
Chris PeBenito 17de1b
kernel_use_fds(udev_t)
Chris PeBenito 17de1b
kernel_read_device_sysctls(udev_t)
Chris PeBenito 17de1b
kernel_read_hotplug_sysctls(udev_t)
Chris PeBenito 17de1b
kernel_read_modprobe_sysctls(udev_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(udev_t)
Chris PeBenito 17de1b
kernel_rw_hotplug_sysctls(udev_t)
Chris PeBenito 17de1b
kernel_rw_unix_dgram_sockets(udev_t)
Chris PeBenito 17de1b
kernel_dgram_send(udev_t)
Chris PeBenito 17de1b
kernel_signal(udev_t)
Chris PeBenito 3c9b2e
kernel_search_debugfs(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 8241b5
#https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=235182
Chris PeBenito 8241b5
kernel_rw_net_sysctls(udev_t)
Chris PeBenito 8241b5
kernel_read_network_state(udev_t)
Chris PeBenito 3c9b2e
kernel_read_software_raid_state(udev_t)
Chris PeBenito 8241b5
Chris PeBenito eac818
corecmd_exec_all_executables(udev_t)
Chris PeBenito eac818
Chris PeBenito 17de1b
dev_rw_sysfs(udev_t)
Chris PeBenito 17de1b
dev_manage_all_dev_nodes(udev_t)
Chris PeBenito 17de1b
dev_rw_generic_files(udev_t)
Chris PeBenito 17de1b
dev_delete_generic_files(udev_t)
Chris PeBenito 8241b5
dev_search_usbfs(udev_t)
Chris PeBenito 8241b5
dev_relabel_all_dev_nodes(udev_t)
Chris PeBenito 08dcce
# udev_node.c/node_symlink() symlink labels are explicitly
Chris PeBenito 08dcce
# preserved, instead of short circuiting the relabel
Chris PeBenito 08dcce
dev_relabel_generic_symlinks(udev_t)
Chris PeBenito 17de1b
Chris PeBenito eac818
domain_read_all_domains_state(udev_t)
Chris PeBenito 693d4a
domain_dontaudit_ptrace_all_domains(udev_t) #pidof triggers these 
Chris PeBenito eac818
Chris PeBenito 8241b5
files_read_usr_files(udev_t)
Chris PeBenito eac818
files_read_etc_runtime_files(udev_t)
Chris PeBenito eac818
files_read_etc_files(udev_t)
Chris PeBenito eac818
files_exec_etc_files(udev_t)
Chris PeBenito eac818
files_dontaudit_search_isid_type_dirs(udev_t)
Chris PeBenito eac818
files_getattr_generic_locks(udev_t)
Chris PeBenito eac818
files_search_mnt(udev_t)
Chris PeBenito eac818
Chris PeBenito 17de1b
fs_getattr_all_fs(udev_t)
Chris PeBenito 17de1b
fs_list_inotifyfs(udev_t)
Chris PeBenito 17de1b
Chris PeBenito eac818
mcs_ptrace_all(udev_t)
Chris PeBenito eac818
Chris PeBenito f8233a
mls_file_read_all_levels(udev_t)
Chris PeBenito f8233a
mls_file_write_all_levels(udev_t)
Chris PeBenito eac818
mls_file_upgrade(udev_t)
Chris PeBenito eac818
mls_file_downgrade(udev_t)
Chris PeBenito eac818
mls_process_write_down(udev_t)
Chris PeBenito eac818
Chris PeBenito 17de1b
selinux_get_fs_mount(udev_t)
Chris PeBenito 17de1b
selinux_validate_context(udev_t)
Chris PeBenito 17de1b
selinux_compute_access_vector(udev_t)
Chris PeBenito 17de1b
selinux_compute_create_context(udev_t)
Chris PeBenito 17de1b
selinux_compute_relabel_context(udev_t)
Chris PeBenito 17de1b
selinux_compute_user_contexts(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 3ef029
auth_read_pam_console_data(udev_t)
Chris PeBenito 3ef029
auth_domtrans_pam_console(udev_t)
Chris PeBenito 17de1b
auth_use_nsswitch(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_read_utmp(udev_t)
Chris PeBenito 17de1b
init_dontaudit_write_utmp(udev_t)
Chris PeBenito 6c9118
init_getattr_initctl(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_search_logs(udev_t)
Chris PeBenito 17de1b
logging_send_syslog_msg(udev_t)
Chris PeBenito 3c9b2e
logging_send_audit_msgs(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
modutils_domtrans_insmod(udev_t)
Chris PeBenito ed38ca
# read modules.inputmap:
Chris PeBenito ed38ca
modutils_read_module_deps(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
seutil_read_config(udev_t)
Chris PeBenito 17de1b
seutil_read_default_contexts(udev_t)
Chris PeBenito 17de1b
seutil_read_file_contexts(udev_t)
Chris PeBenito 762d2c
seutil_domtrans_setfiles(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_domtrans_ifconfig(udev_t)
Chris PeBenito 3ef029
sysnet_domtrans_dhcpc(udev_t)
Chris PeBenito 8241b5
sysnet_rw_dhcp_config(udev_t)
Chris PeBenito 8241b5
sysnet_read_dhcpc_pid(udev_t)
Chris PeBenito 8241b5
sysnet_delete_dhcpc_pid(udev_t)
Chris PeBenito 8241b5
sysnet_signal_dhcpc(udev_t)
Chris PeBenito 8241b5
sysnet_manage_config(udev_t)
Chris PeBenito 8241b5
sysnet_etc_filetrans_config(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
userdom_dontaudit_search_user_home_content(udev_t)
Chris PeBenito 17de1b
Chris PeBenito ed38ca
ifdef(`distro_gentoo',`
Chris PeBenito ed38ca
	# during boot, init scripts use /dev/.rcsysinit
Chris PeBenito ed38ca
	# existance to determine if we are in early booting
Chris PeBenito ed38ca
	init_getattr_script_status_files(udev_t)
Chris PeBenito ed38ca
')
Chris PeBenito ed38ca
Chris PeBenito 17de1b
ifdef(`distro_redhat',`
Chris PeBenito 17de1b
	fs_manage_tmpfs_dirs(udev_t)
Chris PeBenito 17de1b
	fs_manage_tmpfs_files(udev_t)
Chris PeBenito 17de1b
	fs_manage_tmpfs_symlinks(udev_t)
Chris PeBenito 17de1b
	fs_manage_tmpfs_sockets(udev_t)
Chris PeBenito 17de1b
	fs_manage_tmpfs_blk_files(udev_t)
Chris PeBenito 17de1b
	fs_manage_tmpfs_chr_files(udev_t)
Chris PeBenito 17de1b
	fs_relabel_tmpfs_blk_file(udev_t)
Chris PeBenito 17de1b
	fs_relabel_tmpfs_chr_file(udev_t)
Chris PeBenito 17de1b
Chris PeBenito 697489
	term_search_ptys(udev_t)
Chris PeBenito 697489
Chris PeBenito 17de1b
	# for arping used for static IP addresses on PCMCIA ethernet
Chris PeBenito 17de1b
	netutils_domtrans(udev_t)
Chris PeBenito 153fe2
Chris PeBenito 153fe2
	optional_policy(`
Chris PeBenito 153fe2
		unconfined_domain(udev_t)
Chris PeBenito 153fe2
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 6c9118
	alsa_domtrans(udev_t)
Chris PeBenito 3c9b2e
	alsa_read_lib(udev_t)
Chris PeBenito 6c9118
	alsa_read_rw_config(udev_t)
Chris PeBenito 6c9118
')
Chris PeBenito 6c9118
Chris PeBenito 6c9118
optional_policy(`
Chris PeBenito 8241b5
	brctl_domtrans(udev_t)
Chris PeBenito 8241b5
')
Chris PeBenito 8241b5
Chris PeBenito 8241b5
optional_policy(`
Chris PeBenito 3c9b2e
	clock_domtrans(udev_t)
Chris PeBenito 3c9b2e
')
Chris PeBenito 3c9b2e
Chris PeBenito 3c9b2e
optional_policy(`
Chris PeBenito 17de1b
	consoletype_exec(udev_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 296273
	dbus_system_bus_client(udev_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 3c9b2e
	lvm_domtrans(udev_t)
Chris PeBenito 3c9b2e
')
Chris PeBenito 3c9b2e
Chris PeBenito 3c9b2e
optional_policy(`
Chris PeBenito 8241b5
	fstools_domtrans(udev_t)
Chris PeBenito 8241b5
')
Chris PeBenito 8241b5
Chris PeBenito 8241b5
optional_policy(`
Chris PeBenito 17de1b
	hal_dgram_send(udev_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	hotplug_read_config(udev_t)
Chris PeBenito ed38ca
	# usb.agent searches /var/run/usb
Chris PeBenito ed38ca
	hotplug_search_pids(udev_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 8241b5
	openct_read_pid_files(udev_t)
Chris PeBenito 8241b5
	openct_domtrans(udev_t)
Chris PeBenito 8241b5
')
Chris PeBenito 8241b5
Chris PeBenito 8241b5
optional_policy(`
Chris PeBenito 8241b5
	pcscd_read_pub_files(udev_t)
Chris PeBenito 8241b5
	pcscd_domtrans(udev_t)
Chris PeBenito 8241b5
')
Chris PeBenito 8241b5
Chris PeBenito 8241b5
optional_policy(`
Chris PeBenito 6c9118
	raid_domtrans_mdadm(udev_t)
Chris PeBenito 6c9118
')
Chris PeBenito 6c9118
Chris PeBenito 6c9118
optional_policy(`
Chris PeBenito 8241b5
	kernel_write_xen_state(udev_t)
Chris PeBenito 8241b5
	kernel_read_xen_state(udev_t)
Chris PeBenito 8241b5
	xen_manage_log(udev_t)
Chris PeBenito 8241b5
	xen_read_image_files(udev_t)
Chris PeBenito 8241b5
')
Chris PeBenito 8241b5
Chris PeBenito 8241b5
optional_policy(`
Chris PeBenito 17de1b
	xserver_read_xdm_pid(udev_t)
Chris PeBenito 17de1b
')