Chris PeBenito e181fe
# Copyright (C) 2005 Tresys Technology, LLC
Chris PeBenito 162a57
## <module name="modutils" layer="system">
Chris PeBenito 162a57
## <summary>Policy for kernel module utilities</summary>
Chris PeBenito e181fe
Chris PeBenito b4cd15
########################################
Chris PeBenito daa0e0
## <interface name="modutils_read_kernel_module_dependencies">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Read the dependencies of kernel modules.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<infoflow type="read" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`modutils_read_kernel_module_dependencies',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 5f75f5
bootloader_list_kernel_modules($1,optional)
Chris PeBenito b4cd15
allow $1 modules_dep_t:file { getattr read };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`modutils_read_kernel_module_dependencies_depend',`
Chris PeBenito 5f75f5
type modules_dep_t;
Chris PeBenito b4cd15
class file { getattr create read write setattr unlink };
Chris PeBenito b4cd15
class dir { search read write add_name remove_name };
Chris PeBenito 5f75f5
bootloader_list_kernel_modules_depend
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito daa0e0
## <interface name="modutils_read_kernel_module_loading_config">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Read the configuration options used when
Chris PeBenito daa0e0
##		loading modules.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<infoflow type="read" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`modutils_read_kernel_module_loading_config',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito b4cd15
allow $1 modules_conf_t:file { getattr read };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`modutils_read_kernel_module_loading_config_depend',`
Chris PeBenito b4cd15
type modules_conf_t;
Chris PeBenito b4cd15
class file { getattr create read write setattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito daa0e0
## <interface name="modutils_insmod_transition">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute insmod in the insmod domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`modutils_insmod_transition',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito b4cd15
allow $1 insmod_exec_t:file { getattr read execute };
Chris PeBenito b4cd15
allow $1 insmod_t:process transition;
Chris PeBenito e7fcdc
type_transition $1 insmod_exec_t:process insmod_t;
Chris PeBenito b4cd15
dontaudit $1 insmod_t:process { noatsecure siginh rlimitinh };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`modutils_insmod_transition_depend',`
Chris PeBenito b4cd15
type insmod_t;
Chris PeBenito b4cd15
class file { getattr read execute };
Chris PeBenito b4cd15
class process { transition noatsecure siginh rlimitinh };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito daa0e0
## <interface name="modutils_insmod_transition_add_role_use_terminal">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute insmod in the insmod domain, and
Chris PeBenito daa0e0
##		allow the specified role the insmod domain,
Chris PeBenito daa0e0
##		and use the caller's terminal.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the insmod domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the insmod domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito daa0e0
define(`modutils_insmod_transition_add_role_use_terminal',`
Chris PeBenito daa0e0
requires_block_template(`$0'_depend)
Chris PeBenito daa0e0
modutils_insmod_transition($1)
Chris PeBenito daa0e0
role $2 types insmod_t;
Chris PeBenito daa0e0
allow insmod_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
define(`modutils_insmod_transition_add_role_use_terminal_depend',`
Chris PeBenito daa0e0
type insmod_t;
Chris PeBenito daa0e0
class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# modutils_insmod_execute(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`modutils_insmod_execute',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito b4cd15
allow $1 insmod_exec_t:file { getattr read execute execute_no_trans };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`modutils_insmod_execute_depend',`
Chris PeBenito b4cd15
type insmod_t;
Chris PeBenito b4cd15
class file { getattr read execute execute_no_trans };
Chris PeBenito b4cd15
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito daa0e0
## <interface name="modutils_depmod_transition">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute depmod in the depmod domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 9eb5e8
#
Chris PeBenito 9eb5e8
define(`modutils_depmod_transition',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 9eb5e8
allow $1 depmod_exec_t:file { getattr read execute };
Chris PeBenito 9eb5e8
allow $1 depmod_t:process transition;
Chris PeBenito e7fcdc
type_transition $1 depmod_exec_t:process depmod_t;
Chris PeBenito 9eb5e8
dontaudit $1 depmod_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
define(`modutils_depmod_transition_depend',`
Chris PeBenito 9eb5e8
type depmod_t;
Chris PeBenito 9eb5e8
class file { getattr read execute };
Chris PeBenito 9eb5e8
class process { transition noatsecure siginh rlimitinh };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito daa0e0
## <interface name="modutils_depmod_transition_add_role_use_terminal">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute depmod in the depmod domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the depmod domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the depmod domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito daa0e0
define(`modutils_depmod_transition_add_role_use_terminal',`
Chris PeBenito daa0e0
requires_block_template(`$0'_depend)
Chris PeBenito daa0e0
modutils_depmod_transition($1)
Chris PeBenito daa0e0
role $2 types insmod_t;
Chris PeBenito daa0e0
allow insmod_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
define(`modutils_depmod_transition_add_role_use_terminal_depend',`
Chris PeBenito daa0e0
type depmod_t;
Chris PeBenito daa0e0
class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito 9eb5e8
#
Chris PeBenito bd202f
# modutils_depmod_execute(domain)
Chris PeBenito 9eb5e8
#
Chris PeBenito 9eb5e8
define(`modutils_depmod_execute',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 9eb5e8
allow $1 depmod_exec_t:file { getattr read execute execute_no_trans };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
define(`modutils_depmod_execute_depend',`
Chris PeBenito 9eb5e8
type depmod_t;
Chris PeBenito 9eb5e8
class file { getattr read execute execute_no_trans };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito daa0e0
## <interface name="modutils_update_modules_transition">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute depmod in the depmod domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 9eb5e8
#
Chris PeBenito 9eb5e8
define(`modutils_update_modules_transition',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 9eb5e8
allow $1 update_modules_exec_t:file { getattr read execute };
Chris PeBenito 9eb5e8
allow $1 update_modules_t:process transition;
Chris PeBenito e7fcdc
type_transition $1 update_modules_exec_t:process update_modules_t;
Chris PeBenito 9eb5e8
dontaudit $1 update_modules_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
define(`modutils_update_modules_transition_depend',`
Chris PeBenito 9eb5e8
type update_modules_t;
Chris PeBenito 9eb5e8
class file { getattr read execute };
Chris PeBenito 9eb5e8
class process { transition noatsecure siginh rlimitinh };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
########################################
Chris PeBenito daa0e0
## <interface name="modutils_update_modules_transition_add_role_use_terminal">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute update_modules in the update_modules domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the update_modules domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the update_modules domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<infoflow type="write" weight="10"/>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito daa0e0
define(`modutils_update_modules_transition_add_role_use_terminal',`
Chris PeBenito daa0e0
requires_block_template(`$0'_depend)
Chris PeBenito daa0e0
modutils_update_modules_transition($1)
Chris PeBenito daa0e0
role $2 types update_modules_t;
Chris PeBenito daa0e0
allow update_modules_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
define(`modutils_update_modules_transition_add_role_use_terminal_depend',`
Chris PeBenito daa0e0
type update_modules_t;
Chris PeBenito daa0e0
class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito 9eb5e8
#
Chris PeBenito bd202f
# modutils_update_modules_execute(domain)
Chris PeBenito 9eb5e8
#
Chris PeBenito 9eb5e8
define(`modutils_update_modules_execute',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 9eb5e8
allow $1 update_modules_exec_t:file { getattr read execute execute_no_trans };
Chris PeBenito 9eb5e8
')
Chris PeBenito 9eb5e8
Chris PeBenito 9eb5e8
define(`modutils_update_modules_execute_depend',`
Chris PeBenito 9eb5e8
type update_modules_t;
Chris PeBenito 9eb5e8
class file { getattr read execute execute_no_trans };
Chris PeBenito 9eb5e8
')
Chris PeBenito 162a57
Chris PeBenito 162a57
## </module>