Chris PeBenito dfb86a
Chris PeBenito 2b3c99
policy_module(udev,1.3.0)
Chris PeBenito 3a9aef
Chris PeBenito 3a9aef
########################################
Chris PeBenito 3a9aef
#
Chris PeBenito 3a9aef
# Declarations
Chris PeBenito 3a9aef
#
Chris PeBenito 3a9aef
Chris PeBenito 77f6e2
# real declaration moved to mls until
Chris PeBenito 77f6e2
# range_transition works in loadable modules
Chris PeBenito 77f6e2
gen_require(`
Chris PeBenito 77f6e2
	type udev_exec_t;
Chris PeBenito 77f6e2
')
Chris PeBenito 77f6e2
Chris PeBenito f0574f
type udev_t;
Chris PeBenito dfb86a
type udev_helper_exec_t;
Chris PeBenito 270d42
kernel_domtrans_to(udev_t,udev_exec_t)
Chris PeBenito 1815ba
domain_obj_id_change_exemption(udev_t)
Chris PeBenito c9428d
domain_entry_file(udev_t,udev_helper_exec_t)
Chris PeBenito 15722e
domain_interactive_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 9bbc75
files_config_file(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 bf080a
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 sys_nice };
Chris PeBenito 30910b
dontaudit udev_t self:capability sys_tty_config;
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 30910b
allow udev_t self:sock_file r_file_perms;
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 77f6e2
allow udev_t self:unix_stream_socket { listen accept };
Chris PeBenito 77f6e2
allow udev_t self:unix_dgram_socket sendto;
Chris PeBenito 77f6e2
allow udev_t self:unix_stream_socket connectto;
Chris PeBenito 77f6e2
allow udev_t self:netlink_kobject_uevent_socket create_socket_perms;
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;
Chris PeBenito 103fe2
dev_filetrans(udev_t,udev_tbl_t,file)
Chris PeBenito dfb86a
Chris PeBenito 0fd9dc
allow udev_t udev_var_run_t:file create_file_perms;
Chris PeBenito 30910b
allow udev_t udev_var_run_t:dir rw_dir_perms;
Chris PeBenito 1c1ac6
files_pid_filetrans(udev_t,udev_var_run_t,file)
Chris PeBenito 3a9aef
Chris PeBenito dfb86a
kernel_read_system_state(udev_t)
Chris PeBenito 445522
kernel_getattr_core_if(udev_t)
Chris PeBenito 1c1ac6
kernel_use_fds(udev_t)
Chris PeBenito 445522
kernel_read_device_sysctls(udev_t)
Chris PeBenito 445522
kernel_read_hotplug_sysctls(udev_t)
Chris PeBenito 445522
kernel_read_modprobe_sysctls(udev_t)
Chris PeBenito 445522
kernel_read_kernel_sysctls(udev_t)
Chris PeBenito 445522
kernel_rw_hotplug_sysctls(udev_t)
Chris PeBenito 445522
kernel_rw_unix_dgram_sockets(udev_t)
Chris PeBenito 37f15c
kernel_dgram_send(udev_t)
Chris PeBenito 0907bd
kernel_signal(udev_t)
Chris PeBenito d35c62
Chris PeBenito 98a8ea
dev_rw_sysfs(udev_t)
Chris PeBenito 207c47
dev_manage_all_dev_nodes(udev_t)
Chris PeBenito 207c47
dev_rw_generic_files(udev_t)
Chris PeBenito 207c47
dev_delete_generic_files(udev_t)
Chris PeBenito d35c62
Chris PeBenito d35c62
fs_getattr_all_fs(udev_t)
Chris PeBenito b0d224
fs_list_inotifyfs(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 77f6e2
auth_use_nsswitch(udev_t)
Chris PeBenito 77f6e2
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 b0d224
domain_read_all_domains_state(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 9e04f5
files_dontaudit_search_isid_type_dirs(udev_t)
Chris PeBenito ebdc3b
files_getattr_generic_locks(udev_t)
Chris PeBenito ebdc3b
files_search_mnt(udev_t)
Chris PeBenito dfb86a
Chris PeBenito 1c1ac6
init_use_fds(udev_t)
Chris PeBenito 68228b
init_read_utmp(udev_t)
Chris PeBenito 68228b
init_dontaudit_write_utmp(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 1815ba
userdom_use_sysadm_ttys(udev_t)
Chris PeBenito 103fe2
userdom_dontaudit_search_all_users_home_content(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 4d851f
	fs_manage_tmpfs_blk_files(udev_t)
Chris PeBenito 4d851f
	fs_manage_tmpfs_chr_files(udev_t)
Chris PeBenito 4d851f
	fs_relabel_tmpfs_blk_file(udev_t)
Chris PeBenito 4d851f
	fs_relabel_tmpfs_chr_file(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 1815ba
	term_dontaudit_use_unallocated_ttys(udev_t)
Chris PeBenito 1815ba
	term_dontaudit_use_generic_ptys(udev_t)
Chris PeBenito 30910b
Chris PeBenito 955019
	unconfined_domain(udev_t)
Chris PeBenito 892266
')
Chris PeBenito 892266
Chris PeBenito 132880
optional_policy(`authlogin',`
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 132880
optional_policy(`consoletype',`
Chris PeBenito c9428d
	consoletype_exec(udev_t)
Chris PeBenito dfb86a
')
Chris PeBenito dfb86a
Chris PeBenito 132880
optional_policy(`dbus',`
Chris PeBenito 0c3d17
	dbus_system_bus_client_template(udev,udev_t)
Chris PeBenito 0c3d17
')
Chris PeBenito 0c3d17
Chris PeBenito 9fd4b8
optional_policy(`hal',`
Chris PeBenito 1c1ac6
	hal_dgram_send(udev_t)
Chris PeBenito 9fd4b8
')
Chris PeBenito 9fd4b8
Chris PeBenito 132880
optional_policy(`hotplug',`
Chris PeBenito 0c73cd
	hotplug_read_config(udev_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 132880
optional_policy(`nis',`
Chris PeBenito fa6757
	nis_use_ypbind(udev_t)
Chris PeBenito fa6757
')
Chris PeBenito fa6757
Chris PeBenito 132880
optional_policy(`nscd',`
Chris PeBenito 1815ba
	nscd_socket_use(udev_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito 132880
optional_policy(`sysnetwork',`
Chris PeBenito c9428d
	sysnet_domtrans_dhcpc(udev_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 9fd4b8
#optional_policy(`xdm',`
Chris PeBenito 9fd4b8
#	xdm_read_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