## Configuration management system.
########################################
##
## Execute puppetca in the puppetca
## domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`puppet_domtrans_puppetca',`
gen_require(`
type puppetca_t, puppetca_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, puppetca_exec_t, puppetca_t)
')
#####################################
##
## Execute puppetca in the puppetca
## domain and allow the specified
## role the puppetca domain.
##
##
##
## Domain allowed to transition.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`puppet_run_puppetca',`
gen_require(`
attribute_role puppetca_roles;
')
puppet_domtrans_puppetca($1)
roleattribute $2 puppetca_roles;
')
####################################
##
## Read puppet configuration content.
##
##
##
## Domain allowed access.
##
##
#
interface(`puppet_read_config',`
gen_require(`
type puppet_etc_t;
')
files_search_etc($1)
allow $1 puppet_etc_t:dir list_dir_perms;
allow $1 puppet_etc_t:file read_file_perms;
allow $1 puppet_etc_t:lnk_file read_lnk_file_perms;
')
################################################
##
## Read Puppet lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`puppet_read_lib_files',`
gen_require(`
type puppet_var_lib_t;
')
files_search_var_lib($1)
read_files_pattern($1, puppet_var_lib_t, puppet_var_lib_t)
')
###############################################
##
## Create, read, write, and delete
## puppet lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`puppet_manage_lib_files',`
gen_require(`
type puppet_var_lib_t;
')
files_search_var_lib($1)
manage_files_pattern($1, puppet_var_lib_t, puppet_var_lib_t)
')
#####################################
##
## Append puppet log files.
##
##
##
## Domain allowed access.
##
##
#
interface(`puppet_append_log_files',`
gen_require(`
type puppet_log_t;
')
logging_search_logs($1)
append_files_pattern($1, puppet_log_t, puppet_log_t)
')
#####################################
##
## Create puppet log files.
##
##
##
## Domain allowed access.
##
##
#
interface(`puppet_create_log_files',`
gen_require(`
type puppet_log_t;
')
logging_search_logs($1)
create_files_pattern($1, puppet_log_t, puppet_log_t)
')
#####################################
##
## Read puppet log files.
##
##
##
## Domain allowed access.
##
##
#
interface(`puppet_read_log_files',`
gen_require(`
type puppet_log_t;
')
logging_search_logs($1)
read_files_pattern($1, puppet_log_t, puppet_log_t)
')
################################################
##
## Read and write to puppet tempoprary files.
##
##
##
## Domain allowed access.
##
##
#
interface(`puppet_rw_tmp', `
gen_require(`
type puppet_tmp_t;
')
files_search_tmp($1)
allow $1 puppet_tmp_t:file rw_file_perms;
')
########################################
##
## All of the rules required to
## administrate an puppet environment.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`puppet_admin',`
gen_require(`
type puppet_initrc_exec_t, puppetmaster_initrc_exec_t, puppet_log_t;
type puppet_var_lib_t, puppet_tmp_t, puppet_etc_t;
type puppet_var_run_t, puppetmaster_tmp_t;
type puppet_t, puppetca_t, puppetmaster_t;
')
allow $1 { puppet_t puppetca_t puppetmaster_t }:process { ptrace signal_perms };
ps_process_pattern($1, { puppet_t puppetca_t puppetmaster_t })
init_startstop_service($1, $2, puppet_t, puppet_initrc_exec_t)
init_startstop_service($1, $2, puppetmaster_t, puppetmaster_initrc_exec_t)
files_search_etc($1)
admin_pattern($1, puppet_etc_t)
logging_search_logs($1)
admin_pattern($1, puppet_log_t)
files_search_var_lib($1)
admin_pattern($1, puppet_var_lib_t)
files_search_pids($1)
admin_pattern($1, puppet_var_run_t)
files_search_tmp($1)
admin_pattern($1, { puppet_tmp_t puppetmaster_tmp_t })
puppet_run_puppetca($1, $2)
')