## ## ## Policy for kernel threads, security interface (selinuxfs), ## proc filesystem, sysfs filesystem, and usb device filesystem. ## ######################################## ## ## ## Gives kernel an entrypoint to the caller via ## the entrypoint type. ## ## ## ... ## ## ## The process type entered by kernel. ## ## ## The executable type for the entrypoint. ## ## ## # define(`kernel_make_userland_entrypoint',` requires_block_template(`$0'_depend) allow kernel_t $2:file { getattr read execute }; allow kernel_t $1:process transition; allow $1 kernel_t:fd use; type_transition kernel_t $2:process $1; dontaudit kernel_t $1:process { noatsecure siginh rlimitinh }; allow $1 kernel_t:fd use; allow kernel_t $1:fd use; allow kernel_t $1:fifo_file rw_file_perms; allow $1 kernel_t:process sigchld; ') define(`kernel_make_userland_entrypoint_depend',` type kernel_t; class process { transition noatsecure siginh rlimitinh sigchld }; class file { getattr read execute }; class fifo_file rw_file_perms; class fd use; ') ######################################## ## ## ## Allows the kernel to share state information with ## the caller. ## ## ## Gives a type access to state information about ## kernel processes ## ## ## The type of the process with which to share state information. ## ## ## # define(`kernel_share_state',` requires_block_template(`$0'_depend) allow kernel_t $1:process share; ') define(`kernel_share_state_depend',` type kernel_t; class process share; ') ######################################## ## ## ## Permits caller to use kernel file descriptors. ## ## ## Permits use of kernel file descriptors. ## ## ## The type of the process using the descriptors. ## ## ## # define(`kernel_use_file_descriptors',` requires_block_template(`$0'_depend) allow $1 kernel_t:fd use; ') define(`kernel_use_file_descriptors_depend',` type kernel_t; class fd use; ') ######################################## ## ## ## Do not audit attempts by the caller to use ## kernel file descriptors. ## ## ## Causes attempts to use kernel file descriptors ## to not be audited for caller. ## ## ## The type of process not to audit. ## ## ## # define(`kernel_ignore_use_file_descriptors',` requires_block_template(`$0'_depend) dontaudit $1 kernel_t:fd use; ') define(`kernel_ignore_use_file_descriptors_depend',` type kernel_t; class fd use; ') ######################################## ## ## ## Allows the kernel to mount filesystems on ## the caller. ## ## ## Givers kernel permission to mount on directories ## of the calling type. ## ## ## The type of the directory to use as a mountpoint. ## ## ## # define(`kernel_make_root_filesystem_mountpoint',` requires_block_template(`$0'_depend) allow kernel_t $1:dir mounton; ') define(`kernel_make_root_filesystem_mountpoint_depend',` type kernel_t; class dir mounton; ') ######################################## ## ## ## Makes caller an exception to the constraint preventing ## changing of user identity. ## ## ## Allows changing of user identity in context of the calling process. ## ## ## The process type to make an exception to the constraint. ## ## ## # define(`kernel_make_process_identity_change_constraint_exception',` requires_block_template(`$0'_depend) typeattribute $1 can_change_process_identity; ') define(`kernel_make_process_identity_change_constraint_exception_depend',` attribute can_change_process_identity; ') ######################################## ## ## ## Makes caller an exception to the constraint preventing ## changing of role. ## ## ## Allows changing of role in the context of the calling process. ## ## ## The process type to make an exception to the constraint. ## ## ## # define(`kernel_make_role_change_constraint_exception',` requires_block_template(`$0'_depend) typeattribute $1 can_change_process_role; ') define(`kernel_make_role_change_constraint_exception_depend',` attribute can_change_process_role; ') ######################################## ## ## ## Makes caller an exception to the constraint preventing ## changing the user identity in object contexts. ## ## ## Allows caller to change user identities on objects ## ## ## The process type to make an exception to the constraint. ## ## ## # define(`kernel_make_object_identity_change_constraint_exception',` requires_block_template(`$0'_depend) typeattribute $1 can_change_object_identity; ') define(`kernel_make_object_identity_change_constraint_exception_depend',` attribute can_change_object_identity; ') ######################################## ## ## ## ## Allows caller to load kernel modules ## ## ## Allows loading of kernel modules. ## ## ## The process type to allow to load kernel modules. ## ## ## # define(`kernel_load_module',` requires_block_template(`$0'_depend) allow $1 self:capability sys_module; typeattribute $1 can_load_kernmodule; ') define(`kernel_load_module_depend',` attribute can_load_kernmodule; class capability sys_module; ') ######################################## ## ## ## ## Allows the caller to get the mode of policy enforcement ## (enforcing or permissive mode). ## ## ## Gives caller access to system state data. ## ## ## The process type to allow to get the enforcing mode. ## ## ## # define(`kernel_get_selinux_enforcement_mode',` requires_block_template(`$0'_depend) allow $1 security_t:dir { read search getattr }; allow $1 security_t:file { getattr read }; ') define(`kernel_get_selinux_enforcement_mode_depend',` type security_t; class dir { read search getattr }; class file { getattr read }; ') ######################################## ## ## ## Allow caller to set the mode of policy enforcement ## (enforcing or permissive mode). ## ## ## Caller becomes able to disable enforcement of policy. ## ## ## The process type to allow to set the enforcement mode. ## ## ## # define(`kernel_set_selinux_enforcement_mode',` requires_block_template(`$0'_depend) allow $1 security_t:dir { read search getattr }; allow $1 security_t:file { getattr read write }; allow $1 security_t:security setenforce; auditallow $1 security_t:security setenforce; typeattribute $1 can_setenforce; ') define(`kernel_set_selinux_enforcement_mode_depend',` type security_t; attribute can_setenforce; class dir { read search getattr }; class file { getattr read write }; class security setenforce; ') ######################################## ## ## ## Allow caller to load the policy into the kernel. ## ## ## Caller can replace the policy being enforced. ## ## ## The process type that will load the policy. ## ## ## # define(`kernel_load_selinux_policy',` requires_block_template(`$0'_depend) allow $1 security_t:dir { read search getattr }; allow $1 security_t:file { getattr read write }; allow $1 security_t:security load_policy; auditallow $1 security_t:security load_policy; typeattribute $1 can_load_policy; ') define(`kernel_load_selinux_policy_depend',` type security_t; attribute can_load_policy; class dir { read search getattr }; class file { getattr read write }; class security load_policy; ') ######################################## ## ## ## Allow caller to set the state of Booleans to ## enable or disable conditional portions of the policy. ## ## ## Caller can change which of the conditional portions of ## the policy are being enforced. ## ## ## The process type allowed to set the Boolean. ## ## ## The type of Booleans the caller is allowed to set. ## ## ## # define(`kernel_set_selinux_boolean',` requires_block_template(`$0'_depend) ifelse(`$2',`',` allow $1 security_t:dir { getattr search read }; allow $1 security_t:file { getattr read write }; ',` allow $1 $2:dir { getattr search read }; allow $1 $2:file { getattr read write }; ') allow $1 security_t:dir search; allow $1 security_t:security setbool; auditallow $1 security_t:security setbool; ') define(`kernel_set_selinux_boolean_depend',` type security_t; class dir { read search getattr }; class file { getattr read write }; class security setbool; ') ######################################## ## ## ## Allow caller to set selinux security parameters. ## ## ## Caller can change security parameters. ## ## ## The process type to allow to set security parameters. ## ## ## # define(`kernel_set_selinux_security_parameters',` requires_block_template(`$0'_depend) allow $1 security_t:dir { read search getattr }; allow $1 security_t:file { getattr read write }; allow $1 security_t:security setsecparam; auditallow $1 security_t:security setsecparam; typeattribute $1 can_setsecparam; ') define(`kernel_set_selinux_security_parameters_depend',` type security_t; attribute can_setsecparam; class dir { read search getattr }; class file { getattr read write }; class security setsecparam; ') ######################################## ## ## ## Allows caller to validate security contexts. ## ## ## ## ## ## The process type permitted to validate contexts. ## ## ## # define(`kernel_validate_selinux_context',` requires_block_template(`$0'_depend) allow $1 security_t:dir { read search getattr }; allow $1 security_t:file { getattr read write }; allow $1 security_t:security check_context; ') define(`kernel_validate_selinux_context_depend',` type security_t; class dir { read search getattr }; class file { getattr read write }; class security check_context; ') ######################################## ## ## ## Allows caller to compute an access vector. ## ## ## ## ## ## The process type allowed to compute an access vector. ## ## ## # define(`kernel_compute_selinux_access_vector',` requires_block_template(`$0'_depend) allow $1 security_t:dir { read search getattr }; allow $1 security_t:file { getattr read write }; allow $1 security_t:security compute_av; ') define(`kernel_compute_selinux_access_vector_depend',` type security_t; class dir { read search getattr }; class file { getattr read write }; class security compute_av; ') ######################################## ## ## ## ## ## ## ## ## ## ## ## ## # define(`kernel_compute_selinux_create_context',` requires_block_template(`$0'_depend) allow $1 security_t:dir { read search getattr }; allow $1 security_t:file { getattr read write }; allow $1 security_t:security compute_create; ') define(`kernel_compute_selinux_create_context_depend',` type security_t; class dir { read search getattr }; class file { getattr read write }; class security compute_create; ') ######################################## ## ## ## ## ## ## ## ## ## The process type to ## ## ## # define(`kernel_compute_selinux_relabel_context',` requires_block_template(`$0'_depend) allow $1 security_t:dir { read search getattr }; allow $1 security_t:file { getattr read write }; allow $1 security_t:security compute_relabel; ') define(`kernel_compute_selinux_relabel_context_depend',` type security_t; class dir { read search getattr }; class file { getattr read write }; class security compute_relabel; ') ######################################## ## ## ## Allows caller to compute possible contexts for a user. ## ## ## ## ## ## The process type allowed to compute user contexts. ## ## ## # define(`kernel_compute_selinux_reachable_user_contexts',` requires_block_template(`$0'_depend) allow $1 security_t:dir { read search getattr }; allow $1 security_t:file { getattr read write }; allow $1 security_t:security compute_user; ') define(`kernel_compute_selinux_reachable_user_contexts_depend',` type security_t; class dir { read search getattr }; class file { getattr read write }; class security compute_user; ') ######################################## ## ## ## Allows caller to read the ring buffer. ## ## ## Buffer read could have sensitive information from multiple doamins. ## ## ## The process type allowed to read the ring buffer. ## ## ## # define(`kernel_read_ring_buffer',` requires_block_template(`$0'_depend) allow $1 kernel_t:system syslog_read; ') define(`kernel_read_ring_buffer_depend',` type kernel_t; class system syslog_read; ') ######################################## ## ## ## Ignore attempts by caller to read the ring buffer. ## ## ## Causes attepts to read potentially sensitive information ## from being audited. ## ## ## The domain to not audit. ## ## ## # define(`kernel_ignore_read_ring_buffer',` requires_block_template(`$0'_depend) dontaudit $1 kernel_t:system syslog_read; ') define(`kernel_ignore_read_ring_buffer_depend',` type kernel_t; class system syslog_read; ') ######################################## ## ## ## ## ## ## ## ## ## ## ## ## # define(`kernel_change_ring_buffer_level',` requires_block_template(`$0'_depend) allow $1 kernel_t:system syslog_console; ') define(`kernel_change_ring_buffer_level_depend',` type kernel_t; class system syslog_console; ') ######################################## ## ## ## Allows the caller to clear the ring buffer. ## ## ## ## ## ## The process type clearing the buffer. ## ## ## # define(`kernel_clear_ring_buffer',` requires_block_template(`$0'_depend) allow $1 kernel_t:system syslog_mod; ') define(`kernel_clear_ring_buffer_depend',` type kernel_t; class system syslog_mod; ') ######################################## ## ## ## Allow caller to get information about an ipc socket. ## ## ## ## ## ## ## ## ## # define(`kernel_get_sysvipc_info',` requires_block_template(`$0'_depend) allow $1 kernel_t:system ipc_info; ') define(`kernel_get_sysvipc_info_depend',` type kernel_t; class system ipc_info; ') ######################################## ## ## ## Gets the caller the mountpoint of the selinuxfs filesystem. ## ## ## ## ## ## The process type requesting the selinuxfs mountpoint. ## ## ## # define(`kernel_get_selinuxfs_mount_point',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 proc_t:{ file lnk_file } read; allow $1 self:dir search; allow $1 self:file { getattr read }; ') define(`kernel_get_selinuxfs_mount_point_depend',` type proc_t; class dir search; class lnk_file read; class file { getattr read }; ') ######################################## ## ## ## Allows caller to read system state information. ## ## ## State data contains information about multiple domains and may be privlaged. ## ## ## The process type reading the system state information. ## ## ## # define(`kernel_read_system_state',` requires_block_template(`$0'_depend) allow $1 proc_t:dir r_dir_perms; allow $1 proc_t:lnk_file { getattr read }; allow $1 proc_t:file r_file_perms; ') define(`kernel_read_system_state_depend',` type proc_t; class dir r_dir_perms; class lnk_file { getattr read }; class file r_file_perms; ') ######################################## ## ## ## Do not audit attempts by caller to ## read system state information. ## ## ## Causes attempts to read system state data not to be auditted. ## ## ## The process type not to audit. ## ## ## # define(`kernel_ignore_read_system_state',` requires_block_template(`$0'_depend) allow $1 proc_t:file read; ') define(`kernel_ignore_read_system_state_depend',` type proc_t; class file read; ') ####################################### ## ## ## Allow caller to read the state information for software raid. ## ## ## ## ## ## The process type reading software raid state. ## ## ## # define(`kernel_read_software_raid_state',` requires_block_template(`$0'_depend) allow $1 proc_t:dir { getattr search read }; allow $1 proc_mdstat_t:file { getattr read }; ') define(`kernel_read_software_raid_state_depend',` type proc_t, proc_mdstat_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Allows caller to get attribues of core kernel interfaces. ## ## ## ## ## ## The process type getting the attibutes. ## ## ## # define(`kernel_get_core_interface_attributes',` requires_block_template(`$0'_depend) allow $1 proc_t:dir { getattr search read }; allow $1 proc_kcore_t:file getattr; ') define(`kernel_get_core_interface_attributes_depend',` type proc_t, proc_kcore_t; class dir { search getattr read }; class file getattr; ') ######################################## ## ## ## Do not audit attempts to get the attributes of ## core kernel interfaces. ## ## ## Causes attempts to get attributes of kernel interfaces to ## not be auditted. ## ## ## The process type to not audit. ## ## ## # define(`kernel_ignore_get_core_interface_attributes',` requires_block_template(`$0'_depend) dontaudit $1 proc_kcore_t:file getattr; ') define(`kernel_ignore_get_core_interface_attributes_depend',` type proc_kcore_t; class file getattr; ') ######################################## ## ## ## Allow caller to receive and read kernel messages. ## ## ## ## ## ## The process type reading the messages. ## ## ## # define(`kernel_read_messages',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 proc_kmsg_t:file { getattr read }; typeattribute $1 can_receive_kernel_messages; ') define(`kernel_read_messages_depend',` attribute can_receive_kernel_messages; type proc_kmsg_t, proc_t; class dir search; class file { getattr read }; ') ######################################## ## ## ## Allow caller to get the attributes of kernel message ## interfaces. ## ## ## ## ## ## The process type getting the attributes. ## ## ## # define(`kernel_get_message_interface_attributes',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 proc_kmsg_t:file getattr; ') define(`kernel_get_message_interface_attributes_depend',` type proc_kmsg_t, proc_t; class dir search; class file getattr; ') ######################################## ## ## ## Do not audit attempts by caller to get the attributes of kernel ## message interfaces. ## ## ## Causes attempts by caller to get the attributes of kernel ## message interfaces not to be auditted. ## ## ## The process type not to audit. ## ## ## # define(`kernel_ignore_get_message_interface_attributes',` requires_block_template(`$0'_depend) dontaudit $1 proc_kmsg_t:file getattr; ') define(`kernel_ignore_get_message_interface_attributes_depend',` type proc_kmsg_t, proc_t; class file getattr; ') ######################################## ## ## ## Allow caller to read the network state information. ## ## ## ## ## ## The process type reading the state. ## ## ## ## # define(`kernel_read_network_state',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 proc_net_t:dir { getattr search read }; allow $1 proc_net_t:file { getattr read }; ') define(`kernel_read_network_state_depend',` type proc_t, proc_net_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Do not audit attempts by caller to search the sysctl directory. ## ## ## Causes attempts by caller to search the sysctl directy not to be auditted. ## ## ## The process type not to audit. ## ## ## ## # define(`kernel_ignore_search_sysctl_dir',` requires_block_template(`$0'_depend) dontaudit $1 sysctl_t:dir search; ') define(`kernel_ignore_search_sysctl_dir_depend',` type sysctl_t; class dir search; ') ######################################## ## ## ## Allow caller to read the sysctl device. ## ## ## ## ## ## The process type to allow to read the sysctl device. ## ## ## # define(`kernel_read_device_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_dev_t:dir { getattr search read }; allow $1 sysctl_dev_t:file { getattr read }; ') define(`kernel_read_device_sysctl_depend',` type proc_t, sysctl_t, sysctl_dev_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Allows the caller to modify the sysctl device file. ## ## ## ## ## ## The process type modifying the sysctl device. ## ## ## # define(`kernel_modify_device_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_dev_t:file { getattr read write }; ') define(`kernel_modify_device_sysctl_depend',` type proc_t, sysctl_t, sysctl_dev_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## ## ## ## Allow caller to read sysctl virtual memory. ## ## ## ## ## ## ## ## ## ## # define(`kernel_read_virtual_memory_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_vm_t:file { getattr read }; ') define(`kernel_read_virtual_memory_sysctl_depend',` type proc_t, sysctl_t, sysctl_vm_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Allow caller to modify contents of sysctl virtual memory. ## ## ## Allows caller to modify sysctl virtual memory. ## ## ## The process type modifying sysctl virtual memory. ## ## ## # define(`kernel_modify_virtual_memory_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_vm_t:file { getattr read write }; ') define(`kernel_modify_virtual_memory_sysctl_depend',` type proc_t, sysctl_t, sysctl_vm_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## ## ## ## Do not audit attempts by caller to search sysctl network directories. ## ## ## Causes attempts by the caller to search the sysctl network ## directories not to be audited. ## ## ## The process type not to audit. ## ## ## # define(`kernel_ignore_search_network_sysctl_dir',` requires_block_template(`$0'_depend) dontaudit $1 sysctl_net_t:dir search; ') define(`kernel_ignore_search_network_sysctl_dir_depend',` type sysctl_net_t; class dir search; ') ######################################## ## ## ## Allow caller to read sysctl network files. ## ## ## ## ## ## The process type reading sysctl network files. ## ## ## ## # define(`kernel_read_network_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_net_t:dir { getattr search read }; allow $1 sysctl_net_t:file { getattr read }; ') define(`kernel_read_network_sysctl_depend',` type proc_t, sysctl_t, sysctl_net_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Allow caller to modiry contents of sysctl network files. ## ## ## ## ## ## The process type modifying sysctl network files. ## ## ## # define(`kernel_modify_network_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_net_t:dir { getattr search read }; allow $1 sysctl_net_t:file { getattr read write }; ') define(`kernel_modify_network_sysctl_depend',` type proc_t, sysctl_t, sysctl_net_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## ## ## ## Allow caller to read unix sysctl files. ## ## ## ## ## ## The process type reading unix sysctl files. ## ## ## # define(`kernel_read_unix_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_net_t:dir { getattr search read }; allow $1 sysctl_net_unix_t:file { getattr read }; ') define(`kernel_read_net_sysctl_depend',` type proc_t, sysctl_t, sysctl_net_t, sysctl_net_unix_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Allow caller to modify contents of unix sysctl files. ## ## ## ## ## ## The process type modifying contents of unix sysctl files. ## ## ## # define(`kernel_modify_unix_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_net_t:dir { getattr search read }; allow $1 sysctl_net_unix_t:file { getattr read write }; ') define(`kernel_modify_net_sysctl_depend',` type proc_t, sysctl_t, sysctl_net_t, sysctl_net_unix_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## ## ## ## Allow caller to read data from hotplug. ## ## ## ## ## ## The process type reading hotplug data. ## ## ## # define(`kernel_read_hotplug_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_kernel_t:dir { getattr search read }; allow $1 sysctl_hotplug_t:file { getattr read }; ') define(`kernel_read_hotplug_sysctl_depend',` type proc_t, sysctl_t, sysctl_kernel_t, sysctl_hotplug_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Allow caller to modify hotplug sysctl data. ## ## ## ## ## ## The process type modifying hotplug sysctl data. ## ## ## # define(`kernel_modify_hotplug_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_kernel_t:dir { getattr search read }; allow $1 sysctl_hotplug_t:file { getattr read write }; ') define(`kernel_modify_hotplug_sysctl_depend',` type proc_t, sysctl_t, sysctl_kernel_t, sysctl_hotplug_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## ## ## ## Allow caller to read files containing modprobe information. ## ## ## ## ## ## The process domian reading modprobe information files. ## ## ## # define(`kernel_read_modprobe_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_kernel_t:dir { getattr search read }; allow $1 sysctl_modprobe_t:file { getattr read }; ') define(`kernel_read_modprobe_sysctl_depend',` type proc_t, sysctl_t, sysctl_kernel_t, sysctl_modprobe_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Allow caller to modify files containing modprobe information. ## ## ## ## ## ## The process domian modifying modprobe information files. ## ## ## # define(`kernel_modify_modprobe_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_kernel_t:dir { getattr search read }; allow $1 sysctl_modprobe_t:file { getattr read write }; ') define(`kernel_modify_modprobe_sysctl_depend',` type proc_t, sysctl_t, sysctl_kernel_t, sysctl_modprobe_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## ## ## ## Allow caller to read kernel sysctl files. ## ## ## ## ## ## The process type reading kernel sysctl files. ## ## ## # define(`kernel_read_kernel_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_kernel_t:dir { getattr search read }; allow $1 sysctl_kernel_t:file { getattr read }; ') define(`kernel_read_kernel_sysctl_depend',` type proc_t, sysctl_t, sysctl_kernel_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Allow caller to modify kernel sysctl files. ## ## ## ## ## ## The process type modifying kernel sysctl files. ## ## ## # define(`kernel_modify_kernel_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_kernel_t:dir { getattr search read }; allow $1 sysctl_kernel_t:file { getattr read write }; ') define(`kernel_modify_kernel_sysctl_depend',` type proc_t, sysctl_t, sysctl_kernel_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## ## ## ## Allow caller to read filesystem information. ## ## ## ## ## ## The process type reading filesystem information. ## ## ## # define(`kernel_read_filesystem_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_fs_t:dir { getattr search read }; allow $1 sysctl_fs_t:file { getattr read }; ') define(`kernel_read_filesystem_sysctl_depend',` type proc_t, sysctl_t, sysctl_fs_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## # # kernel_modify_filesystem_sysctl(domain) ## ## ## Allow caller to modify filesystem information. ## ## ## ## ## ## The process type modifying filesystem information. ## ## ## # define(`kernel_modify_filesystem_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_t:dir { getattr search read }; allow $1 sysctl_fs_t:dir { getattr search read }; allow $1 sysctl_fs_t:file { getattr read write }; ') define(`kernel_modify_filesystem_sysctl_depend',` type proc_t, sysctl_t, sysctl_fs_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## ## ## ## Allows caller to read interrupt request information. ## ## ## ## ## ## The process type reading interrupt request information. ## ## ## # define(`kernel_read_irq_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_irq_t:dir { getattr search read }; allow $1 sysctl_irq_t:file { getattr read }; ') define(`kernel_read_irq_sysctl_depend',` type proc_t, sysctl_irq_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## ## ## ## Allows caller to modify interrupt request information. ## ## ## ## ## ## The process type modifying interrupt request information. ## ## ## ## # define(`kernel_modify_irq_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 sysctl_irq_t:dir { getattr search read }; allow $1 sysctl_irq_t:file { getattr read write }; ') define(`kernel_modify_irq_sysctl_depend',` type proc_t, sysctl_irq_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## # # kernel_read_rpc_sysctl(domain) # define(`kernel_read_rpc_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 proc_net_t:dir search; allow $1 sysctl_rpc_t:dir { getattr search read }; allow $1 sysctl_rpc_t:file { getattr read }; ') define(`kernel_read_rpc_sysctl_depend',` type proc_t, proc_net_t, sysctl_rpc_t; class dir { search getattr read }; class file { getattr read }; ') ######################################## # # kernel_modify_rpc_sysctl(domain) # define(`kernel_modify_rpc_sysctl',` requires_block_template(`$0'_depend) allow $1 proc_t:dir search; allow $1 proc_net_t:dir search; allow $1 sysctl_rpc_t:dir { getattr search read }; allow $1 sysctl_rpc_t:file { getattr read write }; ') define(`kernel_modify_rpc_sysctl_depend',` type proc_t, proc_net_t, sysctl_rpc_t; class dir { search getattr read }; class file { getattr read write }; ') ######################################## ## ## ## Allow caller to read all sysctl information. ## ## ## ## ## ## The process type reading the information. ## ## ## # define(`kernel_read_all_sysctl',` kernel_read_device_sysctl($1) kernel_read_virtual_memory_sysctl($1) kernel_read_network_sysctl($1) kernel_read_unix_sysctl($1) kernel_read_hotplug_sysctl($1) kernel_read_modprobe_sysctl($1) kernel_read_kernel_sysctl($1) kernel_read_filesystem_sysctl($1) kernel_read_irq_sysctl($1) kernel_read_rpc_sysctl($1) ') ######################################## ## ## ## Allow caller to modify all sysctl information. ## ## ## ## ## ## The process type modifying the information. ## ## ## # define(`kernel_modify_all_sysctl',` kernel_modify_device_sysctl($1) kernel_modify_virtual_memory_sysctl($1) kernel_modify_network_sysctl($1) kernel_modify_unix_sysctl($1) kernel_modify_hotplug_sysctl($1) kernel_modify_modprobe_sysctl($1) kernel_modify_kernel_sysctl($1) kernel_modify_filesystem_sysctl($1) kernel_modify_irq_sysctl($1) kernel_modify_rpc_sysctl($1) ') ######################################## ## ## ## Search the directory containing hardware information. ## ## ## The type of the process performing this action. ## ## ## # define(`kernel_search_hardware_state_dir',` requires_block_template(`$0'_depend) allow $1 sysfs_t:dir search; ') define(`kernel_search_hardware_state_dir_depend',` type sysfs_t; class dir search; ') ######################################## ## ## ## Allow caller to read hardware state information. ## ## ## ## ## ## The process type reading hardware state information. ## ## ## # define(`kernel_read_hardware_state',` requires_block_template(`$0'_depend) allow $1 sysfs_t:dir { getattr search read }; allow $1 sysfs_t:{ file lnk_file } { getattr read }; ') define(`kernel_read_hardware_state_depend',` type sysfs_t; class dir { getattr search read }; class file { getattr read }; class lnk_file { getattr read }; ') ######################################## ## ## ## Allow caller to modify hardware state information. ## ## ## ## ## ## The process type modifying hardware state information. ## ## ## # define(`kernel_modify_hardware_config_option',` requires_block_template(`$0'_depend) allow $1 sysfs_t:dir { getattr search read }; allow $1 sysfs_t:lnk_file { getattr read }; allow $1 sysfs_t:file { getattr read write }; ') define(`kernel_modify_hardware_config_option_depend',` type sysfs_t; class dir { getattr search read }; class file { getattr read write }; class lnk_file { getattr read }; ') ######################################## ## ## ## Send a kill signal to unlabeled processes. ## ## ## The type of the process performing this action. ## ## ## # define(`kernel_kill_unlabeled_process',` requires_block_template(`$0'_depend) allow $1 unlabeled_t:process sigkill; ') define(`kernel_kill_unlabeled_process_depend',` type unlabeled_t; class process sigkill; ') ######################################## ## ## ## Send general signals to unlabeled processes. ## ## ## The type of the process performing this action. ## ## ## # define(`kernel_signal_unlabeled_process',` requires_block_template(`$0'_depend) allow $1 unlabeled_t:process signal; ') define(`kernel_signal_unlabeled_process_depend',` type unlabeled_t; class process signal; ') ######################################## ## ## ## Send a null signal to unlabeled processes. ## ## ## The type of the process performing this action. ## ## ## # define(`kernel_signull_unlabeled_process',` requires_block_template(`$0'_depend) allow $1 unlabeled_t:process signull; ') define(`kernel_signull_unlabeled_process_depend',` type unlabeled_t; class process signull; ') ######################################## ## ## ## Send a stop signal to unlabeled processes. ## ## ## The type of the process performing this action. ## ## ## # define(`kernel_sigstop_unlabeled_process',` requires_block_template(`$0'_depend) allow $1 unlabeled_t:process sigstop; ') define(`kernel_sigstop_unlabeled_process_depend',` type unlabeled_t; class process sigstop; ') ######################################## ## ## ## Send a child terminated signal to unlabeled processes. ## ## ## The type of the process performing this action. ## ## ## # define(`kernel_sigchld_unlabeled_process',` requires_block_template(`$0'_depend) allow $1 unlabeled_t:process sigchld; ') define(`kernel_sigchld_unlabeled_process_depend',` type unlabeled_t; class process sigchld; ') ######################################## ## ## ## Do not audit attempts by caller to get attributes for ## unlabeled block devices. ## ## ## Causes attempts by caller to get attributes on unlabeled ## block devices to not be auditted. ## ## ## The process type not to audit. ## ## ## # define(`kernel_ignore_get_unlabeled_block_device_attributes',` requires_block_template(`$0'_depend) allow $1 unlabeled_t:blk_file getattr; ') define(`kernel_ignore_get_unlabeled_block_device_attributes_depend',` type unlabeled_t; class process getattr; ') ######################################## ## ## ## Allow caller to relabel unlabeled objects. ## ## ## ## ## ## The process type relabeling the objects. ## ## ## # define(`kernel_relabel_unlabeled_object',` requires_block_template(`$0'_depend) allow $1 unlabeled_t:{ dir file lnk_file fifo_file sock_file chr_file blk_file } { getattr relabelfrom }; ') define(`kernel_relabel_unlabeled_object_depend',` type unlabeled_t; class dir { getattr relabelfrom }; class file { getattr relabelfrom }; class lnk_file { getattr relabelfrom }; class fifo_file { getattr relabelfrom }; class sock_file { getattr relabelfrom }; class chr_file { getattr relabelfrom }; class blk_file { getattr relabelfrom }; ') ######################################## ## ## ## Search the directory containing USB hardware information. ## ## ## The type of the process performing this action. ## ## ## # define(`kernel_search_usb_hardware_state_dir',` requires_block_template(`$0'_depend) allow $1 usbfs_t:dir search; ') define(`kernel_search_usb_hardware_state_dir_depend',` type usbfs_t; class dir search; ') ######################################## ## ## ## Allow caller to get a list of usb hardware. ## ## ## ## ## ## The process type getting the list. ## ## ## # define(`kernel_list_usb_hardware',` requires_block_template(`$0'_depend) allow $1 usbfs_t:dir { getattr search read }; allow $1 usbfs_t:lnk_file { getattr read }; allow $1 usbfs_t:file getattr; ') define(`kernel_list_usb_hardware_depend',` type usbfs_t; class dir { getattr search read }; class file getattr; class lnk_file { getattr read }; ') ######################################## ## ## ## Read USB hardware information using ## the usbfs filesystem interface. ## ## ## The type of the process performing this action. ## ## ## # define(`kernel_read_usb_hardware_state',` requires_block_template(`$0'_depend) allow $1 usbfs_t:dir { getattr search read }; allow $1 usbfs_t:{ file lnk_file } { getattr read }; ') define(`kernel_read_usb_hardware_state_depend',` type usbfs_t; class dir { getattr search read }; class file { getattr read }; class lnk_file { getattr read }; ') ######################################## ## ## ## Allow caller to modify usb hardware configuration files. ## ## ## ## ## ## The process type modifying the options. ## ## ## # define(`kernel_modify_usb_hardware_config_option',` requires_block_template(`$0'_depend) allow $1 usbfs_t:dir { getattr search read }; allow $1 usbfs_t:lnk_file { getattr read }; allow $1 usbfs_t:file { getattr read write }; ') define(`kernel_modify_usb_hardware_config_option_depend',` type usbfs_t; class dir { getattr search read }; class file { getattr read write }; class lnk_file { getattr read }; ') ################################################################### # # # These interfaces are reversed, to decouple the base module from # # the programs that the kernel runs, such as init and insmod, so # # the base module is self-contained. These styles of interfaces # # should not be used anywhere else. # # # ################################################################### ######################################## ## ## ## Receive sigchild from kernel. ## ## ## ## ## ## The process type receiving the signal. ## ## ## # define(`kernel_sigchld_from',` requires_block_template(`$0'_depend) allow kernel_t $1:process sigchld; ') define(`kernel_sigchld_from_depend',` type kernel_t; class process sigchld; ') ######################################## ## ## ## Receive sigchld from unlabeled processes. ## ## ## ## ## ## The process type receiving the signal. ## ## ## # define(`kernel_unlabeled_sigchld_from',` requires_block_template(`$0'_depend) allow unlabeled_t $1:process sigchld; ') define(`kernel_unlabeled_sigchld_from_depend',` type unlabeled_t; class process sigchld; ') ######################################## ## ## ## XXX FIXME ## ## ## ## ## ## ## ## ## # define(`kernel_read_directory_from',` requires_block_template(`$0'_depend) allow kernel_t $1:dir { getattr search read }; ') define(`kernel_read_directory_from_depend',` type kernel_t; class dir { getattr search read }; ') ##