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 ff3138
kernel_make_userland_entrypoint(udev_t,udev_exec_t)
Chris PeBenito 96b000
kernel_make_object_identity_change_constraint_exception(udev_t)
Chris PeBenito dfb86a
domain_make_entrypoint_file(udev_t,udev_helper_exec_t)
Chris PeBenito 0bc32e
domain_make_file_descriptors_widely_inheritable(udev_t)
Chris PeBenito cbeef6
init_make_daemon_domain(udev_t,udev_exec_t)
Chris PeBenito dfb86a
Chris PeBenito dfb86a
type udev_etc_t alias etc_udev_t;
Chris PeBenito dfb86a
files_make_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 0bc32e
files_make_file(udev_runtime_t)
Chris PeBenito 0bc32e
Chris PeBenito dfb86a
type udev_tbl_t alias udev_tdb_t;
Chris PeBenito dfb86a
files_make_file(udev_tbl_t)
Chris PeBenito 3a9aef
Chris PeBenito 3a9aef
type udev_var_run_t;
Chris PeBenito d25dd9
files_make_daemon_runtime_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 dfb86a
allow udev_t self:fifo_file { read getattr lock ioctl write append };
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 dfb86a
allow udev_t self:shm { associate getattr setattr create destroy read write lock unix_read unix_write };
Chris PeBenito dfb86a
allow udev_t self:sem { associate getattr setattr create destroy read write unix_read unix_write };
Chris PeBenito dfb86a
allow udev_t self:msgq { associate getattr setattr create destroy read write enqueue unix_read unix_write };
Chris PeBenito dfb86a
allow udev_t self:msg { send receive };
Chris PeBenito dfb86a
allow udev_t self:rawip_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
Chris PeBenito dfb86a
Chris PeBenito f5c42b
allow udev_t udev_exec_t:file { getattr read write ioctl execute execute_no_trans };
Chris PeBenito f5c42b
Chris PeBenito dfb86a
allow udev_t udev_helper_exec_t:dir { read getattr lock search ioctl };
Chris PeBenito dfb86a
Chris PeBenito dfb86a
# read udev config
Chris PeBenito dfb86a
allow udev_t udev_etc_t:file { read getattr lock ioctl };
Chris PeBenito dfb86a
Chris PeBenito dfb86a
# create udev database in /dev/.udevdb
Chris PeBenito dfb86a
allow udev_t udev_tbl_t:file { create ioctl read getattr lock write setattr append link unlink rename };
Chris PeBenito d25dd9
devices_create_dev_entry(udev_t,udev_tbl_t,file)
Chris PeBenito dfb86a
Chris PeBenito 3a9aef
allow udev_t udev_var_run_t : dir { read getattr lock search ioctl add_name remove_name write };
Chris PeBenito 3a9aef
allow udev_t udev_var_run_t : file { create ioctl read getattr lock write setattr append link unlink rename };
Chris PeBenito 3a9aef
Chris PeBenito dfb86a
kernel_read_system_state(udev_t)
Chris PeBenito dfb86a
kernel_get_core_interface_attributes(udev_t)
Chris PeBenito f9cfa1
kernel_use_file_descriptors(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 dfb86a
kernel_validate_selinux_context(udev_t)
Chris PeBenito 178607
kernel_compute_selinux_access_vector(udev_t)
Chris PeBenito 178607
kernel_compute_selinux_create_context(udev_t)
Chris PeBenito 178607
kernel_compute_selinux_relabel_context(udev_t)
Chris PeBenito 178607
kernel_compute_selinux_reachable_user_contexts(udev_t)
Chris PeBenito 3a9aef
Chris PeBenito 3a9aef
devices_manage_device_nodes(udev_t)
Chris PeBenito dfb86a
Chris PeBenito f1470e
filesystem_get_all_filesystems_attributes(udev_t)
Chris PeBenito f1470e
Chris PeBenito dfb86a
corecommands_execute_general_programs(udev_t)
Chris PeBenito dfb86a
corecommands_execute_system_programs(udev_t)
Chris PeBenito dfb86a
corecommands_execute_shell(udev_t)
Chris PeBenito d490eb
Chris PeBenito dfb86a
domain_execute_all_entrypoint_programs(udev_t)
Chris PeBenito d490eb
domain_ignore_read_all_domains_process_dirs(udev_t)
Chris PeBenito dfb86a
Chris PeBenito f5c42b
files_read_runtime_system_config(udev_t)
Chris PeBenito f5c42b
files_read_general_system_config(udev_t)
Chris PeBenito f5c42b
files_execute_system_config_script(udev_t)
Chris PeBenito 3b857e
files_ignore_search_isid_type_dir(udev_t)
Chris PeBenito dfb86a
Chris PeBenito f5c42b
init_use_file_descriptors(udev_t)
Chris PeBenito f5c42b
init_script_read_runtime_data(udev_t)
Chris PeBenito f5c42b
init_script_ignore_write_runtime_data(udev_t)
Chris PeBenito dfb86a
Chris PeBenito cbeef6
libraries_use_dynamic_loader(udev_t)
Chris PeBenito cbeef6
libraries_use_shared_libraries(udev_t)
Chris PeBenito cbeef6
Chris PeBenito dfb86a
logging_send_system_log_message(udev_t)
Chris PeBenito dfb86a
Chris PeBenito f5c42b
miscfiles_read_localization(udev_t)
Chris PeBenito f5c42b
Chris PeBenito f5c42b
modutils_insmod_transition(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 f5c42b
selinux_restorecon_transition(udev_t)
Chris PeBenito f5c42b
Chris PeBenito 1e5c2a
sysnetwork_ifconfig_transition(udev_t)
Chris PeBenito 1e5c2a
Chris PeBenito 254bbc
ifdef(`distro_redhat',`
Chris PeBenito 0c73cd
	filesystem_manage_tmpfs_block_devices(udev_t)
Chris PeBenito 0c73cd
	filesystem_manage_tmpfs_character_devices(udev_t)
Chris PeBenito daa0e0
Chris PeBenito 0c73cd
	# for arping used for static IP addresses on PCMCIA ethernet
Chris PeBenito 0c73cd
	netutils_transition(udev_t)
Chris PeBenito 254bbc
')
Chris PeBenito daa0e0
Chris PeBenito 1e5c2a
optional_policy(`authlogin.te',`
Chris PeBenito 0c73cd
	authlogin_pam_console_read_runtime_data(udev_t)
Chris PeBenito 0c73cd
	authlogin_pam_console_transition(udev_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 0bc32e
optional_policy(`consoletype.te',`
Chris PeBenito 0c73cd
	consoletype_execute(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 0c73cd
	sysnetwork_dhcpc_transition(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