Chris PeBenito 17de1b
## <summary>dnsmasq DNS forwarder and DHCP server</summary>
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
########################################
Chris PeBenito 01e9e7
## <summary>
Chris PeBenito 01e9e7
##	Execute dnsmasq server in the dnsmasq domain.
Chris PeBenito 01e9e7
## </summary>
Chris PeBenito 01e9e7
## <param name="domain">
Chris PeBenito 01e9e7
##	<summary>
Chris PeBenito 01e9e7
##	The type of the process performing this action.
Chris PeBenito 01e9e7
##	</summary>
Chris PeBenito 01e9e7
## </param>
Chris PeBenito 01e9e7
#
Chris PeBenito 01e9e7
#
Chris PeBenito 01e9e7
interface(`dnsmasq_domtrans',`
Chris PeBenito 01e9e7
	gen_require(`
Chris PeBenito 01e9e7
		type dnsmasq_exec_t, dnsmasq_t;
Chris PeBenito 01e9e7
	')
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
	corecmd_search_bin($1)
Chris PeBenito 01e9e7
	domtrans_pattern($1, dnsmasq_exec_t, dnsmasq_t)
Chris PeBenito 01e9e7
')
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
########################################
Chris PeBenito 01e9e7
## <summary>
Chris PeBenito 01e9e7
##	Send dnsmasq a signal
Chris PeBenito 01e9e7
## </summary>
Chris PeBenito 01e9e7
## <param name="domain">
Chris PeBenito 01e9e7
##	<summary>
Chris PeBenito 01e9e7
##	The type of the process performing this action.
Chris PeBenito 01e9e7
##	</summary>
Chris PeBenito 01e9e7
## </param>
Chris PeBenito 01e9e7
#
Chris PeBenito 01e9e7
#
Chris PeBenito 01e9e7
interface(`dnsmasq_signal',`
Chris PeBenito 01e9e7
	gen_require(`
Chris PeBenito 01e9e7
		type dnsmasq_t;
Chris PeBenito 01e9e7
	')
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
	allow $1 dnsmasq_t:process signal;
Chris PeBenito 01e9e7
')
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
########################################
Chris PeBenito 01e9e7
## <summary>
Chris PeBenito 01e9e7
##	Send dnsmasq a kill signal.
Chris PeBenito 01e9e7
## </summary>
Chris PeBenito 01e9e7
## <param name="domain">
Chris PeBenito 01e9e7
##	<summary>
Chris PeBenito 01e9e7
##	Domain allowed access.
Chris PeBenito 01e9e7
##	</summary>
Chris PeBenito 01e9e7
## </param>
Chris PeBenito 01e9e7
#
Chris PeBenito 01e9e7
#
Chris PeBenito 01e9e7
interface(`dnsmasq_kill',`
Chris PeBenito 01e9e7
	gen_require(`
Chris PeBenito 01e9e7
		type dnsmasq_t;
Chris PeBenito 01e9e7
	')
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
	allow $1 dnsmasq_t:process sigkill;
Chris PeBenito 01e9e7
')
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
########################################
Chris PeBenito 01e9e7
## <summary>
Chris PeBenito 01e9e7
##	All of the rules required to administrate 
Chris PeBenito 01e9e7
##	an dnsmasq environment
Chris PeBenito 01e9e7
## </summary>
Chris PeBenito 01e9e7
## <param name="domain">
Chris PeBenito 01e9e7
##	<summary>
Chris PeBenito 01e9e7
##	Domain allowed access.
Chris PeBenito 01e9e7
##	</summary>
Chris PeBenito 01e9e7
## </param>
Chris PeBenito 01e9e7
## <param name="role">
Chris PeBenito 01e9e7
##	<summary>
Chris PeBenito 01e9e7
##	The role to be allowed to manage the dnsmasq domain.
Chris PeBenito 01e9e7
##	</summary>
Chris PeBenito 01e9e7
## </param>
Chris PeBenito 01e9e7
## <rolecap/>
Chris PeBenito 01e9e7
#
Chris PeBenito 01e9e7
interface(`dnsmasq_admin',`
Chris PeBenito 01e9e7
	gen_require(`
Chris PeBenito 01e9e7
		type dnsmasq_t, dnsmasq_lease_t, dnsmasq_var_run_t;
Chris PeBenito 01e9e7
		type dnsmasq_initrc_exec_t;
Chris PeBenito 01e9e7
	')
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
	allow $1 dnsmasq_t:process { ptrace signal_perms };
Chris PeBenito 01e9e7
	ps_process_pattern($1, dnsmasq_t)
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
	init_labeled_script_domtrans($1, dnsmasq_initrc_exec_t)
Chris PeBenito 01e9e7
	domain_system_change_exemption($1)
Chris PeBenito 01e9e7
	role_transition $2 dnsmasq_initrc_exec_t system_r;
Chris PeBenito 01e9e7
	allow $2 system_r;
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
	files_list_var_lib($1)
Chris PeBenito 01e9e7
	admin_pattern($1, dnsmasq_lease_t)
Chris PeBenito 01e9e7
Chris PeBenito 01e9e7
	files_list_pids($1)
Chris PeBenito 01e9e7
	admin_pattern($1, dnsmasq_var_run_t)
Chris PeBenito 01e9e7
')