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">
|
|
|
|
## Type to be used as a domain.
|
|
|
|
## </param>
|
|
|
|
## <param name="entry_point">
|
|
|
|
## Type of the program to be used as an entry point to this domain.
|
|
|
|
## </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;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
class process sigchld;
|
|
|
|
')
|
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;
|
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
domain_auto_trans(init_t,$2,$1)
|
2005-05-31 21:25:45 +00:00
|
|
|
|
|
|
|
allow $1 init_t:fd use;
|
|
|
|
allow init_t $1:fd use;
|
|
|
|
allow $1 init_t:fifo_file rw_file_perms;
|
|
|
|
allow $1 init_t:process sigchld;
|
|
|
|
|
|
|
|
# Red Hat systems seem to have a stray
|
|
|
|
# fd open from the initrd
|
|
|
|
optional_policy(`distro_redhat',`
|
2005-06-10 01:01:13 +00:00
|
|
|
kernel_dontaudit_use_fd($1)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_read_root_file($1)
|
2005-05-31 21:25:45 +00:00
|
|
|
')
|
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">
|
|
|
|
## Type to be used as a domain.
|
|
|
|
## </param>
|
|
|
|
## <param name="entry_point">
|
|
|
|
## Type of the program to be used as an entry point to this domain.
|
|
|
|
## </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;
|
|
|
|
')
|
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;
|
|
|
|
|
2005-07-07 15:25:28 +00:00
|
|
|
ifdef(`direct_sysadm_daemon',`
|
|
|
|
domain_auto_trans(direct_run_init,$2,$1)
|
|
|
|
|
|
|
|
allow direct_run_init $1:fd use;
|
|
|
|
allow direct_run_init $1:process { noatsecure siginh rlimitinh };
|
|
|
|
allow $1 direct_run_init:fd use;
|
|
|
|
allow $1 direct_run_init:fifo_file rw_file_perms;
|
|
|
|
allow $1 direct_run_init:process sigchld;
|
|
|
|
|
|
|
|
typeattribute $1 direct_init;
|
|
|
|
typeattribute $2 direct_init_entry;
|
|
|
|
')
|
|
|
|
|
2005-05-31 21:25:45 +00:00
|
|
|
# Red Hat systems seem to have a stray
|
|
|
|
# fd open from the initrd
|
2005-09-15 21:03:29 +00:00
|
|
|
ifdef(`distro_redhat',`
|
2005-06-10 01:01:13 +00:00
|
|
|
kernel_dontaudit_use_fd($1)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_read_root_file($1)
|
2005-05-31 21:25:45 +00:00
|
|
|
')
|
2005-09-15 21:03:29 +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-09-29 20:59:00 +00:00
|
|
|
bool regexp($1, `\(\w+\)_t', `\1_disable_trans') false;
|
|
|
|
if(! regexp($1, `\(\w+\)_t', `\1_disable_trans') ) {
|
2005-09-27 20:17:50 +00:00
|
|
|
domain_auto_trans(initrc_t,$2,$1)
|
|
|
|
allow initrc_t $1:fd use;
|
|
|
|
allow $1 initrc_t:fd use;
|
|
|
|
allow $1 initrc_t:fifo_file rw_file_perms;
|
|
|
|
allow $1 initrc_t:process sigchld;
|
2005-10-21 22:56:41 +00:00
|
|
|
dontaudit initrc_t $1:process { noatsecure siginh rlimitinh };
|
2005-09-27 20:17:50 +00:00
|
|
|
} else {
|
|
|
|
can_exec(initrc_t,$2)
|
|
|
|
can_exec(direct_run_init,$2)
|
|
|
|
}
|
|
|
|
',`
|
|
|
|
domain_auto_trans(initrc_t,$2,$1)
|
|
|
|
allow initrc_t $1:fd use;
|
|
|
|
allow $1 initrc_t:fd use;
|
|
|
|
allow $1 initrc_t:fifo_file rw_file_perms;
|
|
|
|
allow $1 initrc_t:process sigchld;
|
2005-10-21 22:56:41 +00:00
|
|
|
dontaudit initrc_t $1:process { noatsecure siginh rlimitinh };
|
2005-09-27 20:17:50 +00:00
|
|
|
')
|
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
optional_policy(`nscd.te',`
|
|
|
|
nscd_use_socket($1)
|
|
|
|
')
|
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">
|
|
|
|
## Type to be used as a domain.
|
|
|
|
## </param>
|
|
|
|
## <param name="entry_point">
|
|
|
|
## Type of the program to be used as an entry point to this domain.
|
|
|
|
## </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;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
class process sigchld;
|
|
|
|
')
|
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;
|
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
domain_auto_trans(initrc_t,$2,$1)
|
2005-05-31 23:02:11 +00:00
|
|
|
|
|
|
|
allow initrc_t $1:fd use;
|
|
|
|
allow $1 initrc_t:fd use;
|
|
|
|
allow $1 initrc_t:fifo_file rw_file_perms;
|
|
|
|
allow $1 initrc_t:process sigchld;
|
|
|
|
|
|
|
|
# Red Hat systems seem to have a stray
|
|
|
|
# fd open from the initrd
|
|
|
|
optional_policy(`distro_redhat',`
|
2005-06-10 01:01:13 +00:00
|
|
|
kernel_dontaudit_use_fd($1)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_read_root_file($1)
|
2005-05-31 23:02:11 +00:00
|
|
|
')
|
2005-05-13 20:21:50 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_domtrans(domain)
|
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;
|
|
|
|
class process sigchld;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
domain_auto_trans($1,init_exec_t,init_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 init_t:fd use;
|
|
|
|
allow init_t $1:fd use;
|
|
|
|
allow init_t $1:fifo_file rw_file_perms;
|
|
|
|
allow init_t $1:process sigchld;
|
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">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
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
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# init_get_process_group(domain)
|
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_get_process_group',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
|
|
|
class process getpgid;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 init_t:process getpgid;
|
2005-05-09 15:38:06 +00:00
|
|
|
')
|
|
|
|
|
2005-04-28 21:41:09 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_getattr_initctl(domain)
|
2005-04-28 21:41:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_getattr_initctl',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
class fifo_file getattr;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 initctl_t:fifo_file getattr;
|
2005-04-28 21:41:09 +00:00
|
|
|
')
|
|
|
|
|
2005-05-26 20:38:45 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_dontaudit_getattr_initctl(domain)
|
2005-05-26 20:38:45 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_dontaudit_getattr_initctl',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
class fifo_file getattr;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 initctl_t:fifo_file getattr;
|
2005-05-26 20:38:45 +00:00
|
|
|
')
|
|
|
|
|
2005-06-28 17:32:57 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# init_write_initctl(domain)
|
|
|
|
#
|
|
|
|
interface(`init_write_initctl',`
|
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
class fifo_file write;
|
|
|
|
')
|
|
|
|
|
|
|
|
dev_list_all_dev_nodes($1)
|
|
|
|
allow $1 initctl_t:fifo_file write;
|
|
|
|
')
|
|
|
|
|
2005-05-02 18:40:05 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_use_initctl(domain)
|
2005-05-02 18:40:05 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_use_initctl',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_list_all_dev_nodes($1)
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 initctl_t:fifo_file rw_file_perms;
|
2005-05-02 18:40:05 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_dontaudit_use_initctl(domain)
|
2005-05-02 18:40:05 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_dontaudit_use_initctl',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initctl_t;
|
|
|
|
class fifo_file { read write };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 initctl_t:fifo_file { read write };
|
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">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </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;
|
|
|
|
class process signull;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 init_t:process signull;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send init a SIGCHLD signal.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </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;
|
|
|
|
class process sigchld;
|
|
|
|
')
|
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
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_use_fd(domain)
|
2005-04-27 21:56:12 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_use_fd',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
|
|
|
class fd use;
|
|
|
|
')
|
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
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_dontaudit_use_fd(domain)
|
2005-04-28 19:50:58 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_dontaudit_use_fd',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
|
|
|
class fd use;
|
|
|
|
')
|
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>
|
|
|
|
## Send UDP network traffic to init.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_udp_sendto',`
|
|
|
|
gen_require(`
|
|
|
|
type init_t;
|
|
|
|
class udp_socket { sendto recvfrom };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 init_t:udp_socket sendto;
|
|
|
|
allow init_t $1:udp_socket recvfrom;
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_domtrans_script(domain)
|
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;
|
|
|
|
class process sigchld;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
files_list_etc($1)
|
|
|
|
domain_auto_trans($1,initrc_exec_t,initrc_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 initrc_t:fd use;
|
|
|
|
allow initrc_t $1:fd use;
|
|
|
|
allow initrc_t $1:fifo_file rw_file_perms;
|
|
|
|
allow initrc_t $1:process sigchld;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
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">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## The role to be performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="terminal">
|
|
|
|
## The type of the terminal of the user.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_run_daemon',`
|
|
|
|
gen_require(`
|
|
|
|
attribute direct_run_init, direct_init, direct_init_entry;
|
|
|
|
role system_r;
|
|
|
|
class chr_file rw_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 direct_run_init;
|
|
|
|
role_transition $2 direct_init_entry system_r;
|
|
|
|
dontaudit direct_init $3:chr_file rw_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-09-23 19:38:34 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow the specified domain to connect to
|
|
|
|
## init scripts with a unix domain stream socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_unix_connect_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:unix_stream_socket connectto;
|
|
|
|
')
|
|
|
|
|
2005-08-17 14:14:07 +00:00
|
|
|
########################################
|
2005-10-10 18:50:08 +00:00
|
|
|
## <summary>
|
|
|
|
## Dont audit the specified domain connecting to
|
|
|
|
## init scripts with a unix domain stream socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_dontaudit_unix_connect_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
class unix_stream_socket connectto;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 initrc_t:unix_stream_socket connectto;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-08-17 14:14:07 +00:00
|
|
|
## <summary>
|
|
|
|
## Read init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_read_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_exec_t;
|
|
|
|
class file { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
files_list_etc($1)
|
|
|
|
allow $1 initrc_exec_t:file { getattr read };
|
|
|
|
')
|
|
|
|
|
2005-05-04 13:19:47 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_exec_script(domain)
|
2005-05-04 13:19:47 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_exec_script',`
|
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">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_read_script_process_state',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file r_file_perms;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
class process { getattr ptrace };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
#FIXME: search proc dir
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 initrc_t:dir r_dir_perms;
|
|
|
|
allow $1 initrc_t:{ file lnk_file } r_file_perms;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 initrc_t:process getattr;
|
|
|
|
|
|
|
|
# We need to suppress this denial because procps tries to access
|
|
|
|
# /proc/pid/environ and this now triggers a ptrace check in recent kernels
|
|
|
|
# (2.4 and 2.6). Might want to change procps to not do this, or only if
|
|
|
|
# running in a privileged domain.
|
|
|
|
dontaudit $1 initrc_t:process ptrace;
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-05-03 20:23:33 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_use_script_fd(domain)
|
2005-04-28 18:59:01 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_use_script_fd',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
class fd use;
|
|
|
|
')
|
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
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_dontaudit_use_script_fd(domain)
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_dontaudit_use_script_fd',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
class fd use;
|
|
|
|
')
|
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
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_get_script_process_group(domain)
|
2005-05-16 21:10:33 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_get_script_process_group',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
class process getpgid;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 initrc_t:process getpgid;
|
2005-05-16 21:10:33 +00:00
|
|
|
')
|
|
|
|
|
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">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-20 17:41:29 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_rw_script_pipe',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
class chr_file { read write };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:fifo_file { read write };
|
|
|
|
')
|
|
|
|
|
2005-06-24 20:37:09 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send UDP network traffic to init scripts.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_udp_sendto_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
class udp_socket { sendto recvfrom };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:udp_socket sendto;
|
|
|
|
allow initrc_t $1:udp_socket recvfrom;
|
|
|
|
')
|
|
|
|
|
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">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_unix_connect_script',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_t:unix_stream_socket connectto;
|
|
|
|
')
|
|
|
|
|
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">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-04-27 21:56:12 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_use_script_pty',`
|
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">
|
2005-10-21 21:35:25 +00:00
|
|
|
## Domain to not audit.
|
2005-08-17 14:14:07 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2005-10-21 21:35:25 +00:00
|
|
|
interface(`init_dontaudit_use_script_pty',`
|
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">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-09 15:38:06 +00:00
|
|
|
#
|
2005-10-21 21:35:25 +00:00
|
|
|
interface(`init_read_script_file',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
2005-10-21 21:35:25 +00:00
|
|
|
type initrc_exec_t;
|
|
|
|
class file r_file_perms;
|
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)
|
|
|
|
allow $1 initrc_exec_t:file r_file_perms;
|
2005-05-09 15:38:06 +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 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">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </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-10-21 15:38:22 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Get the attributes of init script process id files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`init_getattr_script_pids',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
class file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 initrc_var_run_t:file getattr;
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-08-15 19:31:37 +00:00
|
|
|
## <summary>
|
|
|
|
## List the contents of an init script
|
|
|
|
## process id directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
2005-08-15 19:35:20 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2005-08-15 19:31:37 +00:00
|
|
|
interface(`init_list_script_pids',`
|
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_pids($1)
|
|
|
|
allow $1 initrc_var_run_t:dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_read_script_pid(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_read_script_pid',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
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 r_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-13 14:37:13 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_dontaudit_write_script_pid(domain)
|
2005-05-13 14:37:13 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_dontaudit_write_script_pid',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
class file { write lock };
|
|
|
|
')
|
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
|
|
|
')
|
|
|
|
|
2005-05-03 20:23:33 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_rw_script_pid(domain)
|
2005-05-03 20:23:33 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_rw_script_pid',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
class file rw_file_perms;
|
|
|
|
')
|
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
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# init_dontaudit_rw_script_pid(domain)
|
2005-05-03 20:23:33 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`init_dontaudit_rw_script_pid',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type initrc_var_run_t;
|
|
|
|
class file rw_file_perms;
|
|
|
|
')
|
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
|
|
|
')
|
|
|
|
|