Chris PeBenito 17de1b
## <summary>Policy for iptables.</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute iptables in the iptables domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`iptables_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type iptables_t, iptables_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito 3f67f7
	domtrans_pattern($1, iptables_exec_t, iptables_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	ifdef(`hide_broken_symptoms', `
Dan Walsh 3eaa99
	        dontaudit iptables_t $1:socket_class_set { read write };
Dan Walsh 3eaa99
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute iptables in the iptables domain, and
Chris PeBenito 17de1b
##	allow the specified role the iptables domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito a7ee7f
##	Role allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`iptables_run',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type iptables_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	iptables_domtrans($1)
Chris PeBenito 17de1b
	role $2 types iptables_t;
Chris PeBenito 770c01
Chris PeBenito 296273
	sysnet_run_ifconfig(iptables_t, $2)
Chris PeBenito 770c01
Chris PeBenito 770c01
	optional_policy(`
Chris PeBenito 296273
		modutils_run_insmod(iptables_t, $2)
Chris PeBenito 770c01
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute iptables in the caller domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`iptables_exec',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type iptables_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 8021cb
	corecmd_search_bin($1)
Chris PeBenito 3f67f7
	can_exec($1, iptables_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
#####################################
Chris PeBenito 7491a9
## <summary>
Chris PeBenito 7491a9
##	Execute iptables in the iptables domain.
Chris PeBenito 7491a9
## </summary>
Chris PeBenito 7491a9
## <param name="domain">
Chris PeBenito 7491a9
##	<summary>
Dominick Grift a0546c
##	Domain allowed to transition.
Chris PeBenito 7491a9
##	</summary>
Chris PeBenito 7491a9
## </param>
Chris PeBenito 7491a9
#
Chris PeBenito 7491a9
interface(`iptables_initrc_domtrans',`
Chris PeBenito 7491a9
	gen_require(`
Chris PeBenito 7491a9
		type iptables_initrc_exec_t;
Chris PeBenito 7491a9
	')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
	init_labeled_script_domtrans($1, iptables_initrc_exec_t)
Chris PeBenito 7491a9
')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
#####################################
Chris PeBenito 7491a9
## <summary>
Chris PeBenito 7491a9
##	Set the attributes of iptables config files.
Chris PeBenito 7491a9
## </summary>
Chris PeBenito 7491a9
## <param name="domain">
Chris PeBenito 7491a9
##	<summary>
Chris PeBenito 7491a9
##	Domain allowed access.
Chris PeBenito 7491a9
##	</summary>
Chris PeBenito 7491a9
## </param>
Chris PeBenito 7491a9
#
Chris PeBenito 7491a9
interface(`iptables_setattr_config',`
Chris PeBenito 7491a9
	gen_require(`
Chris PeBenito 7491a9
		type iptables_conf_t;
Chris PeBenito 7491a9
	')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
	files_search_etc($1)
Chris PeBenito 7491a9
	allow $1 iptables_conf_t:file setattr;
Chris PeBenito 7491a9
')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
#####################################
Chris PeBenito 7491a9
## <summary>
Chris PeBenito 7491a9
##	Read iptables config files.
Chris PeBenito 7491a9
## </summary>
Chris PeBenito 7491a9
## <param name="domain">
Chris PeBenito 7491a9
##	<summary>
Chris PeBenito 7491a9
##	Domain allowed access.
Chris PeBenito 7491a9
##	</summary>
Chris PeBenito 7491a9
## </param>
Chris PeBenito 7491a9
#
Chris PeBenito 7491a9
interface(`iptables_read_config',`
Chris PeBenito 7491a9
	gen_require(`
Chris PeBenito 7491a9
		type iptables_conf_t;
Chris PeBenito 7491a9
	')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
	files_search_etc($1)
Chris PeBenito 7491a9
	allow $1 iptables_conf_t:dir list_dir_perms;
Chris PeBenito 7491a9
	read_files_pattern($1, iptables_conf_t, iptables_conf_t)
Chris PeBenito 7491a9
')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
#####################################
Chris PeBenito 7491a9
## <summary>
Chris PeBenito 7491a9
##	Create files in /etc with the type used for
Chris PeBenito 7491a9
##	the iptables config files.
Chris PeBenito 7491a9
## </summary>
Chris PeBenito 7491a9
## <param name="domain">
Chris PeBenito 7491a9
##	<summary>
Dominick Grift a0546c
##	Domain allowed access.
Chris PeBenito 7491a9
##	</summary>
Chris PeBenito 7491a9
## </param>
Chris PeBenito 7491a9
#
Chris PeBenito 7491a9
interface(`iptables_etc_filetrans_config',`
Chris PeBenito 7491a9
	gen_require(`
Chris PeBenito 7491a9
		type iptables_conf_t;
Chris PeBenito 7491a9
	')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
	files_etc_filetrans($1, iptables_conf_t, file)
Chris PeBenito 7491a9
')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
###################################
Chris PeBenito 7491a9
## <summary>
Chris PeBenito 7491a9
##	Manage iptables config files.
Chris PeBenito 7491a9
## </summary>
Chris PeBenito 7491a9
## <param name="domain">
Chris PeBenito 7491a9
##	<summary>
Chris PeBenito 7491a9
##	Domain allowed access.
Chris PeBenito 7491a9
##	</summary>
Chris PeBenito 7491a9
## </param>
Chris PeBenito 7491a9
#
Chris PeBenito 7491a9
interface(`iptables_manage_config',`
Chris PeBenito 7491a9
	gen_require(`
Chris PeBenito 7491a9
		type iptables_conf_t;
Chris PeBenito 7491a9
		type etc_t;
Chris PeBenito 7491a9
	')
Chris PeBenito 7491a9
Chris PeBenito 7491a9
	files_search_etc($1)
Chris PeBenito 7491a9
	manage_files_pattern($1, iptables_conf_t, iptables_conf_t)
Chris PeBenito 7491a9
')