|
Dominick Grift |
ddf821 |
## <summary>libcg is a library that abstracts the control group file system in Linux.</summary>
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
########################################
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Execute a domain transition to run
|
|
Dominick Grift |
ddf821 |
## CG config parser.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## <param name="domain">
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Domain allowed to transition.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## </param>
|
|
Dominick Grift |
ddf821 |
#
|
|
Chris PeBenito |
53f9ab |
interface(`cgroup_domtrans_cgconfig',`
|
|
Dominick Grift |
ddf821 |
gen_require(`
|
|
Chris PeBenito |
53f9ab |
type cgconfig_t, cgconfig_exec_t;
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Chris PeBenito |
53f9ab |
domtrans_pattern($1, cgconfig_exec_t, cgconfig_t)
|
|
Dominick Grift |
ddf821 |
corecmd_search_bin($1)
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
########################################
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Execute a domain transition to run
|
|
Dominick Grift |
ddf821 |
## CG config parser.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## <param name="domain">
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Domain allowed to transition.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## </param>
|
|
Dominick Grift |
ddf821 |
#
|
|
Chris PeBenito |
53f9ab |
interface(`cgroup_initrc_domtrans_cgconfig',`
|
|
Dominick Grift |
ddf821 |
gen_require(`
|
|
Dominick Grift |
ddf821 |
type cgconfig_initrc_exec_t;
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
files_search_etc($1)
|
|
Dominick Grift |
ddf821 |
init_labeled_script_domtrans($1, cgconfig_initrc_exec_t)
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
########################################
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Execute a domain transition to run
|
|
Dominick Grift |
ddf821 |
## CG rules engine daemon.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## <param name="domain">
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Domain allowed to transition.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## </param>
|
|
Dominick Grift |
ddf821 |
#
|
|
Dominick Grift |
ddf821 |
interface(`cgroup_domtrans_cgred',`
|
|
Dominick Grift |
ddf821 |
gen_require(`
|
|
Dominick Grift |
ddf821 |
type cgred_t, cgred_exec_t;
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
domtrans_pattern($1, cgred_exec_t, cgred_t)
|
|
Dominick Grift |
ddf821 |
corecmd_search_bin($1)
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
########################################
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Execute a domain transition to run
|
|
Dominick Grift |
ddf821 |
## CG rules engine daemon.
|
|
Dominick Grift |
ddf821 |
## domain.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## <param name="domain">
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Domain allowed to transition.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## </param>
|
|
Dominick Grift |
ddf821 |
#
|
|
Dominick Grift |
ddf821 |
interface(`cgroup_initrc_domtrans_cgred',`
|
|
Dominick Grift |
ddf821 |
gen_require(`
|
|
Dominick Grift |
ddf821 |
type cgred_initrc_exec_t;
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
init_labeled_script_domtrans($1, cgred_initrc_exec_t)
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
########################################
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Connect to CG rules engine daemon
|
|
Dominick Grift |
ddf821 |
## over unix stream sockets.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## <param name="domain">
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Domain allowed access.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## </param>
|
|
Dominick Grift |
ddf821 |
#
|
|
Dominick Grift |
ddf821 |
interface(`cgroup_stream_connect', `
|
|
Dominick Grift |
ddf821 |
gen_require(`
|
|
Dominick Grift |
ddf821 |
type cgred_var_run_t, cgred_t;
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
stream_connect_pattern($1, cgred_var_run_t, cgred_var_run_t, cgred_t)
|
|
Dominick Grift |
ddf821 |
files_search_pids($1)
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
########################################
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Chris PeBenito |
04dcd7 |
## All of the rules required to administrate
|
|
Dominick Grift |
ddf821 |
## an cgroup environment.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## <param name="domain">
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Domain allowed access.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## </param>
|
|
Dominick Grift |
ddf821 |
## <param name="role">
|
|
Dominick Grift |
ddf821 |
## <summary>
|
|
Dominick Grift |
ddf821 |
## Role allowed access.
|
|
Dominick Grift |
ddf821 |
## </summary>
|
|
Dominick Grift |
ddf821 |
## </param>
|
|
Dominick Grift |
ddf821 |
## <rolecap/>
|
|
Dominick Grift |
ddf821 |
#
|
|
Dominick Grift |
ddf821 |
interface(`cgroup_admin',`
|
|
Dominick Grift |
ddf821 |
gen_require(`
|
|
Chris PeBenito |
53f9ab |
type cgred_t, cgconfig_t, cgred_var_run_t;
|
|
Dominick Grift |
ddf821 |
type cgconfig_etc_t, cgconfig_initrc_exec_t, cgred_initrc_exec_t;
|
|
Chris PeBenito |
0041a7 |
type cgred_etc_t;
|
|
Dominick Grift |
ddf821 |
')
|
|
Dominick Grift |
ddf821 |
|
|
Chris PeBenito |
53f9ab |
allow $1 cgconfig_t:process { ptrace signal_perms getattr };
|
|
Chris PeBenito |
53f9ab |
read_files_pattern($1, cgconfig_t, cgconfig_t)
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
allow $1 cgred_t:process { ptrace signal_perms getattr };
|
|
Dominick Grift |
ddf821 |
read_files_pattern($1, cgred_t, cgred_t)
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
admin_pattern($1, cgconfig_etc_t)
|
|
Dominick Grift |
ddf821 |
admin_pattern($1, cgred_etc_t)
|
|
Dominick Grift |
ddf821 |
files_search_etc($1)
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
admin_pattern($1, cgred_var_run_t)
|
|
Dominick Grift |
ddf821 |
files_search_pids($1)
|
|
Dominick Grift |
ddf821 |
|
|
Chris PeBenito |
53f9ab |
cgroup_initrc_domtrans_cgconfig($1)
|
|
Dominick Grift |
ddf821 |
domain_system_change_exemption($1)
|
|
Dominick Grift |
ddf821 |
role_transition $2 cgconfig_initrc_exec_t system_r;
|
|
Dominick Grift |
ddf821 |
allow $2 system_r;
|
|
Dominick Grift |
ddf821 |
|
|
Dominick Grift |
ddf821 |
cgroup_initrc_domtrans_cgred($1)
|
|
Dominick Grift |
ddf821 |
role_transition $2 cgred_initrc_exec_t system_r;
|
|
Dominick Grift |
ddf821 |
')
|