## The pcp command summarizes the status of a Performance Co-Pilot (PCP) installation
######################################
##
## Creates types and rules for a basic
## pcp daemon domain.
##
##
##
## Prefix for the domain.
##
##
#
template(`pcp_domain_template',`
gen_require(`
attribute pcp_domain;
')
type pcp_$1_t, pcp_domain;
type pcp_$1_exec_t;
init_daemon_domain(pcp_$1_t, pcp_$1_exec_t)
type pcp_$1_initrc_exec_t;
init_script_file(pcp_$1_initrc_exec_t)
auth_use_nsswitch(pcp_$1_t)
optional_policy(`
cron_system_entry(pcp_$1_t, pcp_$1_exec_t)
')
')
######################################
##
## Allow domain to read pcp lib files
##
##
##
## Prefix for the domain.
##
##
#
interface(`pcp_read_lib_files',`
gen_require(`
type pcp_var_lib_t;
')
files_search_var_lib($1)
read_files_pattern($1,pcp_var_lib_t,pcp_var_lib_t)
')
########################################
##
## All of the rules required to administrate
## an pcp environment
##
##
##
## Domain allowed access.
##
##
##
#
interface(`pcp_admin',`
gen_require(`
type pcp_pmcd_t;
type pcp_pmlogger_t;
type pcp_pmproxy_t;
type pcp_pmie_t;
type pcp_var_run_t;
')
allow $1 pcp_pmcd_t:process signal_perms;
ps_process_pattern($1, pcp_pmcd_t)
allow $1 pcp_pmlogger_t:process signal_perms;
ps_process_pattern($1, pcp_pmlogger_t)
allow $1 pcp_pmproxy_t:process signal_perms;
ps_process_pattern($1, pcp_pmproxy_t)
allow $1 pcp_pmie_t:process signal_perms;
ps_process_pattern($1, pcp_pmie_t)
tunable_policy(`deny_ptrace',`',`
allow $1 pcp_pmcd_t:process ptrace;
allow $1 pcp_pmlogger_t:process ptrace;
allow $1 pcp_pmproxy_t:process ptrace;
allow $1 pcp_pmie_t:process ptrace;
')
files_search_pids($1)
admin_pattern($1, pcp_var_run_t)
')
########################################
##
## Allow the specified domain to execute pcp_pmie
## in the caller domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`pcp_pmie_exec',`
gen_require(`
type pcp_pmie_exec_t;
')
corecmd_search_bin($1)
can_exec($1, pcp_pmie_exec_t)
')
########################################
##
## Allow the specified domain to execute pcp_pmlogger
## in the caller domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`pcp_pmlogger_exec',`
gen_require(`
type pcp_pmlogger_exec_t;
')
corecmd_search_bin($1)
can_exec($1, pcp_pmlogger_exec_t)
')
#######################################
##
## Transition to pcp named content
##
##
##
## Domain allowed access.
##
##
#
interface(`pcp_filetrans_named_content',`
gen_require(`
type pcp_var_run_t;
')
files_pid_filetrans($1, pcp_var_run_t, dir, "pcp")
')
#######################################
##
## Allow the specified domain to write to pcp sock file
##
##
##
## Domain allowed access.
##
##
#
interface(`pcp_write_pid_sock_file',`
gen_require(`
type pcp_var_run_t;
')
files_search_pids($1)
write_sock_files_pattern($1, pcp_var_run_t, pcp_var_run_t)
')