selinux-policy/policy/modules/services/piranha.if

174 lines
3.6 KiB
Plaintext
Raw Normal View History

2010-08-26 13:41:21 +00:00
## <summary>policy for piranha</summary>
#######################################
## <summary>
## Creates types and rules for a basic
## cluster init daemon domain.
2010-08-26 13:41:21 +00:00
## </summary>
## <param name="prefix">
## <summary>
## Prefix for the domain.
## </summary>
2010-08-26 13:41:21 +00:00
## </param>
#
template(`piranha_domain_template',`
gen_require(`
attribute piranha_domain;
')
2010-08-26 13:41:21 +00:00
##############################
#
# piranha_$1_t declarations
#
2010-08-26 13:41:21 +00:00
type piranha_$1_t, piranha_domain;
type piranha_$1_exec_t;
init_daemon_domain(piranha_$1_t, piranha_$1_exec_t)
# pid files
type piranha_$1_var_run_t;
files_pid_file(piranha_$1_var_run_t)
2010-08-26 13:41:21 +00:00
##############################
#
# piranha_$1_t local policy
#
2010-08-26 13:41:21 +00:00
manage_files_pattern(piranha_$1_t, piranha_$1_var_run_t, piranha_$1_var_run_t)
2010-08-26 13:41:21 +00:00
manage_dirs_pattern(piranha_$1_t, piranha_$1_var_run_t, piranha_$1_var_run_t)
files_pid_filetrans(piranha_$1_t, piranha_$1_var_run_t, { dir file })
2010-08-26 13:41:21 +00:00
')
########################################
## <summary>
## Execute a domain transition to run fos.
## </summary>
## <param name="domain">
## <summary>
2010-08-26 13:41:21 +00:00
## Domain allowed to transition.
## </summary>
2010-08-26 13:41:21 +00:00
## </param>
#
interface(`piranha_domtrans_fos',`
gen_require(`
type piranha_fos_t, piranha_fos_exec_t;
')
domtrans_pattern($1, piranha_fos_exec_t, piranha_fos_t)
')
#######################################
## <summary>
## Execute a domain transition to run lvsd.
2010-08-26 13:41:21 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2010-08-26 13:41:21 +00:00
## </param>
#
interface(`piranha_domtrans_lvs',`
gen_require(`
type piranha_lvs_t, piranha_lvs_exec_t;
')
2010-08-26 13:41:21 +00:00
domtrans_pattern($1, piranha_lvs_exec_t, piranha_lvs_t)
2010-08-26 13:41:21 +00:00
')
#######################################
## <summary>
## Execute a domain transition to run pulse.
2010-08-26 13:41:21 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2010-08-26 13:41:21 +00:00
## </param>
#
interface(`piranha_domtrans_pulse',`
gen_require(`
type piranha_pulse_t, piranha_pulse_exec_t;
')
2010-08-26 13:41:21 +00:00
domtrans_pattern($1, piranha_pulse_exec_t, piranha_pulse_t)
2010-08-26 13:41:21 +00:00
')
#######################################
## <summary>
## Execute pulse server in the pulse domain.
2010-08-26 13:41:21 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
2010-08-26 13:41:21 +00:00
## </param>
#
interface(`piranha_pulse_initrc_domtrans',`
gen_require(`
type piranha_pulse_initrc_exec_t;
')
2010-08-26 13:41:21 +00:00
init_labeled_script_domtrans($1, piranha_pulse_initrc_exec_t)
2010-08-26 13:41:21 +00:00
')
########################################
## <summary>
## Allow the specified domain to read piranha's log files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`piranha_read_log',`
gen_require(`
type piranha_log_t;
')
logging_search_logs($1)
read_files_pattern($1, piranha_log_t, piranha_log_t)
2010-08-26 13:41:21 +00:00
')
########################################
## <summary>
## Allow the specified domain to append
## piranha log files.
## </summary>
## <param name="domain">
## <summary>
2010-08-26 13:41:21 +00:00
## Domain allowed to transition.
## </summary>
2010-08-26 13:41:21 +00:00
## </param>
#
interface(`piranha_append_log',`
gen_require(`
type piranha_log_t;
')
logging_search_logs($1)
append_files_pattern($1, piranha_log_t, piranha_log_t)
')
########################################
## <summary>
## Allow domain to manage piranha log files
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
interface(`piranha_manage_log',`
gen_require(`
type piranha_log_t;
')
logging_search_logs($1)
manage_dirs_pattern($1, piranha_log_t, piranha_log_t)
manage_files_pattern($1, piranha_log_t, piranha_log_t)
manage_lnk_files_pattern($1, piranha_log_t, piranha_log_t)
2010-08-26 13:41:21 +00:00
')