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 f0574f
type udev_t;
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 8bd678
domain_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 8fd367
files_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 8fd367
files_type(udev_runtime_t)
Chris PeBenito 0bc32e
Chris PeBenito dfb86a
type udev_tbl_t alias udev_tdb_t;
Chris PeBenito 8fd367
files_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 98a8ea
allow udev_t self:capability { chown dac_override dac_read_search fowner fsetid sys_admin mknod net_raw net_admin sys_nice sys_rawio };
Chris PeBenito 9d3bdc
allow udev_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
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 a08248
allow udev_t self:netlink_kobject_uevent_socket { create bind read setopt };
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 ae9e27
kernel_rw_unix_dgram_socket(udev_t)
Chris PeBenito ae9e27
kernel_sendto_unix_dgram_socket(udev_t)
Chris PeBenito 0907bd
kernel_signal(udev_t)
Chris PeBenito d35c62
Chris PeBenito 98a8ea
dev_rw_sysfs(udev_t)
Chris PeBenito d35c62
dev_manage_dev_nodes(udev_t)
Chris PeBenito 98a8ea
dev_rw_generic_file(udev_t)
Chris PeBenito 98a8ea
dev_delete_generic_file(udev_t)
Chris PeBenito d35c62
Chris PeBenito d35c62
fs_getattr_all_fs(udev_t)
Chris PeBenito d35c62
Chris PeBenito 5e0da6
selinux_get_fs_mount(udev_t)
Chris PeBenito 5e0da6
selinux_validate_context(udev_t)
Chris PeBenito 5e0da6
selinux_compute_access_vector(udev_t)
Chris PeBenito 5e0da6
selinux_compute_create_context(udev_t)
Chris PeBenito 5e0da6
selinux_compute_relabel_context(udev_t)
Chris PeBenito 5e0da6
selinux_compute_user_contexts(udev_t)
Chris PeBenito 3a9aef
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 8fd367
files_read_etc_files(udev_t)
Chris PeBenito 8fd367
files_exec_etc_files(udev_t)
Chris PeBenito c9428d
files_dontaudit_search_isid_type_dir(udev_t)
Chris PeBenito ebdc3b
files_getattr_generic_locks(udev_t)
Chris PeBenito ebdc3b
files_search_mnt(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 7a2f20
logging_search_logs(udev_t)
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 f0574f
mls_file_read_up(udev_t)
Chris PeBenito f0574f
mls_file_write_down(udev_t)
Chris PeBenito f0574f
mls_file_upgrade(udev_t)
Chris PeBenito f0574f
mls_file_downgrade(udev_t)
Chris PeBenito f0574f
mls_process_write_down(udev_t)
Chris PeBenito f0574f
Chris PeBenito c9428d
modutils_domtrans_insmod(udev_t)
Chris PeBenito f5c42b
Chris PeBenito 5e0da6
seutil_read_config(udev_t)
Chris PeBenito 5e0da6
seutil_read_default_contexts(udev_t)
Chris PeBenito 5e0da6
seutil_read_file_contexts(udev_t)
Chris PeBenito 5e0da6
seutil_domtrans_restorecon(udev_t)
Chris PeBenito f5c42b
Chris PeBenito c9428d
sysnet_domtrans_ifconfig(udev_t)
Chris PeBenito 1e5c2a
Chris PeBenito fd89e1
userdom_use_sysadm_tty(udev_t)
Chris PeBenito fd89e1
Chris PeBenito 254bbc
ifdef(`distro_redhat',`
Chris PeBenito 98a8ea
	fs_manage_tmpfs_dirs(udev_t)
Chris PeBenito 98a8ea
	fs_manage_tmpfs_files(udev_t)
Chris PeBenito ebdc3b
	fs_manage_tmpfs_symlinks(udev_t)
Chris PeBenito ebdc3b
	fs_manage_tmpfs_sockets(udev_t)
Chris PeBenito ebdc3b
	fs_manage_tmpfs_blk_dev(udev_t)
Chris PeBenito ebdc3b
	fs_manage_tmpfs_chr_dev(udev_t)
Chris PeBenito ebdc3b
	fs_relabel_tmpfs_blk_dev(udev_t)
Chris PeBenito ebdc3b
	fs_relabel_tmpfs_chr_dev(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 892266
ifdef(`targeted_policy',`
Chris PeBenito 892266
	unconfined_domain_template(udev_t)
Chris PeBenito 892266
')
Chris PeBenito 892266
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 0c3d17
optional_policy(`dbus.te',`
Chris PeBenito 0c3d17
	dbus_system_bus_client_template(udev,udev_t)
Chris PeBenito 0c3d17
')
Chris PeBenito 0c3d17
Chris PeBenito 1e5c2a
optional_policy(`hotplug.te',`
Chris PeBenito 0c73cd
	hotplug_read_config(udev_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito fa6757
optional_policy(`nis.te',`
Chris PeBenito fa6757
	nis_use_ypbind(udev_t)
Chris PeBenito fa6757
')
Chris PeBenito fa6757
Chris PeBenito 493d6c
optional_policy(`nscd.te',`
Chris PeBenito 493d6c
	nscd_use_socket(udev_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito 1e5c2a
optional_policy(`sysnetwork.te',`
Chris PeBenito c9428d
	sysnet_domtrans_dhcpc(udev_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 71fe0f
#optional_policy(`xserver.te',`
Chris PeBenito 71fe0f
#	xserver_read_xdm_pid(udev_t)
Chris PeBenito 71fe0f
#')
Chris PeBenito fd89e1
Chris PeBenito dfb86a
ifdef(`TODO',`
Chris PeBenito dfb86a
dontaudit udev_t ttyfile:chr_file unlink;
Chris PeBenito dfb86a
') dnl endif TODO