selinux-policy/refpolicy/policy/modules/system/domain.if
2005-04-20 19:07:16 +00:00

111 lines
2.7 KiB
Plaintext

# Copyright (C) 2005 Tresys Technology, LLC
########################################
#
# domain_make_base_domain(domain,[`optional'])
#
define(`domain_make_base_domain',`
requires_block_template(domain_make_base_domain_depend,$2)
# 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,[`optional'])
#
define(`domain_make_domain',`
requires_block_template(domain_make_domain_depend,$2)
domain_make_base_domain($1,optional)
files_read_root_dir($1,optional)
init_sigchld($1,optional)
')
define(`domain_make_domain_depend',`
domain_make_base_domain_depend
files_read_root_dir_depend
init_send_sigchld_depend
')
########################################
#
# domain_make_entrypoint_file(domain,entrypointfile,[`optional'])
#
define(`domain_make_entrypoint_file',`
requires_block_template(domain_make_entrypoint_file_depend,$3)
allow $1 $2:file entrypoint;
neverallow $1 ~{ $2 }:file entrypoint;
files_make_file($2,$3)
')
define(`domain_make_entrypoint_file_depend',`
class file entrypoint;
')
########################################
#
# domain_signal_all_domains(domain,[`optional'])
#
define(`domain_signal_all_domains',`
requires_block_template(domain_signal_all_domains_depend,$2)
allow $1 domain:process signal;
')
define(`domain_signal_all_domains_depend',`
attribute domain;
class process signal;
')
########################################
#
# domain_kill_all_domains(domain,[`optional'])
#
define(`domain_kill_all_domains',`
requires_block_template(domain_kill_all_domains_depend,$2)
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,[`optional'])
#
define(`domain_read_all_domains_process_state',`
requires_block_template(domain_read_all_domains_process_state_depend,$2)
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 };
')