selinux-refpolicy/refpolicy/policy/modules/system/domain.if

280 lines
6.9 KiB
Plaintext
Raw Normal View History

2005-04-20 19:07:16 +00:00
# Copyright (C) 2005 Tresys Technology, LLC
2005-04-14 20:18:17 +00:00
########################################
#
# domain_make_base_domain(domain)
2005-04-14 20:18:17 +00:00
#
define(`domain_make_base_domain',`
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 };
')
########################################
#
# domain_make_domain(domain)
2005-04-14 20:18:17 +00:00
#
define(`domain_make_domain',`
2005-05-04 21:44:51 +00:00
domain_make_base_domain($1)
files_read_root_dir($1)
init_sigchld($1)
2005-04-14 20:18:17 +00:00
')
########################################
#
# domain_make_entrypoint_file(domain,entrypointfile)
2005-04-14 20:18:17 +00:00
#
define(`domain_make_entrypoint_file',`
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)
typeattribute $1 entry_type;
2005-04-14 20:18:17 +00:00
')
define(`domain_make_entrypoint_file_depend',`
attribute entry_type;
2005-04-14 20:18:17 +00:00
class file entrypoint;
')
########################################
#
# domain_make_init_domain(domain,entrypointfile)
#
define(`domain_make_init_domain',`
requires_block_template(`$0'_depend)
2005-05-05 17:44:11 +00:00
domain_make_domain($1)
domain_make_entrypoint_file($1,$2)
typeattribute $1 init_domain;
typeattribute $2 init_domain_entry;
role system_r types $1;
')
define(`domain_make_init_domain_depend',`
attribute init_domain, init_domain_entry;
role system_r;
')
########################################
#
# domain_make_daemon_domain(domain,entrypointfile)
#
define(`domain_make_daemon_domain',`
requires_block_template(`$0'_depend)
2005-05-05 17:44:11 +00:00
domain_make_domain($1)
domain_make_entrypoint_file($1,$2)
typeattribute $1 daemon_domain;
typeattribute $2 daemon_domain_entry;
role system_r types $1;
')
define(`domain_make_daemon_domain_depend',`
attribute init_domain, init_domain_entry;
role system_r;
2005-05-05 17:44:11 +00:00
')
########################################
#
# domain_make_system_domain(domain,entrypointfile)
#
define(`domain_make_system_domain',`
requires_block_template(`$0'_depend)
domain_make_domain($1)
domain_make_entrypoint_file($1,$2)
typeattribute $1 system_domain;
typeattribute $2 system_domain_entry;
role system_r types $1;
')
define(`domain_make_system_domain_depend',`
attribute system_domain, system_domain_entry;
role system_r;
')
########################################
#
# domain_make_file_descriptors_widely_inheritable(domain)
#
define(`domain_make_file_descriptors_widely_inheritable',`
requires_block_template(`$0'_depend)
typeattribute $1 privfd;
')
define(`domain_make_file_descriptors_widely_inheritable_depend',`
attribute privfd;
')
2005-04-28 21:41:09 +00:00
########################################
#
# domain_use_widely_inheritable_file_descriptors(domain)
2005-04-28 21:41:09 +00:00
#
define(`domain_use_widely_inheritable_file_descriptors',`
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;
')
########################################
#
# domain_ignore_use_widely_inheritable_file_descriptors(domain)
#
define(`domain_ignore_use_widely_inheritable_file_descriptors',`
requires_block_template(`$0'_depend)
dontaudit $1 privfd:fd use;
')
define(`domain_ignore_use_widely_inheritable_file_descriptors_depend',`
attribute privfd;
class fd use;
')
########################################
#
# domain_all_init_domains_transition(domain)
#
define(`domain_all_init_domains_transition',`
requires_block_template(`$0'_depend)
allow $1 init_domain:process transition;
allow $1 init_domain_entry:file { getattr read execute };
2005-05-05 17:44:11 +00:00
dontaudit $1 init_domain:process { noatsecure siginh rlimitinh };
')
define(`domain_all_init_domains_transition_depend',`
attribute init_domain, init_domain_entry;
2005-04-25 21:07:59 +00:00
class process { transition noatsecure siginh rlimitinh };
class file { getattr read execute };
')
########################################
#
# domain_all_daemon_domains_transition(domain)
#
define(`domain_all_daemon_domains_transition',`
requires_block_template(`$0'_depend)
allow $1 daemon_domain:process transition;
allow $1 daemon_domain_entry:file { getattr read execute };
2005-05-05 17:44:11 +00:00
allow daemon_domain $1:fd use;
allow $1 daemon_domain:process { noatsecure siginh rlimitinh };
')
define(`domain_all_daemon_domains_transition_depend',`
attribute daemon_domain, daemon_domain_entry;
2005-04-25 21:07:59 +00:00
class process { transition noatsecure siginh rlimitinh };
class file { getattr read execute };
')
2005-05-05 17:44:11 +00:00
########################################
#
# domain_all_system_domains_transition(domain)
#
define(`domain_all_system_domains_transition',`
requires_block_template(`$0'_depend)
allow $1 system_domain:process transition;
allow $1 system_domain_entry:file { getattr read execute };
allow system_domain $1:fd use;
allow $1 system_domain:process { noatsecure siginh rlimitinh };
')
define(`domain_all_system_domains_transition_depend',`
attribute system_domain, system_domain_entry;
class process { transition noatsecure siginh rlimitinh };
class file { getattr read execute };
')
2005-04-14 20:18:17 +00:00
########################################
#
# domain_signal_all_domains(domain)
2005-04-14 20:18:17 +00:00
#
define(`domain_signal_all_domains',`
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;
')
########################################
#
# domain_kill_all_domains(domain)
2005-04-14 20:18:17 +00:00
#
define(`domain_kill_all_domains',`
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;
')
########################################
#
# domain_read_all_domains_process_state(domain)
2005-04-14 20:18:17 +00:00
#
define(`domain_read_all_domains_process_state',`
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 };
')
########################################
#
# domain_execute_all_entrypoint_programs(domain)
#
define(`domain_execute_all_entrypoint_programs',`
requires_block_template(`$0'_depend)
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 };
')