Chris PeBenito 267d9c
## <summary>Varnishd http accelerator daemon</summary>
Chris PeBenito 267d9c
Chris PeBenito 267d9c
#######################################
Chris PeBenito 267d9c
## <summary>
Chris PeBenito 267d9c
##	Execute varnishd in the varnishd domain.
Chris PeBenito 267d9c
## </summary>
Chris PeBenito 267d9c
## <param name="domain">
Chris PeBenito 267d9c
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
#
Chris PeBenito 267d9c
interface(`varnishd_domtrans',`
Chris PeBenito 267d9c
	gen_require(`
Chris PeBenito 267d9c
		type varnishd_t, varnishd_exec_t;
Chris PeBenito 267d9c
	')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	corecmd_search_bin($1)
Chris PeBenito 267d9c
	domtrans_pattern($1, varnishd_exec_t, varnishd_t)
Chris PeBenito 267d9c
')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
#######################################
Chris PeBenito 267d9c
## <summary>
Dominick Grift dcf874
##	Execute varnishd
Chris PeBenito 267d9c
## </summary>
Chris PeBenito 267d9c
## <param name="domain">
Chris PeBenito 267d9c
##	<summary>
Chris PeBenito a72e42
##	Domain allowed access.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
#
Chris PeBenito 267d9c
interface(`varnishd_exec',`
Chris PeBenito 267d9c
	gen_require(`
Chris PeBenito 267d9c
		type varnishd_exec_t;
Chris PeBenito 267d9c
	')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	can_exec($1, varnishd_exec_t)
Chris PeBenito 267d9c
')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
######################################
Chris PeBenito 267d9c
## <summary>
Chris PeBenito 267d9c
##	Read varnishd configuration file.
Chris PeBenito 267d9c
## </summary>
Chris PeBenito 267d9c
## <param name="domain">
Chris PeBenito 267d9c
##	<summary>
Chris PeBenito 267d9c
##	Domain allowed access.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
#
Chris PeBenito 267d9c
interface(`varnishd_read_config',`
Chris PeBenito 267d9c
	gen_require(`
Chris PeBenito 267d9c
		type varnishd_etc_t;
Chris PeBenito 267d9c
	')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	files_search_etc($1)
Chris PeBenito 267d9c
	read_files_pattern($1, varnishd_etc_t, varnishd_etc_t)
Chris PeBenito 267d9c
')
Chris PeBenito 267d9c
Dan Walsh 3eaa99
#####################################
Dan Walsh 3eaa99
## <summary>
Dominick Grift 2a7245
##	Read varnish lib files.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dominick Grift dcf874
##	<summary>
Dominick Grift dcf874
##	Domain allowed access.
Dominick Grift dcf874
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`varnishd_read_lib_files',`
Dominick Grift dcf874
	gen_require(`
Dominick Grift dcf874
		type varnishd_var_lib_t;
Dominick Grift dcf874
	')
Dan Walsh 3eaa99
Dominick Grift dcf874
	files_search_var_lib($1)
Dominick Grift dcf874
	read_files_pattern($1, varnishd_var_lib_t, varnishd_var_lib_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Chris PeBenito 267d9c
#######################################
Chris PeBenito 267d9c
## <summary>
Chris PeBenito 267d9c
##	Read varnish logs.
Chris PeBenito 267d9c
## </summary>
Chris PeBenito 267d9c
## <param name="domain">
Chris PeBenito 267d9c
##	<summary>
Chris PeBenito 267d9c
##	Domain allowed access.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
#
Chris PeBenito b67201
interface(`varnishd_read_log',`
Chris PeBenito 267d9c
	gen_require(`
Chris PeBenito 267d9c
		type varnishlog_log_t;
Chris PeBenito 267d9c
	')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	logging_search_logs($1)
Chris PeBenito 267d9c
	read_files_pattern($1, varnishlog_log_t, varnishlog_log_t)
Chris PeBenito 267d9c
')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
######################################
Chris PeBenito 267d9c
## <summary>
Chris PeBenito 267d9c
##	Append varnish logs.
Chris PeBenito 267d9c
## </summary>
Chris PeBenito 267d9c
## <param name="domain">
Chris PeBenito 267d9c
##	<summary>
Chris PeBenito 267d9c
##	Domain allowed access.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
#
Chris PeBenito b67201
interface(`varnishd_append_log',`
Chris PeBenito 267d9c
	gen_require(`
Chris PeBenito 267d9c
		type varnishlog_log_t;
Chris PeBenito 267d9c
	')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	logging_search_logs($1)
Chris PeBenito 267d9c
	append_files_pattern($1, varnishlog_log_t, varnishlog_log_t)
Chris PeBenito 267d9c
')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
#####################################
Chris PeBenito 267d9c
## <summary>
Chris PeBenito 267d9c
##	Manage varnish logs.
Chris PeBenito 267d9c
## </summary>
Chris PeBenito 267d9c
## <param name="domain">
Chris PeBenito 267d9c
##	<summary>
Chris PeBenito 267d9c
##	Domain allowed access.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
#
Chris PeBenito b67201
interface(`varnishd_manage_log',`
Chris PeBenito 267d9c
	gen_require(`
Chris PeBenito 267d9c
		type varnishlog_log_t;
Chris PeBenito 267d9c
	')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	logging_search_logs($1)
Chris PeBenito 267d9c
	manage_files_pattern($1, varnishlog_log_t, varnishlog_log_t)
Chris PeBenito 267d9c
')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
######################################
Chris PeBenito 267d9c
## <summary>
Chris PeBenito 267d9c
##	All of the rules required to administrate 
Chris PeBenito 267d9c
##	an varnishlog environment
Chris PeBenito 267d9c
## </summary>
Chris PeBenito 267d9c
## <param name="domain">
Chris PeBenito 267d9c
##	<summary>
Chris PeBenito 267d9c
##	Domain allowed access.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
## <param name="role">
Chris PeBenito 267d9c
##	<summary>
Chris PeBenito 267d9c
##	The role to be allowed to manage the varnishlog domain.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
## <rolecap/>
Chris PeBenito 267d9c
#
Chris PeBenito 267d9c
interface(`varnishd_admin_varnishlog',`
Chris PeBenito 267d9c
	gen_require(`
Dominick Grift f26267
		type varnishlog_t, varnishlog_initrc_exec_t, varnishlog_log_t;
Dominick Grift f26267
		type varnishlog_var_run_t;
Chris PeBenito 267d9c
	')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	allow $1 varnishlog_t:process { ptrace signal_perms };
Chris PeBenito 267d9c
	ps_process_pattern($1, varnishlog_t)
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	init_labeled_script_domtrans($1, varnishlog_initrc_exec_t)
Chris PeBenito 267d9c
	domain_system_change_exemption($1)
Chris PeBenito 267d9c
	role_transition $2 varnishlog_initrc_exec_t system_r;
Chris PeBenito 267d9c
	allow $2 system_r;
Chris PeBenito 267d9c
Dominick Grift 61f406
	files_list_pids($1)
Dominick Grift dcf874
	admin_pattern($1, varnishlog_var_run_t)
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	logging_list_logs($1)
Chris PeBenito 267d9c
	admin_pattern($1, varnishlog_log_t)
Chris PeBenito 267d9c
')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
#######################################
Chris PeBenito 267d9c
## <summary>
Chris PeBenito 267d9c
##	All of the rules required to administrate 
Chris PeBenito 267d9c
##	an varnishd environment
Chris PeBenito 267d9c
## </summary>
Chris PeBenito 267d9c
## <param name="domain">
Chris PeBenito 267d9c
##	<summary>
Chris PeBenito 267d9c
##	Domain allowed access.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
## <param name="role">
Chris PeBenito 267d9c
##	<summary>
Chris PeBenito 267d9c
##	The role to be allowed to manage the varnishd domain.
Chris PeBenito 267d9c
##	</summary>
Chris PeBenito 267d9c
## </param>
Chris PeBenito 267d9c
## <rolecap/>
Chris PeBenito 267d9c
#
Chris PeBenito 267d9c
interface(`varnishd_admin',`
Chris PeBenito 267d9c
	gen_require(`
Chris PeBenito 267d9c
		type varnishd_t, varnishd_var_lib_t, varnishd_etc_t;
Dominick Grift dcf874
		type varnishd_var_run_t, varnishd_tmp_t;
Chris PeBenito 267d9c
		type varnishd_initrc_exec_t;
Chris PeBenito 267d9c
	')
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	allow $1 varnishd_t:process { ptrace signal_perms };
Chris PeBenito 267d9c
	ps_process_pattern($1, varnishd_t)
Chris PeBenito 267d9c
Chris PeBenito 267d9c
	init_labeled_script_domtrans($1, varnishd_initrc_exec_t)
Chris PeBenito 267d9c
	domain_system_change_exemption($1)
Chris PeBenito 267d9c
	role_transition $2 varnishd_initrc_exec_t system_r;
Chris PeBenito 267d9c
	allow $2 system_r;
Chris PeBenito 267d9c
Dominick Grift 61f406
	files_list_var_lib($1)
Chris PeBenito 267d9c
	admin_pattern($1, varnishd_var_lib_t)
Chris PeBenito 267d9c
Dominick Grift 61f406
	files_list_etc($1)
Chris PeBenito 267d9c
	admin_pattern($1, varnishd_etc_t)
Chris PeBenito 267d9c
Dominick Grift 61f406
	files_list_pids($1)
Chris PeBenito 267d9c
	admin_pattern($1, varnishd_var_run_t)
Chris PeBenito 267d9c
Dominick Grift 61f406
	files_list_tmp($1)
Chris PeBenito 267d9c
	admin_pattern($1, varnishd_tmp_t)
Chris PeBenito 267d9c
')