2005-04-20 19:07:16 +00:00
|
|
|
# Copyright (C) 2005 Tresys Technology, LLC
|
2005-05-23 15:49:03 +00:00
|
|
|
## <module name="domain" layer="system">
|
|
|
|
## <summary>Core policy for domains.</summary>
|
2005-04-20 19:07:16 +00:00
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-05-04 13:19:47 +00:00
|
|
|
# domain_make_base_domain(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
define(`domain_make_base_domain',`
|
2005-05-04 13:19:47 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
|
|
|
# mark as a domain
|
|
|
|
typeattribute $1 domain;
|
|
|
|
|
|
|
|
# allow the domain to read its /proc/pid entries
|
|
|
|
allow $1 self:dir { getattr search read };
|
|
|
|
allow $1 self:{ file lnk_file } { getattr read };
|
|
|
|
|
|
|
|
# allow $1 to create child processes in this domain
|
|
|
|
allow $1 self:process { fork sigchld };
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_make_base_domain_depend',`
|
|
|
|
attribute domain;
|
|
|
|
class dir { getattr search read };
|
|
|
|
class file { getattr read };
|
|
|
|
class lnk_file { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-05-04 13:19:47 +00:00
|
|
|
# domain_make_domain(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
define(`domain_make_domain',`
|
2005-05-09 19:55:01 +00:00
|
|
|
|
|
|
|
# start with basic domain
|
2005-05-04 21:44:51 +00:00
|
|
|
domain_make_base_domain($1)
|
2005-05-09 19:55:01 +00:00
|
|
|
|
|
|
|
# Use trusted objects in /dev
|
|
|
|
devices_use_dev_null($1)
|
|
|
|
devices_use_dev_zero($1)
|
|
|
|
terminal_use_controlling_terminal($1)
|
|
|
|
|
|
|
|
# read the root directory
|
2005-05-04 21:44:51 +00:00
|
|
|
files_read_root_dir($1)
|
2005-05-09 19:55:01 +00:00
|
|
|
|
|
|
|
# send init a sigchld
|
2005-05-04 21:44:51 +00:00
|
|
|
init_sigchld($1)
|
2005-05-23 17:56:35 +00:00
|
|
|
|
|
|
|
# this seems highly questionable:
|
|
|
|
optional_policy(`rpm.te',`
|
|
|
|
rpm_use_file_descriptors($1)
|
|
|
|
rpm_read_pipe($1)
|
|
|
|
')
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-05-04 13:19:47 +00:00
|
|
|
# domain_make_entrypoint_file(domain,entrypointfile)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
define(`domain_make_entrypoint_file',`
|
2005-05-04 13:19:47 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
2005-04-14 20:18:17 +00:00
|
|
|
allow $1 $2:file entrypoint;
|
2005-05-04 21:44:51 +00:00
|
|
|
files_make_file($2)
|
2005-04-26 17:00:25 +00:00
|
|
|
typeattribute $1 entry_type;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_make_entrypoint_file_depend',`
|
2005-04-26 17:00:25 +00:00
|
|
|
attribute entry_type;
|
2005-04-14 20:18:17 +00:00
|
|
|
class file entrypoint;
|
|
|
|
')
|
|
|
|
|
2005-04-22 19:31:32 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-05-04 13:19:47 +00:00
|
|
|
# domain_make_file_descriptors_widely_inheritable(domain)
|
2005-04-22 19:31:32 +00:00
|
|
|
#
|
|
|
|
define(`domain_make_file_descriptors_widely_inheritable',`
|
2005-05-04 13:19:47 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
2005-04-22 19:31:32 +00:00
|
|
|
typeattribute $1 privfd;
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_make_file_descriptors_widely_inheritable_depend',`
|
|
|
|
attribute privfd;
|
|
|
|
')
|
|
|
|
|
2005-04-28 21:41:09 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-05-04 13:19:47 +00:00
|
|
|
# domain_use_widely_inheritable_file_descriptors(domain)
|
2005-04-28 21:41:09 +00:00
|
|
|
#
|
|
|
|
define(`domain_use_widely_inheritable_file_descriptors',`
|
2005-05-04 13:19:47 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
2005-04-28 21:41:09 +00:00
|
|
|
allow $1 privfd:fd use;
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_use_widely_inheritable_file_descriptors_depend',`
|
|
|
|
attribute privfd;
|
|
|
|
class fd use;
|
|
|
|
')
|
|
|
|
|
2005-05-03 20:23:33 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-05-04 13:19:47 +00:00
|
|
|
# domain_ignore_use_widely_inheritable_file_descriptors(domain)
|
2005-05-03 20:23:33 +00:00
|
|
|
#
|
|
|
|
define(`domain_ignore_use_widely_inheritable_file_descriptors',`
|
2005-05-04 13:19:47 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
2005-05-03 20:23:33 +00:00
|
|
|
dontaudit $1 privfd:fd use;
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_ignore_use_widely_inheritable_file_descriptors_depend',`
|
|
|
|
attribute privfd;
|
|
|
|
class fd use;
|
|
|
|
')
|
|
|
|
|
2005-05-18 13:21:00 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# domain_set_all_domains_priorities(domain)
|
|
|
|
#
|
|
|
|
define(`domain_set_all_domains_priorities',`
|
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
allow $1 domain:process setsched;
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_set_all_domains_priorities_depend',`
|
|
|
|
attribute domain;
|
|
|
|
class process setsched;
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-05-04 13:19:47 +00:00
|
|
|
# domain_signal_all_domains(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
define(`domain_signal_all_domains',`
|
2005-05-04 13:19:47 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
2005-04-14 20:18:17 +00:00
|
|
|
allow $1 domain:process signal;
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_signal_all_domains_depend',`
|
|
|
|
attribute domain;
|
|
|
|
class process signal;
|
|
|
|
')
|
|
|
|
|
2005-05-23 15:49:03 +00:00
|
|
|
########################################
|
|
|
|
## <interface name="domain_signull_all_domains">
|
|
|
|
## <description>
|
|
|
|
## Send a null signal to all domains.
|
|
|
|
## </description>
|
|
|
|
## <parameter name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </parameter>
|
|
|
|
## <infoflow type="write" weight="1"/>
|
|
|
|
## </interface>
|
|
|
|
#
|
|
|
|
define(`domain_signull_all_domains',`
|
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
allow $1 domain:process signull;
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_signull_all_domains_depend',`
|
|
|
|
attribute domain;
|
|
|
|
class process signull;
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-05-04 13:19:47 +00:00
|
|
|
# domain_kill_all_domains(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
define(`domain_kill_all_domains',`
|
2005-05-04 13:19:47 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
2005-04-14 20:18:17 +00:00
|
|
|
allow $1 domain:process sigkill;
|
|
|
|
allow $1 self:capability kill;
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_kill_all_domains_depend',`
|
|
|
|
attribute domain;
|
|
|
|
class process sigkill;
|
|
|
|
class capability kill;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-05-19 21:06:06 +00:00
|
|
|
## <interface name="domain_read_all_domains_process_state">
|
|
|
|
## <description>
|
|
|
|
## Read the process state (/proc/pid) of all domains.
|
|
|
|
## </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(`domain_read_all_domains_process_state',`
|
2005-05-04 13:19:47 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
2005-04-14 20:18:17 +00:00
|
|
|
allow $1 domain:dir { getattr search read };
|
|
|
|
allow $1 domain:lnk_file { getattr read };
|
|
|
|
allow $1 domain:file { getattr read };
|
|
|
|
allow $1 domain:process { getattr getsession };
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_read_all_domains_process_state_depend',`
|
|
|
|
attribute domain;
|
|
|
|
class dir { getattr search read };
|
|
|
|
class lnk_file { getattr read };
|
|
|
|
class file { getattr read };
|
|
|
|
class process { getattr getsession };
|
|
|
|
')
|
2005-04-26 17:00:25 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-05-04 13:19:47 +00:00
|
|
|
# domain_execute_all_entrypoint_programs(domain)
|
2005-04-26 17:00:25 +00:00
|
|
|
#
|
|
|
|
define(`domain_execute_all_entrypoint_programs',`
|
2005-05-04 13:19:47 +00:00
|
|
|
requires_block_template(`$0'_depend)
|
2005-04-26 17:00:25 +00:00
|
|
|
allow $1 entry_type:file { getattr read execute execute_no_trans };
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_execute_all_entrypoint_programs_depend',`
|
|
|
|
attribute entry_type;
|
|
|
|
class file { getattr read execute execute_no_trans };
|
|
|
|
')
|
2005-05-04 21:44:51 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# domain_read_all_entrypoint_programs(domain)
|
|
|
|
#
|
|
|
|
define(`domain_read_all_entrypoint_programs',`
|
|
|
|
requires_block_template(`$0'_depend)
|
|
|
|
allow $1 entry_type:{ file lnk_file } { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
define(`domain_read_all_entrypoint_programs_depend',`
|
|
|
|
attribute entry_type;
|
|
|
|
class file { getattr read };
|
|
|
|
')
|
2005-05-23 15:49:03 +00:00
|
|
|
|
|
|
|
## </module>
|