selinux-policy/refpolicy/policy/modules/kernel/kernel.if

1322 lines
34 KiB
Plaintext
Raw Normal View History

2005-04-20 19:07:16 +00:00
# Copyright (C) 2005 Tresys Technology, LLC
########################################
#
# kernel_make_userland_entrypoint(domain,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;
2005-05-30 21:17:20 +00:00
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;
')
2005-04-14 20:18:17 +00:00
########################################
#
# kernel_share_state(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_share_state',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow kernel_t $1:process share;
')
define(`kernel_share_state_depend',`
type kernel_t;
class process share;
')
########################################
#
# kernel_use_file_descriptors(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_use_file_descriptors',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 kernel_t:fd use;
')
define(`kernel_use_file_descriptors_depend',`
2005-04-14 20:18:17 +00:00
type kernel_t;
2005-04-28 21:41:09 +00:00
class fd use;
')
########################################
#
# kernel_ignore_use_file_descriptors(domain)
2005-04-28 21:41:09 +00:00
#
define(`kernel_ignore_use_file_descriptors',`
requires_block_template(`$0'_depend)
2005-04-28 21:41:09 +00:00
dontaudit $1 kernel_t:fd use;
')
define(`kernel_ignore_use_file_descriptors_depend',`
type kernel_t;
2005-04-14 20:18:17 +00:00
class fd use;
')
########################################
#
# kernel_make_root_filesystem_mountpoint(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_make_root_filesystem_mountpoint',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow kernel_t $1:dir mounton;
')
define(`kernel_make_root_filesystem_mountpoint_depend',`
type kernel_t;
class dir mounton;
')
########################################
#
# kernel_make_process_identity_change_constraint_exception(domain)
#
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;
')
########################################
#
# kernel_make_role_change_constraint_exception(domain)
#
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;
')
########################################
#
# kernel_make_object_identity_change_constraint_exception(domain)
#
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;
')
2005-04-14 20:18:17 +00:00
########################################
#
# kernel_load_module(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_load_module',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 self:capability sys_module;
typeattribute $1 can_load_kernmodule;
')
define(`kernel_load_module_depend',`
attribute can_load_kernmodule;
class capability sys_module;
')
########################################
#
# kernel_get_selinux_enforcement_mode(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_get_selinux_enforcement_mode',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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 };
')
########################################
#
# kernel_set_selinux_enforcement_mode(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_set_selinux_enforcement_mode',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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;
')
########################################
#
# kernel_load_selinux_policy(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_load_selinux_policy',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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;
')
########################################
#
# kernel_set_selinux_boolean(domain,[booltype])
2005-04-14 20:18:17 +00:00
#
define(`kernel_set_selinux_boolean',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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;
')
########################################
#
# kernel_set_selinux_security_parameters(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_set_selinux_security_parameters',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type security_t;
attribute can_setsecparam;
class dir { read search getattr };
class file { getattr read write };
class security setsecparam;
')
########################################
#
# kernel_validate_selinux_context(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_validate_selinux_context',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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;
')
########################################
#
# kernel_compute_selinux_access_vector(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_compute_selinux_access_vector',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type security_t;
class dir { read search getattr };
class file { getattr read write };
class security compute_av;
')
########################################
#
# kernel_compute_selinux_create_context(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_compute_selinux_create_context',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type security_t;
class dir { read search getattr };
class file { getattr read write };
class security compute_create;
')
########################################
#
# kernel_compute_selinux_relabel_context(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_compute_selinux_relabel_context',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type security_t;
class dir { read search getattr };
class file { getattr read write };
class security compute_relabel;
')
########################################
#
# kernel_compute_selinux_reachable_user_contexts(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_compute_selinux_reachable_user_contexts',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type security_t;
class dir { read search getattr };
class file { getattr read write };
class security compute_user;
')
########################################
#
# kernel_read_ring_buffer(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_ring_buffer',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 kernel_t:system syslog_read;
')
define(`kernel_read_ring_buffer_depend',`
type kernel_t;
class system syslog_read;
')
########################################
#
# kernel_ignore_read_ring_buffer(domain)
#
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;
')
2005-04-14 20:18:17 +00:00
########################################
#
# kernel_change_ring_buffer_level(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_change_ring_buffer_level',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 kernel_t:system syslog_console;
')
define(`kernel_change_ring_buffer_level_depend',`
type kernel_t;
class system syslog_console;
')
########################################
#
# kernel_clear_ring_buffer(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_clear_ring_buffer',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 kernel_t:system syslog_mod;
')
define(`kernel_clear_ring_buffer_depend',`
type kernel_t;
class system syslog_mod;
')
########################################
#
# kernel_get_sysvipc_info(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_get_sysvipc_info',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 kernel_t:system ipc_info;
')
define(`kernel_get_sysvipc_info_depend',`
type kernel_t;
class system ipc_info;
')
########################################
#
# kernel_get_selinuxfs_mount_point(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_get_selinuxfs_mount_point',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 proc_t:dir search;
allow $1 proc_t:{ file lnk_file } read;
2005-04-14 20:18:17 +00:00
allow $1 self:dir search;
allow $1 self:file { getattr read };
')
define(`kernel_get_selinuxfs_mount_point_depend',`
2005-04-14 20:18:17 +00:00
type proc_t;
class dir search;
class lnk_file read;
class file { getattr read };
')
########################################
#
# kernel_read_system_state(domain)
2005-04-14 20:18:17 +00:00
#
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;
2005-04-14 20:18:17 +00:00
')
define(`kernel_read_system_state_depend',`
2005-04-14 20:18:17 +00:00
type proc_t;
class dir r_dir_perms;
2005-04-14 20:18:17 +00:00
class lnk_file { getattr read };
class file r_file_perms;
2005-04-14 20:18:17 +00:00
')
2005-05-02 18:42:33 +00:00
########################################
#
# kernel_ignore_read_system_state(domain)
#
define(`kernel_ignore_read_system_state',`
requires_block_template(`$0'_depend)
2005-05-02 18:42:33 +00:00
allow $1 proc_t:file read;
')
define(`kernel_ignore_read_system_state_depend',`
2005-05-02 18:42:33 +00:00
type proc_t;
class file read;
')
2005-04-14 20:18:17 +00:00
#######################################
#
# kernel_read_software_raid_state(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_software_raid_state',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 proc_t:dir { getattr search read };
allow $1 proc_mdstat_t:file { getattr read };
')
define(`kernel_read_software_raid_state_depend',`
2005-04-14 20:18:17 +00:00
type proc_t, proc_mdstat_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_get_core_interface_attributes(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_get_core_interface_attributes',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 proc_t:dir { getattr search read };
allow $1 proc_kcore_t:file getattr;
')
define(`kernel_get_core_interface_attributes_depend',`
2005-04-14 20:18:17 +00:00
type proc_t, proc_kcore_t;
class dir { search getattr read };
class file getattr;
')
2005-05-13 14:37:13 +00:00
########################################
#
# kernel_ignore_get_core_interface_attributes(domain)
#
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;
')
########################################
#
# kernel_read_messages(domain)
#
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 };
')
########################################
#
# kernel_get_message_interface_attributes(domain)
#
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;
')
2005-04-14 20:18:17 +00:00
########################################
#
# kernel_ignore_get_message_interface_attributes(domain)
#
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;
')
########################################
2005-04-14 20:18:17 +00:00
#
# kernel_read_network_state(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_network_state',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, proc_net_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_ignore_search_sysctl_dir(domain)
#
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;
')
2005-04-14 20:18:17 +00:00
########################################
#
# kernel_read_device_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_device_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow $1 proc_t:dir search;
allow $1 sysctl_t:dir { getattr search read };
2005-04-28 15:52:42 +00:00
allow $1 sysctl_dev_t:dir { getattr search read };
2005-04-14 20:18:17 +00:00
allow $1 sysctl_dev_t:file { getattr read };
')
define(`kernel_read_device_sysctl_depend',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_dev_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_device_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_device_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_dev_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_read_virtual_memory_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_virtual_memory_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_vm_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_virtual_memory_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_virtual_memory_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_vm_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_ignore_search_network_sysctl_dir(domain)
#
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;
')
2005-04-14 20:18:17 +00:00
########################################
#
# kernel_read_network_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_network_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_net_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_network_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_network_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_net_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_read_unix_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_unix_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_net_t, sysctl_net_unix_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_unix_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_unix_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_net_t, sysctl_net_unix_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_read_hotplug_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_hotplug_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_kernel_t, sysctl_hotplug_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_hotplug_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_hotplug_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_kernel_t, sysctl_hotplug_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_read_modprobe_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_modprobe_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_kernel_t, sysctl_modprobe_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_modprobe_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_modprobe_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_kernel_t, sysctl_modprobe_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_read_kernel_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_kernel_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_kernel_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_kernel_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_kernel_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_kernel_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_read_filesystem_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_filesystem_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_fs_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_filesystem_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_filesystem_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_t, sysctl_fs_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_read_irq_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_irq_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_irq_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_irq_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_irq_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, sysctl_irq_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_read_rpc_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_rpc_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, proc_net_t, sysctl_rpc_t;
class dir { search getattr read };
class file { getattr read };
')
########################################
#
# kernel_modify_rpc_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_rpc_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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',`
2005-04-14 20:18:17 +00:00
type proc_t, proc_net_t, sysctl_rpc_t;
class dir { search getattr read };
class file { getattr read write };
')
########################################
#
# kernel_read_all_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_all_sysctl',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
kernel_read_device_sysctl($1,optional)
kernel_read_virtual_memory_sysctl($1,optional)
kernel_read_network_sysctl($1,optional)
kernel_read_unix_sysctl($1,optional)
kernel_read_hotplug_sysctl($1,optional)
kernel_read_modprobe_sysctl($1,optional)
kernel_read_kernel_sysctl($1,optional)
kernel_read_filesystem_sysctl($1,optional)
kernel_read_irq_sysctl($1,optional)
kernel_read_rpc_sysctl($1,optional)
')
define(`kernel_read_all_sysctl_depend',`
2005-04-14 20:18:17 +00:00
kernel_read_device_sysctl_depend
kernel_read_virtual_memory_sysctl_depend
kernel_read_network_sysctl_depend
kernel_read_unix_sysctl_depend
kernel_read_hotplug_sysctl_depend
kernel_read_modprobe_sysctl_depend
kernel_read_kernel_sysctl_depend
kernel_read_filesystem_sysctl_depend
kernel_read_irq_sysctl_depend
kernel_read_rpc_sysctl_depend
')
########################################
#
# kernel_modify_all_sysctl(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_all_sysctl',`
2005-05-30 21:17:20 +00:00
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)
')
########################################
## <interface name="kernel_search_hardware_state_dir">
## <description>
## Search the directory containing hardware information.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <infoflow type="read" weight="10"/>
## </interface>
#
define(`kernel_search_hardware_state_dir',`
requires_block_template(`$0'_depend)
2005-05-30 21:17:20 +00:00
allow $1 sysfs_t:dir search;
2005-04-14 20:18:17 +00:00
')
2005-05-30 21:17:20 +00:00
define(`kernel_search_hardware_state_dir_depend',`
type sysfs_t;
class dir search;
2005-04-14 20:18:17 +00:00
')
########################################
#
# kernel_read_hardware_state(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_hardware_state',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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 };
')
########################################
#
# kernel_modify_hardware_config_option(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_hardware_config_option',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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 };
')
2005-05-27 20:44:05 +00:00
########################################
## <interface name="kernel_kill_unlabeled_process">
## <description>
## Send a kill signal to unlabeled processes.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <infoflow type="write" weight="1"/>
## </interface>
#
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;
')
########################################
## <interface name="kernel_signal_unlabeled_process">
## <description>
## Send general signals to unlabeled processes.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <infoflow type="write" weight="1"/>
## </interface>
#
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;
')
########################################
## <interface name="kernel_signull_unlabeled_process">
## <description>
## Send a null signal to unlabeled processes.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <infoflow type="write" weight="1"/>
## </interface>
#
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;
')
########################################
## <interface name="kernel_sigstop_unlabeled_process">
## <description>
## Send a stop signal to unlabeled processes.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <infoflow type="write" weight="1"/>
## </interface>
#
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;
')
########################################
## <interface name="kernel_sigchld_unlabeled_process">
## <description>
## Send a child terminated signal to unlabeled processes.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <infoflow type="write" weight="1"/>
## </interface>
#
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;
')
########################################
#
# kernel_ignore_get_unlabeled_block_device_attributes(domain)
#
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;
')
########################################
#
# kernel_relabel_unlabeled_object(domain)
#
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 };
')
2005-05-30 21:17:20 +00:00
########################################
## <interface name="kernel_search_usb_hardware_state_dir">
## <description>
## Search the directory containing USB hardware information.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <infoflow type="read" weight="10"/>
## </interface>
#
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;
')
2005-04-14 20:18:17 +00:00
########################################
#
# kernel_list_usb_hardware(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_list_usb_hardware',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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 };
')
########################################
## <interface name="kernel_read_usb_hardware_state">
## <description>
## Read USB hardware information using
## the usbfs filesystem interface.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <infoflow type="read" weight="10"/>
## </interface>
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_usb_hardware_state',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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 };
')
########################################
#
# kernel_modify_usb_hardware_config_option(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_modify_usb_hardware_config_option',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
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. #
# #
###################################################################
########################################
#
# kernel_sigchld_from(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_sigchld_from',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow kernel_t $1:process sigchld;
')
define(`kernel_sigchld_from_depend',`
type kernel_t;
class process sigchld;
')
########################################
#
# kernel_unlabeled_sigchld_from(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_unlabeled_sigchld_from',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow unlabeled_t $1:process sigchld;
')
define(`kernel_unlabeled_sigchld_from_depend',`
type unlabeled_t;
class process sigchld;
')
########################################
#
# kernel_read_directory_from(domain)
2005-04-14 20:18:17 +00:00
#
define(`kernel_read_directory_from',`
requires_block_template(`$0'_depend)
2005-04-14 20:18:17 +00:00
allow kernel_t $1:dir { getattr search read };
')
define(`kernel_read_directory_from_depend',`
type kernel_t;
class dir { getattr search read };
')