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">
Chris PeBenito 06099d
## <summary>
Chris PeBenito 06099d
##	Domain allowed to transition.
Chris PeBenito 06099d
## </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)
Chris PeBenito 06099d
	files_search_etc($1)
Chris PeBenito 06099d
Chris PeBenito 06099d
	admin_pattern($1, snort_log_t)
Chris PeBenito 06099d
	logging_search_logs($1)
Chris PeBenito 06099d
Chris PeBenito 06099d
	admin_pattern($1, snort_var_run_t)
Chris PeBenito 06099d
	files_search_pids($1)
Chris PeBenito 06099d
')