|
Chris PeBenito |
e32d52 |
## <module name="iptables" layer="system">
|
|
Chris PeBenito |
e32d52 |
## <summary>Policy for iptables.</summary>
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
daa0e0 |
########################################
|
|
Chris PeBenito |
daa0e0 |
## <interface name="iptables_transition">
|
|
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 |
## <infoflow type="write" weight="10"/>
|
|
Chris PeBenito |
daa0e0 |
## </interface>
|
|
Chris PeBenito |
6b9383 |
#
|
|
Chris PeBenito |
6b9383 |
define(`iptables_transition',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
6b9383 |
allow $1 iptables_exec_t:file { getattr read execute };
|
|
Chris PeBenito |
6b9383 |
allow $1 iptables_t:process transition;
|
|
Chris PeBenito |
e7fcdc |
type_transition $1 iptables_exec_t:process iptables_t;
|
|
Chris PeBenito |
6b9383 |
dontaudit $1 iptables_t:process { noatsecure siginh rlimitinh };
|
|
Chris PeBenito |
4bf4ed |
allow $1 iptables_t:fd use;
|
|
Chris PeBenito |
4bf4ed |
allow iptables_t $1:fd use;
|
|
Chris PeBenito |
4bf4ed |
allow iptables_t $1:fifo_file rw_file_perms;
|
|
Chris PeBenito |
4bf4ed |
allow iptables_t $1:process sigchld;
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
define(`iptables_transition_depend',`
|
|
Chris PeBenito |
6b9383 |
type iptables_t, iptables_exec_t;
|
|
Chris PeBenito |
6b9383 |
class file { getattr read execute };
|
|
Chris PeBenito |
4bf4ed |
class process { transition noatsecure siginh rlimitinh sigchld };
|
|
Chris PeBenito |
4bf4ed |
class fd use;
|
|
Chris PeBenito |
4bf4ed |
class fifo_file rw_file_perms;
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
daa0e0 |
########################################
|
|
Chris PeBenito |
daa0e0 |
## <interface name="iptables_transition_add_role_use_terminal">
|
|
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 |
## <infoflow type="write" weight="10"/>
|
|
Chris PeBenito |
daa0e0 |
## </interface>
|
|
Chris PeBenito |
6b9383 |
#
|
|
Chris PeBenito |
daa0e0 |
define(`iptables_transition_add_role_use_terminal',`
|
|
Chris PeBenito |
daa0e0 |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
daa0e0 |
iptables_transition($1)
|
|
Chris PeBenito |
daa0e0 |
role $2 types iptables_t;
|
|
Chris PeBenito |
daa0e0 |
allow iptables_t $3:chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
daa0e0 |
define(`iptables_transition_add_role_use_terminal_depend',`
|
|
Chris PeBenito |
daa0e0 |
type iptables_t;
|
|
Chris PeBenito |
daa0e0 |
class chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
daa0e0 |
########################################
|
|
Chris PeBenito |
daa0e0 |
## <interface name="iptables_execute">
|
|
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 |
d490eb |
## <infoflow type="none"/>
|
|
Chris PeBenito |
daa0e0 |
## </interface>
|
|
Chris PeBenito |
6b9383 |
#
|
|
Chris PeBenito |
6b9383 |
define(`iptables_execute',`
|
|
Chris PeBenito |
bd202f |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
6b9383 |
allow $1 iptables_exec_t:file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
6b9383 |
|
|
Chris PeBenito |
6b9383 |
define(`iptables_execute_depend',`
|
|
Chris PeBenito |
6b9383 |
type iptables_t, iptables_exec_t;
|
|
Chris PeBenito |
6b9383 |
class file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
6b9383 |
')
|
|
Chris PeBenito |
e32d52 |
|
|
Chris PeBenito |
e32d52 |
## </module>
|