2010-06-07 18:23:45 +00:00
|
|
|
## <summary>libcg is a library that abstracts the control group file system in Linux.</summary>
|
|
|
|
|
2010-08-08 10:05:41 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute a domain transition to run
|
|
|
|
## CG Clear.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`cgroup_domtrans_cgclear',`
|
|
|
|
gen_require(`
|
|
|
|
type cgclear_t, cgclear_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
domtrans_pattern($1, cgclear_exec_t, cgclear_t)
|
|
|
|
corecmd_search_bin($1)
|
|
|
|
')
|
|
|
|
|
2010-06-07 18:23:45 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute a domain transition to run
|
|
|
|
## CG config parser.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2010-06-08 13:15:41 +00:00
|
|
|
interface(`cgroup_domtrans_cgconfig',`
|
2010-06-07 18:23:45 +00:00
|
|
|
gen_require(`
|
2010-06-08 13:15:41 +00:00
|
|
|
type cgconfig_t, cgconfig_exec_t;
|
2010-06-07 18:23:45 +00:00
|
|
|
')
|
|
|
|
|
2010-06-08 13:15:41 +00:00
|
|
|
domtrans_pattern($1, cgconfig_exec_t, cgconfig_t)
|
2010-06-07 18:23:45 +00:00
|
|
|
corecmd_search_bin($1)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute a domain transition to run
|
|
|
|
## CG config parser.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2010-06-08 13:15:41 +00:00
|
|
|
interface(`cgroup_initrc_domtrans_cgconfig',`
|
2010-06-07 18:23:45 +00:00
|
|
|
gen_require(`
|
|
|
|
type cgconfig_initrc_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
init_labeled_script_domtrans($1, cgconfig_initrc_exec_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute a domain transition to run
|
|
|
|
## CG rules engine daemon.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`cgroup_domtrans_cgred',`
|
|
|
|
gen_require(`
|
|
|
|
type cgred_t, cgred_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
domtrans_pattern($1, cgred_exec_t, cgred_t)
|
|
|
|
corecmd_search_bin($1)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute a domain transition to run
|
|
|
|
## CG rules engine daemon.
|
|
|
|
## domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`cgroup_initrc_domtrans_cgred',`
|
|
|
|
gen_require(`
|
|
|
|
type cgred_initrc_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
init_labeled_script_domtrans($1, cgred_initrc_exec_t)
|
|
|
|
')
|
|
|
|
|
2010-08-08 10:05:41 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute a domain transition to
|
|
|
|
## run CG Clear and allow the
|
|
|
|
## specified role the CG Clear
|
|
|
|
## domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## Role allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`cgroup_run_cgclear',`
|
|
|
|
gen_require(`
|
|
|
|
type cgclear_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
cgroup_domtrans_cgclear($1)
|
|
|
|
role $2 types cgclear_t;
|
|
|
|
')
|
|
|
|
|
2010-06-07 18:23:45 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Connect to CG rules engine daemon
|
|
|
|
## over unix stream sockets.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2010-08-08 10:05:41 +00:00
|
|
|
interface(`cgroup_stream_connect_cgred', `
|
2010-06-07 18:23:45 +00:00
|
|
|
gen_require(`
|
|
|
|
type cgred_var_run_t, cgred_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
stream_connect_pattern($1, cgred_var_run_t, cgred_var_run_t, cgred_t)
|
|
|
|
files_search_pids($1)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2010-06-08 12:47:26 +00:00
|
|
|
## All of the rules required to administrate
|
2010-06-07 18:23:45 +00:00
|
|
|
## an cgroup environment.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## Role allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`cgroup_admin',`
|
|
|
|
gen_require(`
|
2010-06-08 13:15:41 +00:00
|
|
|
type cgred_t, cgconfig_t, cgred_var_run_t;
|
2010-06-07 18:23:45 +00:00
|
|
|
type cgconfig_etc_t, cgconfig_initrc_exec_t, cgred_initrc_exec_t;
|
2010-08-08 10:05:41 +00:00
|
|
|
type cgrules_etc_t, cgclear_t, cgclear_exec_t;
|
2010-06-07 18:23:45 +00:00
|
|
|
')
|
|
|
|
|
2010-08-08 10:05:41 +00:00
|
|
|
allow $1 cgclear_t:process { ptrace signal_perms };
|
|
|
|
ps_process_pattern($1, cgclear_t)
|
2010-06-07 18:23:45 +00:00
|
|
|
|
2010-08-08 10:05:41 +00:00
|
|
|
allow $1 cgconfig_t:process { ptrace signal_perms };
|
|
|
|
ps_process_pattern($1, cgconfig_t)
|
|
|
|
|
|
|
|
allow $1 cgred_t:process { ptrace signal_perms };
|
|
|
|
ps_process_pattern($1, cgred_t)
|
2010-06-07 18:23:45 +00:00
|
|
|
|
|
|
|
admin_pattern($1, cgconfig_etc_t)
|
2010-06-29 12:24:22 +00:00
|
|
|
admin_pattern($1, cgrules_etc_t)
|
2010-06-07 18:23:45 +00:00
|
|
|
files_search_etc($1)
|
|
|
|
|
|
|
|
admin_pattern($1, cgred_var_run_t)
|
|
|
|
files_search_pids($1)
|
|
|
|
|
2010-06-08 13:15:41 +00:00
|
|
|
cgroup_initrc_domtrans_cgconfig($1)
|
2010-06-07 18:23:45 +00:00
|
|
|
domain_system_change_exemption($1)
|
|
|
|
role_transition $2 cgconfig_initrc_exec_t system_r;
|
|
|
|
allow $2 system_r;
|
|
|
|
|
|
|
|
cgroup_initrc_domtrans_cgred($1)
|
|
|
|
role_transition $2 cgred_initrc_exec_t system_r;
|
2010-08-08 10:05:41 +00:00
|
|
|
|
|
|
|
cgroup_run_cgclear($1, $2)
|
2010-06-07 18:23:45 +00:00
|
|
|
')
|