Chris PeBenito e32d52
## <summary>Policy for iptables.</summary>
Chris PeBenito 6b9383
Chris PeBenito daa0e0
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Execute iptables in the iptables domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 6b5c92
##	Domain allowed access.
Chris PeBenito 414e41
## </param>
Chris PeBenito 6b9383
#
Chris PeBenito 199895
interface(`iptables_domtrans',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type iptables_t, iptables_exec_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 139520
	corecmd_search_sbin($1)
Chris PeBenito 139520
	domain_auto_trans($1,iptables_exec_t,iptables_t)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 iptables_t:fd use;
Chris PeBenito 0c73cd
	allow iptables_t $1:fd use;
Chris PeBenito 0c73cd
	allow iptables_t $1:fifo_file rw_file_perms;
Chris PeBenito 0c73cd
	allow iptables_t $1:process sigchld;
Chris PeBenito 6b9383
')
Chris PeBenito 6b9383
Chris PeBenito daa0e0
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Execute iptables in the iptables domain, and
Chris PeBenito 414e41
##	allow the specified role the iptables domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 6b5c92
##	Domain allowed access.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="role">
Chris PeBenito 414e41
##	The role to be allowed the iptables domain.
Chris PeBenito 414e41
## </param>
Chris PeBenito 414e41
## <param name="terminal">
Chris PeBenito 414e41
##	The type of the terminal allow the iptables domain to use.
Chris PeBenito 414e41
## </param>
Chris PeBenito 6b9383
#
Chris PeBenito 199895
interface(`iptables_run',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type iptables_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	iptables_domtrans($1)
Chris PeBenito 0c73cd
	role $2 types iptables_t;
Chris PeBenito 139520
	allow iptables_t $3:chr_file rw_term_perms;
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito f7ebea
## <summary>
Chris PeBenito 414e41
##	Execute iptables in the caller domain.
Chris PeBenito f7ebea
## </summary>
Chris PeBenito 414e41
## <param name="domain">
Chris PeBenito 6b5c92
##	Domain allowed access.
Chris PeBenito 414e41
## </param>
Chris PeBenito 6b9383
#
Chris PeBenito 199895
interface(`iptables_exec',`
Chris PeBenito 139520
	gen_require(`
Chris PeBenito 139520
		type iptables_exec_t;
Chris PeBenito 139520
	')
Chris PeBenito 0c73cd
Chris PeBenito 139520
	corecmd_search_sbin($1)
Chris PeBenito dd8229
	can_exec($1,iptables_exec_t)
Chris PeBenito 6b9383
')