|
Chris PeBenito |
e181fe |
# Copyright (C) 2005 Tresys Technology, LLC
|
|
Chris PeBenito |
e181fe |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
bd202f |
# domain_make_base_domain(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`domain_make_base_domain',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
# mark as a domain
|
|
Chris PeBenito |
b4cd15 |
typeattribute $1 domain;
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
# allow the domain to read its /proc/pid entries
|
|
Chris PeBenito |
b4cd15 |
allow $1 self:dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 self:{ file lnk_file } { getattr read };
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
# allow $1 to create child processes in this domain
|
|
Chris PeBenito |
b4cd15 |
allow $1 self:process { fork sigchld };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`domain_make_base_domain_depend',`
|
|
Chris PeBenito |
b4cd15 |
attribute domain;
|
|
Chris PeBenito |
b4cd15 |
class dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
class lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
bd202f |
# domain_make_domain(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`domain_make_domain',`
|
|
Chris PeBenito |
f1470e |
domain_make_base_domain($1)
|
|
Chris PeBenito |
f1470e |
files_read_root_dir($1)
|
|
Chris PeBenito |
f1470e |
init_sigchld($1)
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
bd202f |
# domain_make_entrypoint_file(domain,entrypointfile)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`domain_make_entrypoint_file',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
b4cd15 |
allow $1 $2:file entrypoint;
|
|
Chris PeBenito |
f1470e |
files_make_file($2)
|
|
Chris PeBenito |
960373 |
typeattribute $1 entry_type;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`domain_make_entrypoint_file_depend',`
|
|
Chris PeBenito |
960373 |
attribute entry_type;
|
|
Chris PeBenito |
b4cd15 |
class file entrypoint;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
bd202f |
# domain_make_init_domain(domain,entrypointfile)
|
|
Chris PeBenito |
219bcf |
#
|
|
Chris PeBenito |
219bcf |
define(`domain_make_init_domain',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
d0eddb |
domain_make_domain($1)
|
|
Chris PeBenito |
d0eddb |
domain_make_entrypoint_file($1,$2)
|
|
Chris PeBenito |
219bcf |
typeattribute $1 init_domain;
|
|
Chris PeBenito |
219bcf |
typeattribute $2 init_domain_entry;
|
|
Chris PeBenito |
219bcf |
role system_r types $1;
|
|
Chris PeBenito |
219bcf |
')
|
|
Chris PeBenito |
219bcf |
|
|
Chris PeBenito |
219bcf |
define(`domain_make_init_domain_depend',`
|
|
Chris PeBenito |
219bcf |
attribute init_domain, init_domain_entry;
|
|
Chris PeBenito |
219bcf |
role system_r;
|
|
Chris PeBenito |
219bcf |
')
|
|
Chris PeBenito |
219bcf |
|
|
Chris PeBenito |
219bcf |
########################################
|
|
Chris PeBenito |
219bcf |
#
|
|
Chris PeBenito |
bd202f |
# domain_make_daemon_domain(domain,entrypointfile)
|
|
Chris PeBenito |
219bcf |
#
|
|
Chris PeBenito |
219bcf |
define(`domain_make_daemon_domain',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
d0eddb |
domain_make_domain($1)
|
|
Chris PeBenito |
d0eddb |
domain_make_entrypoint_file($1,$2)
|
|
Chris PeBenito |
219bcf |
typeattribute $1 daemon_domain;
|
|
Chris PeBenito |
219bcf |
typeattribute $2 daemon_domain_entry;
|
|
Chris PeBenito |
219bcf |
role system_r types $1;
|
|
Chris PeBenito |
219bcf |
')
|
|
Chris PeBenito |
219bcf |
|
|
Chris PeBenito |
219bcf |
define(`domain_make_daemon_domain_depend',`
|
|
Chris PeBenito |
219bcf |
attribute init_domain, init_domain_entry;
|
|
Chris PeBenito |
219bcf |
role system_r;
|
|
Chris PeBenito |
d0eddb |
')
|
|
Chris PeBenito |
d0eddb |
|
|
Chris PeBenito |
d0eddb |
########################################
|
|
Chris PeBenito |
d0eddb |
#
|
|
Chris PeBenito |
d0eddb |
# domain_make_system_domain(domain,entrypointfile)
|
|
Chris PeBenito |
d0eddb |
#
|
|
Chris PeBenito |
d0eddb |
define(`domain_make_system_domain',`
|
|
Chris PeBenito |
d0eddb |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
d0eddb |
domain_make_domain($1)
|
|
Chris PeBenito |
d0eddb |
domain_make_entrypoint_file($1,$2)
|
|
Chris PeBenito |
d0eddb |
typeattribute $1 system_domain;
|
|
Chris PeBenito |
d0eddb |
typeattribute $2 system_domain_entry;
|
|
Chris PeBenito |
d0eddb |
role system_r types $1;
|
|
Chris PeBenito |
d0eddb |
')
|
|
Chris PeBenito |
d0eddb |
|
|
Chris PeBenito |
d0eddb |
define(`domain_make_system_domain_depend',`
|
|
Chris PeBenito |
d0eddb |
attribute system_domain, system_domain_entry;
|
|
Chris PeBenito |
d0eddb |
role system_r;
|
|
Chris PeBenito |
219bcf |
')
|
|
Chris PeBenito |
219bcf |
|
|
Chris PeBenito |
219bcf |
########################################
|
|
Chris PeBenito |
219bcf |
#
|
|
Chris PeBenito |
bd202f |
# domain_make_file_descriptors_widely_inheritable(domain)
|
|
Chris PeBenito |
8a0da1 |
#
|
|
Chris PeBenito |
8a0da1 |
define(`domain_make_file_descriptors_widely_inheritable',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
8a0da1 |
typeattribute $1 privfd;
|
|
Chris PeBenito |
8a0da1 |
')
|
|
Chris PeBenito |
8a0da1 |
|
|
Chris PeBenito |
8a0da1 |
define(`domain_make_file_descriptors_widely_inheritable_depend',`
|
|
Chris PeBenito |
8a0da1 |
attribute privfd;
|
|
Chris PeBenito |
8a0da1 |
')
|
|
Chris PeBenito |
8a0da1 |
|
|
Chris PeBenito |
8a0da1 |
########################################
|
|
Chris PeBenito |
8a0da1 |
#
|
|
Chris PeBenito |
bd202f |
# domain_use_widely_inheritable_file_descriptors(domain)
|
|
Chris PeBenito |
a2d824 |
#
|
|
Chris PeBenito |
a2d824 |
define(`domain_use_widely_inheritable_file_descriptors',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
a2d824 |
allow $1 privfd:fd use;
|
|
Chris PeBenito |
a2d824 |
')
|
|
Chris PeBenito |
a2d824 |
|
|
Chris PeBenito |
a2d824 |
define(`domain_use_widely_inheritable_file_descriptors_depend',`
|
|
Chris PeBenito |
a2d824 |
attribute privfd;
|
|
Chris PeBenito |
a2d824 |
class fd use;
|
|
Chris PeBenito |
a2d824 |
')
|
|
Chris PeBenito |
a2d824 |
|
|
Chris PeBenito |
a2d824 |
########################################
|
|
Chris PeBenito |
a2d824 |
#
|
|
Chris PeBenito |
bd202f |
# domain_ignore_use_widely_inheritable_file_descriptors(domain)
|
|
Chris PeBenito |
3ce6cb |
#
|
|
Chris PeBenito |
3ce6cb |
define(`domain_ignore_use_widely_inheritable_file_descriptors',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
3ce6cb |
dontaudit $1 privfd:fd use;
|
|
Chris PeBenito |
3ce6cb |
')
|
|
Chris PeBenito |
3ce6cb |
|
|
Chris PeBenito |
3ce6cb |
define(`domain_ignore_use_widely_inheritable_file_descriptors_depend',`
|
|
Chris PeBenito |
3ce6cb |
attribute privfd;
|
|
Chris PeBenito |
3ce6cb |
class fd use;
|
|
Chris PeBenito |
3ce6cb |
')
|
|
Chris PeBenito |
3ce6cb |
|
|
Chris PeBenito |
3ce6cb |
########################################
|
|
Chris PeBenito |
3ce6cb |
#
|
|
Chris PeBenito |
bd202f |
# domain_all_init_domains_transition(domain)
|
|
Chris PeBenito |
219bcf |
#
|
|
Chris PeBenito |
219bcf |
define(`domain_all_init_domains_transition',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
219bcf |
allow $1 init_domain:process transition;
|
|
Chris PeBenito |
219bcf |
allow $1 init_domain_entry:file { getattr read execute };
|
|
Chris PeBenito |
d0eddb |
dontaudit $1 init_domain:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
219bcf |
')
|
|
Chris PeBenito |
219bcf |
|
|
Chris PeBenito |
219bcf |
define(`domain_all_init_domains_transition_depend',`
|
|
Chris PeBenito |
219bcf |
attribute init_domain, init_domain_entry;
|
|
Chris PeBenito |
b30304 |
class process { transition noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
219bcf |
class file { getattr read execute };
|
|
Chris PeBenito |
219bcf |
')
|
|
Chris PeBenito |
219bcf |
|
|
Chris PeBenito |
219bcf |
########################################
|
|
Chris PeBenito |
219bcf |
#
|
|
Chris PeBenito |
bd202f |
# domain_all_daemon_domains_transition(domain)
|
|
Chris PeBenito |
219bcf |
#
|
|
Chris PeBenito |
219bcf |
define(`domain_all_daemon_domains_transition',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
219bcf |
allow $1 daemon_domain:process transition;
|
|
Chris PeBenito |
219bcf |
allow $1 daemon_domain_entry:file { getattr read execute };
|
|
Chris PeBenito |
d0eddb |
allow daemon_domain $1:fd use;
|
|
Chris PeBenito |
bcd359 |
allow $1 daemon_domain:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
219bcf |
')
|
|
Chris PeBenito |
219bcf |
|
|
Chris PeBenito |
219bcf |
define(`domain_all_daemon_domains_transition_depend',`
|
|
Chris PeBenito |
219bcf |
attribute daemon_domain, daemon_domain_entry;
|
|
Chris PeBenito |
b30304 |
class process { transition noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
219bcf |
class file { getattr read execute };
|
|
Chris PeBenito |
219bcf |
')
|
|
Chris PeBenito |
219bcf |
|
|
Chris PeBenito |
219bcf |
########################################
|
|
Chris PeBenito |
219bcf |
#
|
|
Chris PeBenito |
d0eddb |
# domain_all_system_domains_transition(domain)
|
|
Chris PeBenito |
d0eddb |
#
|
|
Chris PeBenito |
d0eddb |
define(`domain_all_system_domains_transition',`
|
|
Chris PeBenito |
d0eddb |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
d0eddb |
allow $1 system_domain:process transition;
|
|
Chris PeBenito |
d0eddb |
allow $1 system_domain_entry:file { getattr read execute };
|
|
Chris PeBenito |
d0eddb |
allow system_domain $1:fd use;
|
|
Chris PeBenito |
d0eddb |
allow $1 system_domain:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
d0eddb |
')
|
|
Chris PeBenito |
d0eddb |
|
|
Chris PeBenito |
d0eddb |
define(`domain_all_system_domains_transition_depend',`
|
|
Chris PeBenito |
d0eddb |
attribute system_domain, system_domain_entry;
|
|
Chris PeBenito |
d0eddb |
class process { transition noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
d0eddb |
class file { getattr read execute };
|
|
Chris PeBenito |
d0eddb |
')
|
|
Chris PeBenito |
d0eddb |
|
|
Chris PeBenito |
d0eddb |
|
|
Chris PeBenito |
d0eddb |
########################################
|
|
Chris PeBenito |
d0eddb |
#
|
|
Chris PeBenito |
bd202f |
# domain_signal_all_domains(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`domain_signal_all_domains',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
b4cd15 |
allow $1 domain:process signal;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`domain_signal_all_domains_depend',`
|
|
Chris PeBenito |
b4cd15 |
attribute domain;
|
|
Chris PeBenito |
b4cd15 |
class process signal;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
bd202f |
# domain_kill_all_domains(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`domain_kill_all_domains',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
b4cd15 |
allow $1 domain:process sigkill;
|
|
Chris PeBenito |
b4cd15 |
allow $1 self:capability kill;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`domain_kill_all_domains_depend',`
|
|
Chris PeBenito |
b4cd15 |
attribute domain;
|
|
Chris PeBenito |
b4cd15 |
class process sigkill;
|
|
Chris PeBenito |
b4cd15 |
class capability kill;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
bd202f |
# domain_read_all_domains_process_state(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`domain_read_all_domains_process_state',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
b4cd15 |
allow $1 domain:dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 domain:lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 domain:file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
allow $1 domain:process { getattr getsession };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`domain_read_all_domains_process_state_depend',`
|
|
Chris PeBenito |
b4cd15 |
attribute domain;
|
|
Chris PeBenito |
b4cd15 |
class dir { getattr search read };
|
|
Chris PeBenito |
b4cd15 |
class lnk_file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
class file { getattr read };
|
|
Chris PeBenito |
b4cd15 |
class process { getattr getsession };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
960373 |
|
|
Chris PeBenito |
960373 |
########################################
|
|
Chris PeBenito |
960373 |
#
|
|
Chris PeBenito |
bd202f |
# domain_execute_all_entrypoint_programs(domain)
|
|
Chris PeBenito |
960373 |
#
|
|
Chris PeBenito |
960373 |
define(`domain_execute_all_entrypoint_programs',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
960373 |
allow $1 entry_type:file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
960373 |
')
|
|
Chris PeBenito |
960373 |
|
|
Chris PeBenito |
960373 |
define(`domain_execute_all_entrypoint_programs_depend',`
|
|
Chris PeBenito |
960373 |
attribute entry_type;
|
|
Chris PeBenito |
960373 |
class file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
960373 |
')
|
|
Chris PeBenito |
f1470e |
|
|
Chris PeBenito |
f1470e |
########################################
|
|
Chris PeBenito |
f1470e |
#
|
|
Chris PeBenito |
f1470e |
# domain_read_all_entrypoint_programs(domain)
|
|
Chris PeBenito |
f1470e |
#
|
|
Chris PeBenito |
f1470e |
define(`domain_read_all_entrypoint_programs',`
|
|
Chris PeBenito |
f1470e |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
f1470e |
allow $1 entry_type:{ file lnk_file } { getattr read };
|
|
Chris PeBenito |
f1470e |
')
|
|
Chris PeBenito |
f1470e |
|
|
Chris PeBenito |
f1470e |
define(`domain_read_all_entrypoint_programs_depend',`
|
|
Chris PeBenito |
f1470e |
attribute entry_type;
|
|
Chris PeBenito |
f1470e |
class file { getattr read };
|
|
Chris PeBenito |
f1470e |
')
|