Dominick Grift ddf821
policy_module(cgroup, 1.0.0)
Dominick Grift ddf821
Dominick Grift ddf821
########################################
Dominick Grift ddf821
#
Chris PeBenito 53f9ab
# Declarations
Dominick Grift ddf821
#
Dominick Grift ddf821
Dominick Grift 61d7ee
type cgclear_t;
Dominick Grift 61d7ee
type cgclear_exec_t;
Dominick Grift 61d7ee
init_daemon_domain(cgclear_t, cgclear_exec_t)
Dominick Grift 61d7ee
Dominick Grift ddf821
type cgred_t;
Dominick Grift ddf821
type cgred_exec_t;
Dominick Grift ddf821
init_daemon_domain(cgred_t, cgred_exec_t)
Dominick Grift ddf821
Dominick Grift ddf821
type cgred_initrc_exec_t;
Dominick Grift ddf821
init_script_file(cgred_initrc_exec_t)
Dominick Grift ddf821
Dominick Grift ddf821
type cgred_var_run_t;
Dominick Grift ddf821
files_pid_file(cgred_var_run_t)
Dominick Grift ddf821
Dominick Grift ddf821
type cgrules_etc_t;
Dominick Grift ddf821
files_config_file(cgrules_etc_t)
Dominick Grift ddf821
Chris PeBenito 53f9ab
type cgconfig_t;
Chris PeBenito 53f9ab
type cgconfig_exec_t;
Chris PeBenito 53f9ab
init_daemon_domain(cgconfig_t, cgconfig_exec_t)
Dominick Grift ddf821
Dominick Grift ddf821
type cgconfig_initrc_exec_t;
Dominick Grift ddf821
init_script_file(cgconfig_initrc_exec_t)
Dominick Grift ddf821
Dominick Grift ddf821
type cgconfig_etc_t;
Dominick Grift ddf821
files_config_file(cgconfig_etc_t)
Dominick Grift ddf821
Dominick Grift ddf821
########################################
Dominick Grift ddf821
#
Dominick Grift 61d7ee
# cgclear personal policy.
Dominick Grift 61d7ee
#
Dominick Grift 61d7ee
Dominick Grift 61d7ee
allow cgclear_t self:capability sys_admin;
Dominick Grift 61d7ee
Dominick Grift 61d7ee
kernel_read_system_state(cgclear_t)
Dominick Grift 61d7ee
Dominick Grift 61d7ee
domain_setpriority_all_domains(cgclear_t)
Dominick Grift 61d7ee
Dominick Grift 61d7ee
fs_manage_cgroup_dirs(cgclear_t)
Dominick Grift 61d7ee
fs_manage_cgroup_files(cgclear_t)
Dominick Grift 61d7ee
fs_unmount_cgroup(cgclear_t)
Dominick Grift 61d7ee
Dominick Grift 61d7ee
########################################
Dominick Grift 61d7ee
#
Chris PeBenito 53f9ab
# cgconfig personal policy.
Chris PeBenito 53f9ab
#
Chris PeBenito 53f9ab
Chris PeBenito 53f9ab
allow cgconfig_t self:capability { chown sys_admin };
Chris PeBenito 53f9ab
Chris PeBenito 53f9ab
allow cgconfig_t cgconfig_etc_t:file read_file_perms;
Chris PeBenito 53f9ab
Dominick Grift 61d7ee
# search will do.
Chris PeBenito 53f9ab
kernel_list_unlabeled(cgconfig_t)
Chris PeBenito 53f9ab
kernel_read_system_state(cgconfig_t)
Chris PeBenito 53f9ab
Dominick Grift 61d7ee
# /etc/nsswitch.conf, /etc/passwd
Chris PeBenito 53f9ab
files_read_etc_files(cgconfig_t)
Chris PeBenito 53f9ab
Chris PeBenito 53f9ab
fs_manage_cgroup_dirs(cgconfig_t)
Chris PeBenito 53f9ab
fs_manage_cgroup_files(cgconfig_t)
Chris PeBenito 53f9ab
fs_mount_cgroup(cgconfig_t)
Chris PeBenito 53f9ab
fs_mounton_cgroup(cgconfig_t)
Chris PeBenito 53f9ab
Chris PeBenito 53f9ab
########################################
Chris PeBenito 53f9ab
#
Dominick Grift ddf821
# cgred personal policy.
Dominick Grift ddf821
#
Dominick Grift ddf821
Dominick Grift 61d7ee
allow cgred_t self:capability { net_admin sys_admin sys_ptrace dac_override };
Dominick Grift ddf821
allow cgred_t self:netlink_socket { write bind create read };
Dominick Grift ddf821
allow cgred_t self:unix_dgram_socket { write create connect };
Dominick Grift ddf821
Dominick Grift ddf821
allow cgred_t cgrules_etc_t:file read_file_perms;
Dominick Grift ddf821
Chris PeBenito d687db
# rc script creates pid file
Dominick Grift 61d7ee
manage_files_pattern(cgred_t, cgred_var_run_t, cgred_var_run_t)
Dominick Grift ddf821
manage_sock_files_pattern(cgred_t, cgred_var_run_t, cgred_var_run_t)
Dominick Grift 61d7ee
files_pid_filetrans(cgred_t, cgred_var_run_t, { file sock_file })
Dominick Grift ddf821
Dominick Grift ddf821
kernel_read_system_state(cgred_t)
Dominick Grift ddf821
Dominick Grift ddf821
domain_read_all_domains_state(cgred_t)
Dominick Grift 61d7ee
domain_setpriority_all_domains(cgred_t)
Dominick Grift ddf821
Dominick Grift ddf821
files_getattr_all_files(cgred_t)
Dominick Grift ddf821
files_getattr_all_sockets(cgred_t)
Dominick Grift ddf821
files_read_all_symlinks(cgred_t)
Dominick Grift 61d7ee
# /etc/group
Dominick Grift ddf821
files_read_etc_files(cgred_t)
Dominick Grift ddf821
Dominick Grift ddf821
fs_write_cgroup_files(cgred_t)
Dominick Grift ddf821
Dominick Grift ddf821
logging_send_syslog_msg(cgred_t)
Dominick Grift ddf821
Dominick Grift ddf821
miscfiles_read_localization(cgred_t)