Chris PeBenito 17de1b
## <summary>Snort network intrusion detection system</summary>
Chris PeBenito 06099d
Chris PeBenito 06099d
########################################
Chris PeBenito 06099d
## <summary>
Chris PeBenito 06099d
##	Execute a domain transition to run snort.
Chris PeBenito 06099d
## </summary>
Chris PeBenito 06099d
## <param name="domain">
Dominick Grift dcf874
##	<summary>
Chris PeBenito 06099d
##	Domain allowed to transition.
Dominick Grift dcf874
##	</summary>
Chris PeBenito 06099d
## </param>
Chris PeBenito 06099d
#
Chris PeBenito 06099d
interface(`snort_domtrans',`
Chris PeBenito 06099d
	gen_require(`
Chris PeBenito 06099d
		type snort_t, snort_exec_t;
Chris PeBenito 06099d
	')
Chris PeBenito 06099d
Chris PeBenito 06099d
	domtrans_pattern($1, snort_exec_t, snort_t)
Chris PeBenito 06099d
')
Chris PeBenito 06099d
Chris PeBenito 06099d
########################################
Chris PeBenito 06099d
## <summary>
Chris PeBenito 06099d
##	All of the rules required to administrate 
Chris PeBenito 06099d
##	an snort environment
Chris PeBenito 06099d
## </summary>
Chris PeBenito 06099d
## <param name="domain">
Chris PeBenito 06099d
##	<summary>
Chris PeBenito 06099d
##	Domain allowed access.
Chris PeBenito 06099d
##	</summary>
Chris PeBenito 06099d
## </param>
Chris PeBenito 06099d
## <param name="role">
Chris PeBenito 06099d
##	<summary>
Chris PeBenito 06099d
##	The role to be allowed to manage the snort domain.
Chris PeBenito 06099d
##	</summary>
Chris PeBenito 06099d
## </param>
Chris PeBenito 06099d
## <rolecap/>
Chris PeBenito 06099d
#
Chris PeBenito 06099d
interface(`snort_admin',`
Chris PeBenito 06099d
	gen_require(`
Chris PeBenito 06099d
		type snort_t, snort_var_run_t, snort_log_t;
Chris PeBenito ebf3ec
		type snort_etc_t, snort_initrc_exec_t;
Chris PeBenito 06099d
	')
Chris PeBenito 06099d
Chris PeBenito 06099d
	allow $1 snort_t:process { ptrace signal_perms };
Chris PeBenito 06099d
	ps_process_pattern($1, snort_t)
Chris PeBenito 06099d
Chris PeBenito 06099d
	init_labeled_script_domtrans($1, snort_initrc_exec_t)
Chris PeBenito 06099d
	domain_system_change_exemption($1)
Chris PeBenito 06099d
	role_transition $2 snort_initrc_exec_t system_r;
Chris PeBenito 06099d
	allow $2 system_r;
Chris PeBenito 06099d
Chris PeBenito 06099d
	admin_pattern($1, snort_etc_t)
Dominick Grift 61f406
	files_list_etc($1)
Chris PeBenito 06099d
Chris PeBenito 06099d
	admin_pattern($1, snort_log_t)
Dominick Grift 61f406
	logging_list_logs($1)
Chris PeBenito 06099d
Chris PeBenito 06099d
	admin_pattern($1, snort_var_run_t)
Dominick Grift 61f406
	files_list_pids($1)
Chris PeBenito 06099d
')