Chris PeBenito e32d52
## <module name="iptables" layer="system">
Chris PeBenito e32d52
## <summary>Policy for iptables.</summary>
Chris PeBenito 6b9383
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="iptables_domtrans">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute iptables in the iptables domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 6b9383
#
Chris PeBenito c9428d
define(`iptables_domtrans',`
Chris PeBenito fa7bea
	gen_require(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 iptables_exec_t:file rx_file_perms;
Chris PeBenito 0c73cd
	allow $1 iptables_t:process transition;
Chris PeBenito 0c73cd
	type_transition $1 iptables_exec_t:process iptables_t;
Chris PeBenito 0c73cd
	dontaudit $1 iptables_t:process { noatsecure siginh rlimitinh };
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 c9428d
define(`iptables_domtrans_depend',`
Chris PeBenito 0c73cd
	type iptables_t, iptables_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class file rx_file_perms;
Chris PeBenito 0c73cd
	class process { transition noatsecure siginh rlimitinh sigchld };
Chris PeBenito 0c73cd
	class fd use;
Chris PeBenito 0c73cd
	class fifo_file rw_file_perms;
Chris PeBenito 6b9383
')
Chris PeBenito 6b9383
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="iptables_run">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute iptables in the iptables domain, and
Chris PeBenito daa0e0
##		allow the specified role the iptables domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="role">
Chris PeBenito daa0e0
##		The role to be allowed the iptables domain.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
##	<parameter name="terminal">
Chris PeBenito daa0e0
##		The type of the terminal allow the iptables domain to use.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 6b9383
#
Chris PeBenito c9428d
define(`iptables_run',`
Chris PeBenito fa7bea
	gen_require(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito c9428d
	iptables_domtrans($1)
Chris PeBenito 0c73cd
	role $2 types iptables_t;
Chris PeBenito 0c73cd
	allow iptables_t $3:chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito c9428d
define(`iptables_run_depend',`
Chris PeBenito 0c73cd
	type iptables_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { getattr read write ioctl };
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito c9428d
## <interface name="iptables_exec">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute iptables in the caller domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito 6b9383
#
Chris PeBenito c9428d
define(`iptables_exec',`
Chris PeBenito fa7bea
	gen_require(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	can_exec($1,iptables_exec_t)
Chris PeBenito dd8229
Chris PeBenito 6b9383
')
Chris PeBenito 6b9383
Chris PeBenito c9428d
define(`iptables_exec_depend',`
Chris PeBenito 0c73cd
	type iptables_t, iptables_exec_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { getattr read execute execute_no_trans };
Chris PeBenito 6b9383
')
Chris PeBenito e32d52
Chris PeBenito e32d52
## </module>