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 8f17f7
##	Execute the dnsmasq init script in the init script domain.
Chris PeBenito 8f17f7
## </summary>
Chris PeBenito 8f17f7
## <param name="domain">
Chris PeBenito 8f17f7
##	<summary>
Chris PeBenito 8f17f7
##	Domain allowed access.
Chris PeBenito 8f17f7
##	</summary>
Chris PeBenito 8f17f7
## </param>
Chris PeBenito 8f17f7
#
Chris PeBenito 8f17f7
#
Chris PeBenito 8f17f7
interface(`dnsmasq_initrc_domtrans',`
Chris PeBenito 8f17f7
	gen_require(`
Chris PeBenito 8f17f7
		type dnsmasq_initrc_exec_t;
Chris PeBenito 8f17f7
	')
Chris PeBenito 8f17f7
Chris PeBenito 8f17f7
	init_labeled_script_domtrans($1, dnsmasq_initrc_exec_t)
Chris PeBenito 8f17f7
')
Chris PeBenito 8f17f7
Chris PeBenito 8f17f7
########################################
Chris PeBenito 8f17f7
## <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 8f800d
##	Send dnsmasq a signull
Chris PeBenito 8f800d
## </summary>
Chris PeBenito 8f800d
## <param name="domain">
Chris PeBenito 8f800d
##	<summary>
Chris PeBenito 8f800d
##	Domain allowed access.
Chris PeBenito 8f800d
##	</summary>
Chris PeBenito 8f800d
## </param>
Chris PeBenito 8f800d
#
Chris PeBenito 8f800d
#
Chris PeBenito 8f800d
interface(`dnsmasq_signull',`
Chris PeBenito 8f800d
	gen_require(`
Chris PeBenito 8f800d
		type dnsmasq_t;
Chris PeBenito 8f800d
	')
Chris PeBenito 8f800d
Chris PeBenito 8f800d
	allow $1 dnsmasq_t:process signull;
Chris PeBenito 8f800d
')
Chris PeBenito 8f800d
Chris PeBenito 8f800d
########################################
Chris PeBenito 8f800d
## <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 27eab8
##	Read dnsmasq config files.
Chris PeBenito 8f800d
## </summary>
Chris PeBenito 8f800d
## <param name="domain">
Chris PeBenito 27eab8
## <summary>
Chris PeBenito 27eab8
##	Domain allowed.
Chris PeBenito 27eab8
## </summary>
Chris PeBenito 8f800d
## </param>
Chris PeBenito 8f800d
#
Chris PeBenito 27eab8
interface(`dnsmasq_read_config',`
Chris PeBenito 8f800d
	gen_require(`
Chris PeBenito 27eab8
		type dnsmasq_etc_t;
Chris PeBenito 8f800d
	')
Chris PeBenito 8f800d
Chris PeBenito 27eab8
	allow $1 dnsmasq_etc_t:file read_file_perms;
Chris PeBenito 27eab8
	files_search_etc($1)
Chris PeBenito 8f800d
')
Chris PeBenito 8f800d
Chris PeBenito 8f800d
########################################
Chris PeBenito 8f800d
## <summary>
Chris PeBenito 27eab8
##	Write to dnsmasq config files.
Chris PeBenito 8f800d
## </summary>
Chris PeBenito 8f800d
## <param name="domain">
Chris PeBenito 27eab8
## <summary>
Chris PeBenito 27eab8
##	Domain allowed.
Chris PeBenito 27eab8
## </summary>
Chris PeBenito 8f800d
## </param>
Chris PeBenito 8f800d
#
Chris PeBenito 27eab8
interface(`dnsmasq_write_config',`
Chris PeBenito 8f800d
	gen_require(`
Chris PeBenito 27eab8
		type dnsmasq_etc_t;
Chris PeBenito 8f800d
	')
Chris PeBenito 8f800d
Chris PeBenito 27eab8
	allow $1 dnsmasq_etc_t:file write_file_perms;
Chris PeBenito 27eab8
	files_search_etc($1)
Chris PeBenito 8f800d
')
Chris PeBenito 8f800d
Chris PeBenito 8f800d
########################################
Chris PeBenito 8f800d
## <summary>
Chris PeBenito 27eab8
##	Delete dnsmasq pid files
Dominick Grift 1031ee
## </summary>
Dominick Grift 1031ee
## <param name="domain">
Chris PeBenito 27eab8
##	<summary>
Chris PeBenito 27eab8
##	Domain allowed access.
Chris PeBenito 27eab8
##	</summary>
Dominick Grift 1031ee
## </param>
Dominick Grift 1031ee
#
Chris PeBenito 27eab8
#
Chris PeBenito 27eab8
interface(`dnsmasq_delete_pid_files',`
Dominick Grift 1031ee
	gen_require(`
Chris PeBenito 27eab8
		type dnsmasq_var_run_t;
Dominick Grift 1031ee
	')
Dominick Grift 1031ee
Chris PeBenito 27eab8
	delete_files_pattern($1, dnsmasq_var_run_t, dnsmasq_var_run_t)
Dominick Grift 1031ee
')
Dominick Grift 1031ee
Dominick Grift 1031ee
########################################
Dominick Grift 1031ee
## <summary>
Chris PeBenito 27eab8
##	Read dnsmasq pid files
Dominick Grift 1031ee
## </summary>
Dominick Grift 1031ee
## <param name="domain">
Chris PeBenito 27eab8
##	<summary>
Chris PeBenito 27eab8
##	Domain allowed access.
Chris PeBenito 27eab8
##	</summary>
Dominick Grift 1031ee
## </param>
Dominick Grift 1031ee
#
Chris PeBenito 27eab8
#
Chris PeBenito 27eab8
interface(`dnsmasq_read_pid_files',`
Dominick Grift 1031ee
	gen_require(`
Chris PeBenito 27eab8
		type dnsmasq_var_run_t;
Dominick Grift 1031ee
	')
Dominick Grift 1031ee
Chris PeBenito 27eab8
	read_files_pattern($1, dnsmasq_var_run_t, dnsmasq_var_run_t)
Dominick Grift 1031ee
')
Dominick Grift 1031ee
Dominick Grift 1031ee
########################################
Dominick Grift 1031ee
## <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
')