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>
Chris PeBenito 17de1b
##	Domain allowed access.
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 17de1b
	corecmd_search_sbin($1)
Chris PeBenito 17de1b
	domain_auto_trans($1,iptables_exec_t,iptables_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 iptables_t:fd use;
Chris PeBenito 17de1b
	allow iptables_t $1:fd use;
Chris PeBenito 17de1b
	allow iptables_t $1:fifo_file rw_file_perms;
Chris PeBenito 17de1b
	allow iptables_t $1:process sigchld;
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>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The role to be allowed the iptables domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="terminal">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the terminal allow the iptables domain to use.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
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 17de1b
	allow iptables_t $3:chr_file rw_term_perms;
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 17de1b
	corecmd_search_sbin($1)
Chris PeBenito 17de1b
	can_exec($1,iptables_exec_t)
Chris PeBenito 17de1b
')