2005-06-01 14:17:43 +00:00
|
|
|
## <summary>System initialization programs (init and init scripts).</summary>
|
2005-04-20 19:07:16 +00:00
|
|
|
|
2005-05-13 20:21:50 +00:00
|
|
|
########################################
|
2005-07-07 15:25:28 +00:00
|
|
|
## <summary>
|
|
|
|
## Create a domain which can be started by init.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## Type to be used as a domain.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="entry_point">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## Type of the program to be used as an entry point to this domain.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## </param>
|
2005-05-13 20:21:50 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_domain',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
|
|
|
role system_r;
|
|
|
|
')
|
2005-05-31 21:25:45 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_type($1)
|
|
|
|
domain_entry_file($1,$2)
|
2005-05-31 21:25:45 +00:00
|
|
|
|
|
|
|
role system_r types $1;
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern(init_t,$2,$1)
|
2006-05-19 19:52:18 +00:00
|
|
|
|
|
|
|
ifdef(`hide_broken_symptoms',`
|
|
|
|
# RHEL4 systems seem to have a stray
|
|
|
|
# fds open from the initrd
|
|
|
|
ifdef(`distro_rhel4',`
|
2006-05-19 20:02:41 +00:00
|
|
|
kernel_dontaudit_use_fds($1)
|
2006-05-19 19:52:18 +00:00
|
|
|
')
|
|
|
|
')
|
2005-05-13 20:21:50 +00:00
|
|
|
')
|
|
|
|
|
2006-10-04 17:25:34 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create a domain which can be started by init,
|
|
|
|
## with a range transition.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Type to be used as a domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="entry_point">
|
|
|
|
## <summary>
|
|
|
|
## Type of the program to be used as an entry point to this domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="range">
|
|
|
|
## <summary>
|
|
|
|
## Range for the domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_ranged_domain',`
|
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
init_domain($1,$2)
|
|
|
|
|
|
|
|
ifdef(`enable_mcs',`
|
|
|
|
range_transition init_t $2:process $3;
|
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`enable_mls',`
|
|
|
|
range_transition init_t $2:process $3;
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2005-05-13 20:21:50 +00:00
|
|
|
########################################
|
2005-07-07 15:25:28 +00:00
|
|
|
## <summary>
|
|
|
|
## Create a domain for long running processes
|
|
|
|
## (daemons) which can be started by init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## Type to be used as a domain.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="entry_point">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## Type of the program to be used as an entry point to this domain.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## </param>
|
2005-05-13 20:21:50 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_daemon_domain',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
2005-07-07 15:25:28 +00:00
|
|
|
attribute direct_run_init, direct_init, direct_init_entry;
|
2005-06-17 17:59:26 +00:00
|
|
|
type initrc_t;
|
|
|
|
role system_r;
|
2006-09-25 18:53:06 +00:00
|
|
|
attribute daemon;
|
2005-06-17 17:59:26 +00:00
|
|
|
')
|
2005-05-31 21:25:45 +00:00
|
|
|
|
2006-09-25 18:53:06 +00:00
|
|
|
typeattribute $1 daemon;
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_type($1)
|
|
|
|
domain_entry_file($1,$2)
|
2005-05-31 21:25:45 +00:00
|
|
|
|
|
|
|
role system_r types $1;
|
|
|
|
|
2007-03-20 18:47:18 +00:00
|
|
|
# daemons started from init will
|
|
|
|
# inherit fds from init for the console
|
|
|
|
init_dontaudit_use_fds($1)
|
|
|
|
term_dontaudit_use_console($1)
|
|
|
|
|
|
|
|
# init script ptys are the stdin/out/err
|
|
|
|
# when using run_init
|
|
|
|
init_use_script_ptys($1)
|
|
|
|
|
2005-07-07 15:25:28 +00:00
|
|
|
ifdef(`direct_sysadm_daemon',`
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern(direct_run_init,$2,$1)
|
2005-07-07 15:25:28 +00:00
|
|
|
allow direct_run_init $1:process { noatsecure siginh rlimitinh };
|
|
|
|
|
|
|
|
typeattribute $1 direct_init;
|
|
|
|
typeattribute $2 direct_init_entry;
|
|
|
|
')
|
|
|
|
|
2006-05-19 19:52:18 +00:00
|
|
|
ifdef(`hide_broken_symptoms',`
|
|
|
|
# RHEL4 systems seem to have a stray
|
|
|
|
# fds open from the initrd
|
|
|
|
ifdef(`distro_rhel4',`
|
2006-05-19 20:02:41 +00:00
|
|
|
kernel_dontaudit_use_fds($1)
|
2006-05-19 19:52:18 +00:00
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2005-09-27 20:17:50 +00:00
|
|
|
ifdef(`targeted_policy',`
|
|
|
|
# this regex is a hack, since it assumes there is a
|
|
|
|
# _t at the end of the domain type. If there is no _t
|
|
|
|
# at the end of the type, it returns empty!
|
2005-10-31 20:32:53 +00:00
|
|
|
ifdef(`__define_'regexp($1, `\(\w+\)_t', `\1_disable_trans'),`',`
|
|
|
|
bool regexp($1, `\(\w+\)_t', `\1_disable_trans') false;
|
|
|
|
define(`__define_'regexp($1, `\(\w+\)_t', `\1_disable_trans'))
|
|
|
|
')
|
2005-10-24 00:54:39 +00:00
|
|
|
if(regexp($1, `\(\w+\)_t', `\1_disable_trans') ) {
|
|
|
|
can_exec(initrc_t,$2)
|
|
|
|
can_exec(direct_run_init,$2)
|
|
|
|
} else {
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern(initrc_t,$2,$1)
|
2005-10-24 00:54:39 +00:00
|
|
|
allow initrc_t $1:process { noatsecure siginh rlimitinh };
|
2005-09-27 20:17:50 +00:00
|
|
|
}
|
|
|
|
',`
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern(initrc_t,$2,$1)
|
2005-09-27 20:17:50 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use($1)
|
2005-09-15 21:03:29 +00:00
|
|
|
')
|
2005-05-13 20:21:50 +00:00
|
|
|
')
|
|
|
|
|
2006-10-04 17:25:34 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create a domain for long running processes
|
|
|
|
## (daemons) which can be started by init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Type to be used as a domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="entry_point">
|
|
|
|
## <summary>
|
|
|
|
## Type of the program to be used as an entry point to this domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="range">
|
|
|
|
## <summary>
|
|
|
|
## Range for the domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_ranged_daemon_domain',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
init_daemon_domain($1,$2)
|
|
|
|
|
|
|
|
ifdef(`enable_mcs',`
|
|
|
|
range_transition initrc_t $2:process $3;
|
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`enable_mls',`
|
|
|
|
range_transition initrc_t $2:process $3;
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2005-05-13 20:21:50 +00:00
|
|
|
########################################
|
2005-07-07 15:25:28 +00:00
|
|
|
## <summary>
|
|
|
|
## Create a domain for short running processes
|
|
|
|
## which can be started by init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## Type to be used as a domain.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="entry_point">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## Type of the program to be used as an entry point to this domain.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## </param>
|
2005-05-13 20:21:50 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_system_domain',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
role system_r;
|
|
|
|
')
|
2005-05-31 23:02:11 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_type($1)
|
|
|
|
domain_entry_file($1,$2)
|
2005-05-31 23:02:11 +00:00
|
|
|
|
|
|
|
role system_r types $1;
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern(initrc_t,$2,$1)
|
2006-05-19 19:52:18 +00:00
|
|
|
|
|
|
|
ifdef(`hide_broken_symptoms',`
|
|
|
|
# RHEL4 systems seem to have a stray
|
|
|
|
# fds open from the initrd
|
|
|
|
ifdef(`distro_rhel4',`
|
2006-05-19 20:02:41 +00:00
|
|
|
kernel_dontaudit_use_fds($1)
|
2006-05-19 19:52:18 +00:00
|
|
|
')
|
|
|
|
')
|
2005-05-13 20:21:50 +00:00
|
|
|
')
|
|
|
|
|
2006-10-04 17:25:34 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create a domain for short running processes
|
|
|
|
## which can be started by init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Type to be used as a domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="entry_point">
|
|
|
|
## <summary>
|
|
|
|
## Type of the program to be used as an entry point to this domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="range">
|
|
|
|
## <summary>
|
|
|
|
## Range for the domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_ranged_system_domain',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
init_system_domain($1,$2)
|
|
|
|
|
|
|
|
ifdef(`enable_mcs',`
|
|
|
|
range_transition initrc_t $2 $3;
|
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`enable_mls',`
|
|
|
|
range_transition initrc_t $2 $3;
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Execute init (/sbin/init) with a domain transition.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_domtrans',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type init_t, init_exec_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern($1,init_exec_t,init_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-09-15 15:34:31 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute the init program in the caller domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-15 15:34:31 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-15 15:34:31 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-09-15 15:34:31 +00:00
|
|
|
#
|
|
|
|
interface(`init_exec',`
|
|
|
|
gen_require(`
|
|
|
|
type init_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
corecmd_search_sbin($1)
|
|
|
|
can_exec($1,init_exec_t)
|
|
|
|
')
|
|
|
|
|
2005-05-09 15:38:06 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Get the process group of init.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-05-09 15:38:06 +00:00
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_getpgid',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
2005-05-02 18:40:05 +00:00
|
|
|
|
2006-03-28 21:20:01 +00:00
|
|
|
# cjp: remove this when init_t decl is moved back to this module
|
2006-04-05 20:06:21 +00:00
|
|
|
attribute direct_run_init;
|
2005-06-17 17:59:26 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2006-03-28 21:20:01 +00:00
|
|
|
allow $1 init_t:process getpgid;
|
2005-05-02 18:40:05 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-08-31 15:25:12 +00:00
|
|
|
## <summary>
|
|
|
|
## Send init a null signal.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-08-31 15:25:12 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-08-31 15:25:12 +00:00
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-08-31 15:25:12 +00:00
|
|
|
interface(`init_signull',`
|
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
2006-03-28 21:20:01 +00:00
|
|
|
|
|
|
|
# cjp: remove this when init_t decl is moved back to this module
|
2006-04-05 20:06:21 +00:00
|
|
|
attribute direct_run_init;
|
2005-08-31 15:25:12 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 init_t:process signull;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send init a SIGCHLD signal.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-08-31 15:25:12 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-08-31 15:25:12 +00:00
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_sigchld',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
2006-03-28 21:20:01 +00:00
|
|
|
|
|
|
|
# cjp: remove this when init_t decl is moved back to this module
|
2006-04-05 20:06:21 +00:00
|
|
|
attribute direct_run_init;
|
2005-06-17 17:59:26 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 init_t:process sigchld;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-04-27 21:56:12 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Inherit and use file descriptors from init.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-04-27 21:56:12 +00:00
|
|
|
#
|
2006-03-02 23:41:11 +00:00
|
|
|
interface(`init_use_fds',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
2006-03-28 21:20:01 +00:00
|
|
|
|
|
|
|
# cjp: remove this when init_t decl is moved back to this module
|
2006-04-05 20:06:21 +00:00
|
|
|
attribute direct_run_init;
|
2005-06-17 17:59:26 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 init_t:fd use;
|
2005-04-27 21:56:12 +00:00
|
|
|
')
|
|
|
|
|
2005-04-28 19:50:58 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to inherit file
|
|
|
|
## descriptors from init.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-04-28 19:50:58 +00:00
|
|
|
#
|
2006-03-02 23:41:11 +00:00
|
|
|
interface(`init_dontaudit_use_fds',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
2006-03-28 21:20:01 +00:00
|
|
|
|
|
|
|
# cjp: remove this when init_t decl is moved back to this module
|
2006-04-05 20:06:21 +00:00
|
|
|
attribute direct_run_init;
|
2005-06-17 17:59:26 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 init_t:fd use;
|
2005-04-28 19:50:58 +00:00
|
|
|
')
|
|
|
|
|
2005-09-08 17:12:38 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2006-08-15 20:00:58 +00:00
|
|
|
## Send UDP network traffic to init. (Deprecated)
|
2005-09-08 17:12:38 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-08 17:12:38 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_udp_send',`
|
2006-08-15 20:00:58 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated.')
|
2005-09-08 17:12:38 +00:00
|
|
|
')
|
|
|
|
|
2006-03-28 21:20:01 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Get the attributes of initctl.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2006-03-28 21:20:01 +00:00
|
|
|
#
|
|
|
|
interface(`init_getattr_initctl',`
|
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initctl_t:fifo_file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the
|
|
|
|
## attributes of initctl.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain to not audit.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2006-03-28 21:20:01 +00:00
|
|
|
#
|
|
|
|
interface(`init_dontaudit_getattr_initctl',`
|
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 initctl_t:fifo_file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Write to initctl.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2006-03-28 21:20:01 +00:00
|
|
|
#
|
|
|
|
interface(`init_write_initctl',`
|
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dev_list_all_dev_nodes($1)
|
|
|
|
allow $1 initctl_t:fifo_file write;
|
|
|
|
')
|
|
|
|
|
2006-09-06 22:07:25 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Use telinit (Read and write initctl).
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`init_telinit',`
|
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dev_list_all_dev_nodes($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 initctl_t:fifo_file rw_fifo_file_perms;
|
2007-02-26 20:19:53 +00:00
|
|
|
|
|
|
|
init_exec($1)
|
2006-09-06 22:07:25 +00:00
|
|
|
')
|
|
|
|
|
2006-03-28 21:20:01 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Read and write initctl.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2006-03-28 21:20:01 +00:00
|
|
|
#
|
|
|
|
interface(`init_rw_initctl',`
|
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dev_list_all_dev_nodes($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 initctl_t:fifo_file rw_fifo_file_perms;
|
2006-03-28 21:20:01 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to read and
|
|
|
|
## write initctl.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2006-03-28 21:20:01 +00:00
|
|
|
#
|
|
|
|
interface(`init_dontaudit_rw_initctl',`
|
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 initctl_t:fifo_file { read write };
|
|
|
|
')
|
|
|
|
|
2006-02-21 15:57:49 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Make init scripts an entry point for
|
|
|
|
## the specified domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## The domain for which init scripts are an entrypoint.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
# cjp: added for gentoo integrated run_init
|
|
|
|
interface(`init_script_file_entry_type',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
domain_entry_file($1,initrc_exec_t)
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
2006-10-09 18:52:19 +00:00
|
|
|
## Execute init scripts with a specified domain transition.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_spec_domtrans_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t, initrc_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_list_etc($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
spec_domtrans_pattern($1,initrc_exec_t,initrc_t)
|
2006-10-09 18:52:19 +00:00
|
|
|
|
|
|
|
ifdef(`enable_mcs',`
|
|
|
|
range_transition $1 initrc_exec_t:process s0;
|
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`enable_mls',`
|
|
|
|
range_transition $1 initrc_exec_t:process s0 - mls_systemhigh;
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute init scripts with an automatic domain transition.
|
2006-05-10 18:09:08 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_domtrans_script',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t, initrc_exec_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
files_list_etc($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern($1,initrc_exec_t,initrc_t)
|
2006-10-04 17:25:34 +00:00
|
|
|
|
|
|
|
ifdef(`enable_mcs',`
|
|
|
|
range_transition $1 initrc_exec_t:process s0;
|
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`enable_mls',`
|
|
|
|
range_transition $1 initrc_exec_t:process s0 - mls_systemhigh;
|
|
|
|
')
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2006-02-21 15:57:49 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute a init script in a specified domain.
|
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Execute a init script in a specified domain.
|
|
|
|
## </p>
|
|
|
|
## <p>
|
|
|
|
## No interprocess communication (signals, pipes,
|
|
|
|
## etc.) is provided by this interface since
|
|
|
|
## the domains are not owned by this module.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="source_domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain to transition from.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="target_domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain to transition to.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
# cjp: added for gentoo integrated run_init
|
|
|
|
interface(`init_script_file_domtrans',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_list_etc($1)
|
|
|
|
domain_auto_trans($1,initrc_exec_t,$2)
|
|
|
|
')
|
|
|
|
|
2005-07-07 15:25:28 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## Start and stop daemon programs directly.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-08-17 14:14:07 +00:00
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Start and stop daemon programs directly
|
|
|
|
## in the traditional "/etc/init.d/daemon start"
|
|
|
|
## style, and do not require run_init.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
2005-07-07 15:25:28 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## The role to be performing this action.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="terminal">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## The type of the terminal of the user.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-07 15:25:28 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_run_daemon',`
|
|
|
|
gen_require(`
|
|
|
|
attribute direct_run_init, direct_init, direct_init_entry;
|
|
|
|
role system_r;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 direct_run_init;
|
|
|
|
role_transition $2 direct_init_entry system_r;
|
|
|
|
dontaudit direct_init $3:chr_file rw_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-11-08 22:00:30 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Write an init script unnamed pipe.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_write_script_pipes',`
|
2005-11-08 22:00:30 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:fifo_file write;
|
|
|
|
')
|
|
|
|
|
2005-11-29 21:27:15 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Get the attribute of init script entrypoint files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-29 21:27:15 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-11-29 21:27:15 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-06 15:40:41 +00:00
|
|
|
interface(`init_getattr_script_files',`
|
2005-11-29 21:27:15 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_list_etc($1)
|
|
|
|
allow $1 initrc_exec_t:file getattr;
|
|
|
|
')
|
|
|
|
|
2005-05-04 13:19:47 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Execute init scripts in the caller domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-05-04 13:19:47 +00:00
|
|
|
#
|
2006-02-06 15:40:41 +00:00
|
|
|
interface(`init_exec_script_files',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_exec_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
files_list_etc($1)
|
2005-06-09 14:50:48 +00:00
|
|
|
can_exec($1,initrc_exec_t)
|
2005-05-04 13:19:47 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2005-06-24 20:37:09 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Read the process state (/proc/pid) of the init scripts.
|
2005-06-24 20:37:09 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_read_script_state',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
kernel_search_proc($1)
|
|
|
|
read_files_pattern($1,initrc_t,initrc_t)
|
|
|
|
read_lnk_files_pattern($1,initrc_t,initrc_t)
|
|
|
|
list_dirs_pattern($1,initrc_t,initrc_t)
|
|
|
|
|
|
|
|
# should move this to separate interface
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 initrc_t:process getattr;
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-05-03 20:23:33 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Inherit and use init script file descriptors.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-04-28 18:59:01 +00:00
|
|
|
#
|
2006-02-20 21:33:25 +00:00
|
|
|
interface(`init_use_script_fds',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 initrc_t:fd use;
|
2005-04-28 18:59:01 +00:00
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to inherit
|
|
|
|
## init script file descriptors.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2006-02-20 21:33:25 +00:00
|
|
|
interface(`init_dontaudit_use_script_fds',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 initrc_t:fd use;
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-05-16 21:10:33 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Get the process group ID of init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-05-16 21:10:33 +00:00
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_getpgid_script',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 initrc_t:process getpgid;
|
2005-05-16 21:10:33 +00:00
|
|
|
')
|
|
|
|
|
2005-10-23 20:18:36 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send SIGCHLD signals to init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-23 20:18:36 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_sigchld_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:process sigchld;
|
|
|
|
')
|
|
|
|
|
2005-11-09 17:12:34 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send generic signals to init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-09 17:12:34 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-11-09 17:12:34 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_signal_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:process signal;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send null signals to init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-09 17:12:34 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-11-09 17:12:34 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_signull_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:process signull;
|
|
|
|
')
|
|
|
|
|
2005-06-20 17:41:29 +00:00
|
|
|
########################################
|
2005-06-24 20:37:09 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Read and write init script unnamed pipes.
|
2005-06-24 20:37:09 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-06-20 17:41:29 +00:00
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_rw_script_pipes',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:fifo_file { read write };
|
|
|
|
')
|
|
|
|
|
2005-06-24 20:37:09 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2006-08-15 20:00:58 +00:00
|
|
|
## Send UDP network traffic to init scripts. (Deprecated)
|
2005-06-24 20:37:09 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-24 20:37:09 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_udp_send_script',`
|
2006-08-15 20:00:58 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated.')
|
2005-06-24 20:37:09 +00:00
|
|
|
')
|
|
|
|
|
2005-10-05 19:52:53 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow the specified domain to connect to
|
|
|
|
## init scripts with a unix socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-05 19:52:53 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-05 19:52:53 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_stream_connect_script',`
|
2005-10-05 19:52:53 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:unix_stream_socket connectto;
|
|
|
|
')
|
|
|
|
|
2006-05-17 14:50:31 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow the specified domain to read/write to
|
|
|
|
## init scripts with a unix domain stream sockets.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_rw_script_stream_sockets',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:unix_stream_socket { read write };
|
|
|
|
')
|
|
|
|
|
2005-12-05 17:11:14 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Dont audit the specified domain connecting to
|
|
|
|
## init scripts with a unix domain stream socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-12-05 17:11:14 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-12-05 17:11:14 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_dontaudit_stream_connect_script',`
|
2005-12-05 17:11:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 initrc_t:unix_stream_socket connectto;
|
|
|
|
')
|
|
|
|
|
2005-12-02 22:06:05 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send and receive messages from
|
|
|
|
## init scripts over dbus.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-12-02 22:06:05 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-12-02 22:06:05 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_dbus_chat_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
class dbus send_msg;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:dbus send_msg;
|
|
|
|
allow initrc_t $1:dbus send_msg;
|
|
|
|
')
|
|
|
|
|
2005-04-27 21:56:12 +00:00
|
|
|
########################################
|
2005-08-17 14:14:07 +00:00
|
|
|
## <summary>
|
|
|
|
## Read and write the init script pty.
|
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Read and write the init script pty. This
|
|
|
|
## pty is generally opened by the open_init_pty
|
|
|
|
## portion of the run_init program so that the
|
|
|
|
## daemon does not require direct access to
|
|
|
|
## the administrator terminal.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-08-17 14:14:07 +00:00
|
|
|
## </param>
|
2005-04-27 21:56:12 +00:00
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_use_script_ptys',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_devpts_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
term_list_ptys($1)
|
2005-10-21 19:36:49 +00:00
|
|
|
allow $1 initrc_devpts_t:chr_file { rw_term_perms lock append };
|
2005-04-27 21:56:12 +00:00
|
|
|
')
|
|
|
|
|
2005-05-09 15:38:06 +00:00
|
|
|
########################################
|
2005-08-17 14:14:07 +00:00
|
|
|
## <summary>
|
2005-10-21 21:35:25 +00:00
|
|
|
## Do not audit attempts to read and
|
|
|
|
## write the init script pty.
|
2005-08-17 14:14:07 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-21 21:35:25 +00:00
|
|
|
## Domain to not audit.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-08-17 14:14:07 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_dontaudit_use_script_ptys',`
|
2005-08-17 14:14:07 +00:00
|
|
|
gen_require(`
|
2005-10-21 21:35:25 +00:00
|
|
|
type initrc_devpts_t;
|
2005-08-17 14:14:07 +00:00
|
|
|
')
|
|
|
|
|
2005-10-21 21:35:25 +00:00
|
|
|
dontaudit $1 initrc_devpts_t:chr_file { rw_term_perms lock append };
|
2005-08-17 14:14:07 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-10-21 21:35:25 +00:00
|
|
|
## <summary>
|
|
|
|
## Read init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-21 21:35:25 +00:00
|
|
|
## </param>
|
2005-05-09 15:38:06 +00:00
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`init_read_script_files',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
2005-10-21 21:35:25 +00:00
|
|
|
type initrc_exec_t;
|
2005-06-17 17:59:26 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-10-21 21:35:25 +00:00
|
|
|
files_search_etc($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 initrc_exec_t:file read_file_perms;
|
2005-05-09 15:38:06 +00:00
|
|
|
')
|
|
|
|
|
2006-05-29 14:16:22 +00:00
|
|
|
########################################
|
2006-11-13 03:24:07 +00:00
|
|
|
## <summary>
|
|
|
|
## Get the attributes of init script
|
|
|
|
## status files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_getattr_script_status_files',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_state_t;
|
|
|
|
')
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
getattr_files_pattern($1,initrc_state_t,initrc_state_t)
|
2006-11-13 03:24:07 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2006-05-29 14:16:22 +00:00
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to read init script
|
|
|
|
## status files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_dontaudit_read_script_status_files',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_state_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 initrc_state_t:dir search_dir_perms;
|
|
|
|
dontaudit $1 initrc_state_t:file read_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2005-06-24 20:37:09 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Read and write init script temporary data.
|
2005-06-24 20:37:09 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-08 22:00:30 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## </param>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_rw_script_tmp_files',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
2005-09-21 20:01:40 +00:00
|
|
|
type initrc_tmp_t;
|
2005-06-17 17:59:26 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-09-21 20:01:40 +00:00
|
|
|
files_search_tmp($1)
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 initrc_tmp_t:file rw_file_perms;
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-11-25 19:09:08 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create files in a init script
|
|
|
|
## temporary data directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-25 19:09:08 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-11-25 19:09:08 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="file_type">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-11-25 19:09:08 +00:00
|
|
|
## The type of the object to be created
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-11-25 19:09:08 +00:00
|
|
|
## </param>
|
2006-03-02 23:41:11 +00:00
|
|
|
## <param name="object_class">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-03-02 23:41:11 +00:00
|
|
|
## The object class.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-11-25 19:09:08 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-21 18:40:44 +00:00
|
|
|
interface(`init_script_tmp_filetrans',`
|
2005-11-25 19:09:08 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_tmp_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_tmp($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
filetrans_pattern($1,initrc_tmp_t,$2,$3)
|
2005-11-25 19:09:08 +00:00
|
|
|
')
|
|
|
|
|
2005-10-21 15:38:22 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Get the attributes of init script process id files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-21 15:38:22 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-21 15:38:22 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-01-18 18:08:39 +00:00
|
|
|
interface(`init_getattr_utmp',`
|
2005-10-21 15:38:22 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_var_run_t:file getattr;
|
|
|
|
')
|
|
|
|
|
2005-08-15 19:31:37 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Read utmp.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2006-01-18 18:08:39 +00:00
|
|
|
interface(`init_read_utmp',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_list_pids($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 initrc_var_run_t:file read_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-13 14:37:13 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to write utmp.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-05-13 14:37:13 +00:00
|
|
|
#
|
2006-01-18 18:08:39 +00:00
|
|
|
interface(`init_dontaudit_write_utmp',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 initrc_var_run_t:file { write lock };
|
2005-05-13 14:37:13 +00:00
|
|
|
')
|
|
|
|
|
2006-03-31 22:09:27 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Write to utmp.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_write_utmp',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_list_pids($1)
|
|
|
|
allow $1 initrc_var_run_t:file { getattr write };
|
|
|
|
')
|
|
|
|
|
2006-01-06 19:46:44 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to lock
|
|
|
|
## init script pid files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-06 19:46:44 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-06 19:46:44 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-01-18 18:08:39 +00:00
|
|
|
interface(`init_dontaudit_lock_utmp',`
|
2006-01-06 19:46:44 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 initrc_var_run_t:file lock;
|
|
|
|
')
|
|
|
|
|
2005-05-03 20:23:33 +00:00
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Read and write utmp.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-05-03 20:23:33 +00:00
|
|
|
#
|
2006-01-18 18:08:39 +00:00
|
|
|
interface(`init_rw_utmp',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_list_pids($1)
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 initrc_var_run_t:file rw_file_perms;
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2006-05-10 18:09:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to read and write utmp.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2005-05-03 20:23:33 +00:00
|
|
|
#
|
2006-01-18 18:08:39 +00:00
|
|
|
interface(`init_dontaudit_rw_utmp',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 initrc_var_run_t:file { getattr read write append };
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|
|
|
|
|
2006-01-18 16:40:04 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2006-01-18 18:08:39 +00:00
|
|
|
## Create, read, write, and delete utmp.
|
2006-01-18 16:40:04 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-18 16:40:04 +00:00
|
|
|
## Domain access allowed.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-18 16:40:04 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_manage_utmp',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_pids($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 initrc_var_run_t:file manage_file_perms;
|
2006-01-18 16:40:04 +00:00
|
|
|
')
|