|
Chris PeBenito |
e32d52 |
## <module name="init" layer="system">
|
|
Chris PeBenito |
e32d52 |
## <summary>System initialization programs (init and init scripts).</summary>
|
|
Chris PeBenito |
e181fe |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
ff3138 |
# init_make_init_domain(domain,entrypointfile)
|
|
Chris PeBenito |
ff3138 |
#
|
|
Chris PeBenito |
ff3138 |
define(`init_make_init_domain',`
|
|
Chris PeBenito |
3b857e |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
domain_make_domain($1)
|
|
Chris PeBenito |
3b857e |
domain_make_entrypoint_file($1,$2)
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
role system_r types $1;
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
allow init_t $1:process transition;
|
|
Chris PeBenito |
3b857e |
allow init_t $2:file { getattr read execute };
|
|
Chris PeBenito |
3b857e |
dontaudit init_t $1:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
3b857e |
type_transition init_t $2:process $1;
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
allow $1 init_t:fd use;
|
|
Chris PeBenito |
3b857e |
allow init_t $1:fd use;
|
|
Chris PeBenito |
3b857e |
allow $1 init_t:fifo_file rw_file_perms;
|
|
Chris PeBenito |
3b857e |
allow $1 init_t:process sigchld;
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
# Red Hat systems seem to have a stray
|
|
Chris PeBenito |
3b857e |
# fd open from the initrd
|
|
Chris PeBenito |
3b857e |
optional_policy(`distro_redhat',`
|
|
Chris PeBenito |
3b857e |
kernel_ignore_use_file_descriptors($1)
|
|
Chris PeBenito |
3b857e |
files_ignore_read_rootfs_file($1)
|
|
Chris PeBenito |
3b857e |
')
|
|
Chris PeBenito |
ff3138 |
')
|
|
Chris PeBenito |
ff3138 |
|
|
Chris PeBenito |
ff3138 |
define(`init_make_init_domain_depend',`
|
|
Chris PeBenito |
3b857e |
type init_t;
|
|
Chris PeBenito |
3b857e |
class file { getattr read execute };
|
|
Chris PeBenito |
3b857e |
class fd use;
|
|
Chris PeBenito |
3b857e |
class fifo_file rw_file_perms;
|
|
Chris PeBenito |
3b857e |
class process { transition noatsecure siginh rlimitinh sigchld };
|
|
Chris PeBenito |
3b857e |
role system_r;
|
|
Chris PeBenito |
ff3138 |
')
|
|
Chris PeBenito |
ff3138 |
|
|
Chris PeBenito |
ff3138 |
########################################
|
|
Chris PeBenito |
ff3138 |
#
|
|
Chris PeBenito |
ff3138 |
# init_make_daemon_domain(domain,entrypointfile)
|
|
Chris PeBenito |
ff3138 |
#
|
|
Chris PeBenito |
ff3138 |
define(`init_make_daemon_domain',`
|
|
Chris PeBenito |
3b857e |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
domain_make_domain($1)
|
|
Chris PeBenito |
3b857e |
domain_make_entrypoint_file($1,$2)
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
role system_r types $1;
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
allow initrc_t $1:process transition;
|
|
Chris PeBenito |
3b857e |
allow initrc_t $2:file { getattr read execute };
|
|
Chris PeBenito |
3b857e |
dontaudit initrc_t $1:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
3b857e |
type_transition initrc_t $2:process $1;
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
allow initrc_t $1:fd use;
|
|
Chris PeBenito |
3b857e |
allow $1 initrc_t:fd use;
|
|
Chris PeBenito |
3b857e |
allow $1 initrc_t:fifo_file rw_file_perms;
|
|
Chris PeBenito |
3b857e |
allow $1 initrc_t:process sigchld;
|
|
Chris PeBenito |
3b857e |
|
|
Chris PeBenito |
3b857e |
# Red Hat systems seem to have a stray
|
|
Chris PeBenito |
3b857e |
# fd open from the initrd
|
|
Chris PeBenito |
3b857e |
optional_policy(`distro_redhat',`
|
|
Chris PeBenito |
3b857e |
kernel_ignore_use_file_descriptors($1)
|
|
Chris PeBenito |
3b857e |
files_ignore_read_rootfs_file($1)
|
|
Chris PeBenito |
3b857e |
')
|
|
Chris PeBenito |
ff3138 |
')
|
|
Chris PeBenito |
ff3138 |
|
|
Chris PeBenito |
ff3138 |
define(`init_make_daemon_domain_depend',`
|
|
Chris PeBenito |
d115b2 |
type initrc_t;
|
|
Chris PeBenito |
d115b2 |
|
|
Chris PeBenito |
d115b2 |
role system_r;
|
|
Chris PeBenito |
d115b2 |
|
|
Chris PeBenito |
d115b2 |
class file { getattr read execute };
|
|
Chris PeBenito |
d115b2 |
class fifo_file rw_file_perms;
|
|
Chris PeBenito |
d115b2 |
class fd use;
|
|
Chris PeBenito |
d115b2 |
class process { transition noatsecure siginh rlimitinh sigchld };
|
|
Chris PeBenito |
ff3138 |
')
|
|
Chris PeBenito |
ff3138 |
|
|
Chris PeBenito |
ff3138 |
########################################
|
|
Chris PeBenito |
ff3138 |
#
|
|
Chris PeBenito |
ff3138 |
# init_make_system_domain(domain,entrypointfile)
|
|
Chris PeBenito |
ff3138 |
#
|
|
Chris PeBenito |
ff3138 |
define(`init_make_system_domain',`
|
|
Chris PeBenito |
d115b2 |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
d115b2 |
|
|
Chris PeBenito |
d115b2 |
domain_make_domain($1)
|
|
Chris PeBenito |
d115b2 |
domain_make_entrypoint_file($1,$2)
|
|
Chris PeBenito |
d115b2 |
|
|
Chris PeBenito |
d115b2 |
role system_r types $1;
|
|
Chris PeBenito |
d115b2 |
|
|
Chris PeBenito |
d115b2 |
allow initrc_t $1:process transition;
|
|
Chris PeBenito |
d115b2 |
allow initrc_t $2:file { getattr read execute };
|
|
Chris PeBenito |
d115b2 |
dontaudit initrc_t $1:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
d115b2 |
type_transition initrc_t $2:process $1;
|
|
Chris PeBenito |
d115b2 |
|
|
Chris PeBenito |
d115b2 |
allow initrc_t $1:fd use;
|
|
Chris PeBenito |
d115b2 |
allow $1 initrc_t:fd use;
|
|
Chris PeBenito |
d115b2 |
allow $1 initrc_t:fifo_file rw_file_perms;
|
|
Chris PeBenito |
d115b2 |
allow $1 initrc_t:process sigchld;
|
|
Chris PeBenito |
d115b2 |
|
|
Chris PeBenito |
d115b2 |
# Red Hat systems seem to have a stray
|
|
Chris PeBenito |
d115b2 |
# fd open from the initrd
|
|
Chris PeBenito |
d115b2 |
optional_policy(`distro_redhat',`
|
|
Chris PeBenito |
d115b2 |
kernel_ignore_use_file_descriptors($1)
|
|
Chris PeBenito |
d115b2 |
files_ignore_read_rootfs_file($1)
|
|
Chris PeBenito |
d115b2 |
')
|
|
Chris PeBenito |
ff3138 |
')
|
|
Chris PeBenito |
ff3138 |
|
|
Chris PeBenito |
ff3138 |
define(`init_make_system_domain_depend',`
|
|
Chris PeBenito |
d115b2 |
type initrc_t;
|
|
Chris PeBenito |
d115b2 |
role system_r;
|
|
Chris PeBenito |
d115b2 |
|
|
Chris PeBenito |
d115b2 |
class file { getattr read execute };
|
|
Chris PeBenito |
d115b2 |
class fd use;
|
|
Chris PeBenito |
d115b2 |
class fifo_file rw_file_perms;
|
|
Chris PeBenito |
d115b2 |
class process { transition noatsecure siginh rlimitinh sigchld };
|
|
Chris PeBenito |
ff3138 |
')
|
|
Chris PeBenito |
ff3138 |
|
|
Chris PeBenito |
ff3138 |
########################################
|
|
Chris PeBenito |
ff3138 |
#
|
|
Chris PeBenito |
3ce6cb |
# init_transition(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`init_transition',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 init_exec_t:file { getattr read execute };
|
|
Chris PeBenito |
0c73cd |
allow $1 init_t:process transition;
|
|
Chris PeBenito |
0c73cd |
type_transition $1 init_exec_t:process init_t;
|
|
Chris PeBenito |
0c73cd |
dontaudit $1 init_t:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 init_t:fd use;
|
|
Chris PeBenito |
0c73cd |
allow init_t $1:fd use;
|
|
Chris PeBenito |
0c73cd |
allow init_t $1:fifo_file rw_file_perms;
|
|
Chris PeBenito |
0c73cd |
allow init_t $1:process sigchld;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`init_transition_depend',`
|
|
Chris PeBenito |
0c73cd |
type init_t, init_exec_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { getattr read execute };
|
|
Chris PeBenito |
0c73cd |
class process { transition noatsecure siginh rlimitinh sigchld };
|
|
Chris PeBenito |
0c73cd |
class fd use;
|
|
Chris PeBenito |
0c73cd |
class fifo_file rw_file_perms;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
5d7e8b |
# init_get_process_group(domain)
|
|
Chris PeBenito |
5d7e8b |
#
|
|
Chris PeBenito |
5d7e8b |
define(`init_get_process_group',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 init_t:process getpgid;
|
|
Chris PeBenito |
5d7e8b |
')
|
|
Chris PeBenito |
5d7e8b |
|
|
Chris PeBenito |
5d7e8b |
define(`init_get_process_group_depend',`
|
|
Chris PeBenito |
0c73cd |
type init_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class process getpgid;
|
|
Chris PeBenito |
5d7e8b |
')
|
|
Chris PeBenito |
5d7e8b |
|
|
Chris PeBenito |
5d7e8b |
########################################
|
|
Chris PeBenito |
5d7e8b |
#
|
|
Chris PeBenito |
3ce6cb |
# init_get_control_channel_attributes(domain)
|
|
Chris PeBenito |
a2d824 |
#
|
|
Chris PeBenito |
a2d824 |
define(`init_get_control_channel_attributes',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 initctl_t:fifo_file getattr;
|
|
Chris PeBenito |
a2d824 |
')
|
|
Chris PeBenito |
a2d824 |
|
|
Chris PeBenito |
a2d824 |
define(`init_get_control_channel_attributes_depend',`
|
|
Chris PeBenito |
0c73cd |
type initctl_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class fifo_file getattr;
|
|
Chris PeBenito |
a2d824 |
')
|
|
Chris PeBenito |
a2d824 |
|
|
Chris PeBenito |
a2d824 |
########################################
|
|
Chris PeBenito |
a2d824 |
#
|
|
Chris PeBenito |
d490eb |
# init_ignore_get_control_channel_attributes(domain)
|
|
Chris PeBenito |
d490eb |
#
|
|
Chris PeBenito |
d490eb |
define(`init_ignore_get_control_channel_attributes',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
dontaudit $1 initctl_t:fifo_file getattr;
|
|
Chris PeBenito |
d490eb |
')
|
|
Chris PeBenito |
d490eb |
|
|
Chris PeBenito |
d490eb |
define(`init_get_control_channel_attributes_depend',`
|
|
Chris PeBenito |
0c73cd |
type initctl_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class fifo_file getattr;
|
|
Chris PeBenito |
d490eb |
')
|
|
Chris PeBenito |
d490eb |
|
|
Chris PeBenito |
d490eb |
########################################
|
|
Chris PeBenito |
d490eb |
#
|
|
Chris PeBenito |
d0b6ab |
# init_use_control_channel(domain)
|
|
Chris PeBenito |
d0b6ab |
#
|
|
Chris PeBenito |
d0b6ab |
define(`init_use_control_channel',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
devices_list_device_nodes($1)
|
|
Chris PeBenito |
0c73cd |
allow $1 initctl_t:fifo_file { getattr read write };
|
|
Chris PeBenito |
d0b6ab |
')
|
|
Chris PeBenito |
d0b6ab |
|
|
Chris PeBenito |
d0b6ab |
define(`init_use_control_channel_depend',`
|
|
Chris PeBenito |
0c73cd |
type initctl_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class fifo_file { getattr read write };
|
|
Chris PeBenito |
d0b6ab |
')
|
|
Chris PeBenito |
d0b6ab |
|
|
Chris PeBenito |
d0b6ab |
########################################
|
|
Chris PeBenito |
d0b6ab |
#
|
|
Chris PeBenito |
d0b6ab |
# init_ignore_use_control_channel(domain)
|
|
Chris PeBenito |
d0b6ab |
#
|
|
Chris PeBenito |
d0b6ab |
define(`init_ignore_use_control_channel',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
dontaudit $1 initctl_t:fifo_file { read write };
|
|
Chris PeBenito |
d0b6ab |
')
|
|
Chris PeBenito |
d0b6ab |
|
|
Chris PeBenito |
d0b6ab |
define(`init_ignore_use_control_channel_depend',`
|
|
Chris PeBenito |
0c73cd |
type initctl_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class fifo_file { read write };
|
|
Chris PeBenito |
d0b6ab |
')
|
|
Chris PeBenito |
d0b6ab |
|
|
Chris PeBenito |
d0b6ab |
########################################
|
|
Chris PeBenito |
d0b6ab |
#
|
|
Chris PeBenito |
3ce6cb |
# init_sigchld(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`init_sigchld',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 init_t:process sigchld;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`init_sigchld_depend',`
|
|
Chris PeBenito |
0c73cd |
type init_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class process sigchld;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
3ce6cb |
# init_use_file_descriptors(domain)
|
|
Chris PeBenito |
889c9a |
#
|
|
Chris PeBenito |
889c9a |
define(`init_use_file_descriptors',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 init_t:fd use;
|
|
Chris PeBenito |
889c9a |
')
|
|
Chris PeBenito |
889c9a |
|
|
Chris PeBenito |
889c9a |
define(`init_use_file_descriptors_depend',`
|
|
Chris PeBenito |
0c73cd |
type init_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class fd use;
|
|
Chris PeBenito |
889c9a |
')
|
|
Chris PeBenito |
889c9a |
|
|
Chris PeBenito |
889c9a |
########################################
|
|
Chris PeBenito |
889c9a |
#
|
|
Chris PeBenito |
3ce6cb |
# init_ignore_use_file_descriptors(domain)
|
|
Chris PeBenito |
07efe9 |
#
|
|
Chris PeBenito |
07efe9 |
define(`init_ignore_use_file_descriptors',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
dontaudit $1 init_t:fd use;
|
|
Chris PeBenito |
07efe9 |
')
|
|
Chris PeBenito |
07efe9 |
|
|
Chris PeBenito |
07efe9 |
define(`init_ignore_use_file_descriptors_depend',`
|
|
Chris PeBenito |
0c73cd |
type init_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class fd use;
|
|
Chris PeBenito |
07efe9 |
')
|
|
Chris PeBenito |
07efe9 |
|
|
Chris PeBenito |
07efe9 |
########################################
|
|
Chris PeBenito |
07efe9 |
#
|
|
Chris PeBenito |
3ce6cb |
# init_script_transition(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
b4cd15 |
define(`init_script_transition',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_exec_t:file { getattr read execute };
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_t:process transition;
|
|
Chris PeBenito |
0c73cd |
type_transition $1 initrc_exec_t:process init_t;
|
|
Chris PeBenito |
0c73cd |
dontaudit $1 init_t:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_t:fd use;
|
|
Chris PeBenito |
0c73cd |
allow initrc_t $1:fd use;
|
|
Chris PeBenito |
0c73cd |
allow initrc_t $1:fifo_file rw_file_perms;
|
|
Chris PeBenito |
0c73cd |
allow initrc_t $1:process sigchld;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
define(`init_script_transition_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_t, initrc_exec_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { getattr read execute };
|
|
Chris PeBenito |
0c73cd |
class process { transition noatsecure siginh rlimitinh sigchld };
|
|
Chris PeBenito |
0c73cd |
class fd use;
|
|
Chris PeBenito |
0c73cd |
class fifo_file rw_file_perms;
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
b4cd15 |
########################################
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
bd202f |
# init_script_execute(domain)
|
|
Chris PeBenito |
bd202f |
#
|
|
Chris PeBenito |
bd202f |
define(`init_script_execute',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_exec_t:file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
bd202f |
')
|
|
Chris PeBenito |
bd202f |
|
|
Chris PeBenito |
bd202f |
define(`init_script_execute_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_exec_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
bd202f |
')
|
|
Chris PeBenito |
bd202f |
|
|
Chris PeBenito |
bd202f |
########################################
|
|
Chris PeBenito |
daa0e0 |
## <interface name="init_script_read_process_state">
|
|
Chris PeBenito |
daa0e0 |
## <description>
|
|
Chris PeBenito |
daa0e0 |
## Read the process state (/proc/pid) of the init scripts.
|
|
Chris PeBenito |
daa0e0 |
## </description>
|
|
Chris PeBenito |
daa0e0 |
## <parameter name="domain">
|
|
Chris PeBenito |
daa0e0 |
## The type of the process performing this action.
|
|
Chris PeBenito |
daa0e0 |
## </parameter>
|
|
Chris PeBenito |
daa0e0 |
## <infoflow type="read" weight="10"/>
|
|
Chris PeBenito |
daa0e0 |
## </interface>
|
|
Chris PeBenito |
daa0e0 |
#
|
|
Chris PeBenito |
daa0e0 |
define(`init_script_read_process_state',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_t:dir { search getattr read };
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_t:{ file lnk_file } { read getattr };
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_t:process getattr;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
# We need to suppress this denial because procps tries to access
|
|
Chris PeBenito |
0c73cd |
# /proc/pid/environ and this now triggers a ptrace check in recent kernels
|
|
Chris PeBenito |
0c73cd |
# (2.4 and 2.6). Might want to change procps to not do this, or only if
|
|
Chris PeBenito |
0c73cd |
# running in a privileged domain.
|
|
Chris PeBenito |
0c73cd |
dontaudit $1 initrc_t:process ptrace;
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
daa0e0 |
define(`init_script_read_process_state_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class dir { search getattr read };
|
|
Chris PeBenito |
0c73cd |
class file { read getattr };
|
|
Chris PeBenito |
0c73cd |
class lnk_file { read getattr };
|
|
Chris PeBenito |
0c73cd |
class process { getattr ptrace };
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
daa0e0 |
########################################
|
|
Chris PeBenito |
bd202f |
#
|
|
Chris PeBenito |
3ce6cb |
# init_script_use_file_descriptors(domain)
|
|
Chris PeBenito |
ee5772 |
#
|
|
Chris PeBenito |
ee5772 |
define(`init_script_use_file_descriptors',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_t:fd use;
|
|
Chris PeBenito |
ee5772 |
')
|
|
Chris PeBenito |
ee5772 |
|
|
Chris PeBenito |
ee5772 |
define(`init_script_use_file_descriptors_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class fd use;
|
|
Chris PeBenito |
ee5772 |
')
|
|
Chris PeBenito |
ee5772 |
|
|
Chris PeBenito |
ee5772 |
########################################
|
|
Chris PeBenito |
ee5772 |
#
|
|
Chris PeBenito |
daa0e0 |
# init_script_ignore_use_file_descriptors(domain)
|
|
Chris PeBenito |
daa0e0 |
#
|
|
Chris PeBenito |
daa0e0 |
define(`init_script_ignore_use_file_descriptors',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
dontaudit $1 initrc_t:fd use;
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
daa0e0 |
define(`init_script_ignore_use_file_descriptors_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class fd use;
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
daa0e0 |
########################################
|
|
Chris PeBenito |
daa0e0 |
#
|
|
Chris PeBenito |
b16c6b |
# init_script_get_process_group(domain)
|
|
Chris PeBenito |
b16c6b |
#
|
|
Chris PeBenito |
b16c6b |
define(`init_script_get_process_group',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_t:process getpgid;
|
|
Chris PeBenito |
b16c6b |
')
|
|
Chris PeBenito |
b16c6b |
|
|
Chris PeBenito |
b16c6b |
define(`init_script_get_process_group_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class process getpgid;
|
|
Chris PeBenito |
b16c6b |
')
|
|
Chris PeBenito |
b16c6b |
|
|
Chris PeBenito |
b16c6b |
########################################
|
|
Chris PeBenito |
b16c6b |
#
|
|
Chris PeBenito |
3ce6cb |
# init_script_use_pseudoterminal(domain)
|
|
Chris PeBenito |
889c9a |
#
|
|
Chris PeBenito |
889c9a |
define(`init_script_use_pseudoterminal',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
terminal_list_pseudoterminals($1)
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_devpts_t:chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
889c9a |
')
|
|
Chris PeBenito |
889c9a |
|
|
Chris PeBenito |
889c9a |
define(`init_script_use_pseudoterminal_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_devpts_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
889c9a |
')
|
|
Chris PeBenito |
889c9a |
|
|
Chris PeBenito |
889c9a |
########################################
|
|
Chris PeBenito |
889c9a |
#
|
|
Chris PeBenito |
b16c6b |
# init_script_ignore_use_pseudoterminal(domain)
|
|
Chris PeBenito |
5d7e8b |
#
|
|
Chris PeBenito |
b16c6b |
define(`init_script_ignore_use_pseudoterminal',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_devpts_t:chr_file { read write ioctl };
|
|
Chris PeBenito |
5d7e8b |
')
|
|
Chris PeBenito |
5d7e8b |
|
|
Chris PeBenito |
b16c6b |
define(`init_script_ignore_use_pseudoterminal_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_devpts_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class chr_file { read write ioctl };
|
|
Chris PeBenito |
5d7e8b |
')
|
|
Chris PeBenito |
5d7e8b |
|
|
Chris PeBenito |
5d7e8b |
########################################
|
|
Chris PeBenito |
daa0e0 |
## <interface name="init_script_modify_temporary_data">
|
|
Chris PeBenito |
daa0e0 |
## <description>
|
|
Chris PeBenito |
daa0e0 |
## Read and write init script temporary data.
|
|
Chris PeBenito |
daa0e0 |
## </description>
|
|
Chris PeBenito |
daa0e0 |
## <parameter name="domain">
|
|
Chris PeBenito |
daa0e0 |
## The type of the process performing this action.
|
|
Chris PeBenito |
daa0e0 |
## </parameter>
|
|
Chris PeBenito |
daa0e0 |
## <infoflow type="read" weight="10"/>
|
|
Chris PeBenito |
daa0e0 |
## </interface>
|
|
Chris PeBenito |
daa0e0 |
#
|
|
Chris PeBenito |
daa0e0 |
define(`init_script_modify_temporary_data',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
# FIXME: read tmp_t
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_tmp_t:file { getattr read write };
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
daa0e0 |
define(`init_script_modify_temporary_data_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_var_run_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { getattr read write };
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
daa0e0 |
########################################
|
|
Chris PeBenito |
5d7e8b |
#
|
|
Chris PeBenito |
3ce6cb |
# init_script_read_runtime_data(domain)
|
|
Chris PeBenito |
b4cd15 |
#
|
|
Chris PeBenito |
3ce6cb |
define(`init_script_read_runtime_data',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
files_read_runtime_data_directory($1)
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_var_run_t:file { getattr read lock };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
b4cd15 |
|
|
Chris PeBenito |
3ce6cb |
define(`init_script_read_runtime_data_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_var_run_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { getattr read lock };
|
|
Chris PeBenito |
3ce6cb |
')
|
|
Chris PeBenito |
3ce6cb |
|
|
Chris PeBenito |
3ce6cb |
########################################
|
|
Chris PeBenito |
3ce6cb |
#
|
|
Chris PeBenito |
7bba9d |
# init_script_ignore_write_runtime_data(domain)
|
|
Chris PeBenito |
7bba9d |
#
|
|
Chris PeBenito |
7bba9d |
define(`init_script_ignore_write_runtime_data',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
dontaudit $1 initrc_var_run_t:file { write lock };
|
|
Chris PeBenito |
7bba9d |
')
|
|
Chris PeBenito |
7bba9d |
|
|
Chris PeBenito |
7bba9d |
define(`init_script_ignore_write_runtime_data_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_var_run_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { write lock };
|
|
Chris PeBenito |
7bba9d |
')
|
|
Chris PeBenito |
7bba9d |
|
|
Chris PeBenito |
7bba9d |
########################################
|
|
Chris PeBenito |
7bba9d |
#
|
|
Chris PeBenito |
3ce6cb |
# init_script_modify_runtime_data(domain)
|
|
Chris PeBenito |
3ce6cb |
#
|
|
Chris PeBenito |
3ce6cb |
define(`init_script_modify_runtime_data',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
files_read_runtime_data_directory($1)
|
|
Chris PeBenito |
0c73cd |
allow $1 initrc_var_run_t:file { getattr read write append lock };
|
|
Chris PeBenito |
3ce6cb |
')
|
|
Chris PeBenito |
3ce6cb |
|
|
Chris PeBenito |
3ce6cb |
define(`init_script_modify_runtime_data_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_var_run_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { getattr read write append lock };
|
|
Chris PeBenito |
3ce6cb |
')
|
|
Chris PeBenito |
3ce6cb |
|
|
Chris PeBenito |
3ce6cb |
########################################
|
|
Chris PeBenito |
3ce6cb |
#
|
|
Chris PeBenito |
3ce6cb |
# init_script_ignore_modify_runtime_data(domain)
|
|
Chris PeBenito |
3ce6cb |
#
|
|
Chris PeBenito |
3ce6cb |
define(`init_script_ignore_modify_runtime_data',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
dontaudit $1 initrc_var_run_t:file { getattr read write append };
|
|
Chris PeBenito |
3ce6cb |
')
|
|
Chris PeBenito |
3ce6cb |
|
|
Chris PeBenito |
3ce6cb |
define(`init_script_ignore_modify_runtime_data_depend',`
|
|
Chris PeBenito |
0c73cd |
type initrc_var_run_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { getattr read write append };
|
|
Chris PeBenito |
b4cd15 |
')
|
|
Chris PeBenito |
e32d52 |
|
|
Chris PeBenito |
e32d52 |
## </module>
|