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