Chris PeBenito 0fbfa5
#DESC Ipchains - IP packet filter administration
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Authors:  Justin Smith <jsmith@mcs.drexel.edu>
Chris PeBenito 0fbfa5
#           Russell Coker <russell@coker.com.au>
Chris PeBenito 0fbfa5
# X-Debian-Packages: ipchains iptables
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Rules for the iptables_t domain.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
daemon_base_domain(iptables, `, privmodule')
Chris PeBenito 0fbfa5
role sysadm_r types iptables_t;
Chris PeBenito 0fbfa5
domain_auto_trans(sysadm_t, iptables_exec_t, iptables_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
ifdef(`modutil.te', `
Chris PeBenito 0fbfa5
# for modprobe
Chris PeBenito 0fbfa5
allow iptables_t sbin_t:dir search;
Chris PeBenito 0fbfa5
allow iptables_t sbin_t:lnk_file read;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
read_locale(iptables_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# to allow rules to be saved on reboot
Chris PeBenito 0fbfa5
allow iptables_t initrc_tmp_t:file rw_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
domain_auto_trans(iptables_t, ifconfig_exec_t, ifconfig_t)
Chris PeBenito 0fbfa5
allow iptables_t var_t:dir search;
Chris PeBenito 0fbfa5
var_run_domain(iptables)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow iptables_t self:process { fork signal_perms };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow iptables_t { sysctl_t sysctl_kernel_t }:dir search;
Chris PeBenito 0fbfa5
allow iptables_t sysctl_modprobe_t:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
tmp_domain(iptables)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for iptables -L
Chris PeBenito 0fbfa5
allow iptables_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 0fbfa5
can_resolve(iptables_t)
Chris PeBenito 0fbfa5
can_ypbind(iptables_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow iptables_t iptables_exec_t:file execute_no_trans;
Chris PeBenito 0fbfa5
allow iptables_t self:capability { net_admin net_raw };
Chris PeBenito 0fbfa5
allow iptables_t self:rawip_socket create_socket_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow iptables_t etc_t:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow iptables_t fs_t:filesystem getattr;
Chris PeBenito 0fbfa5
allow iptables_t { userdomain kernel_t }:fd use;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Access terminals.
Chris PeBenito 0fbfa5
allow iptables_t admin_tty_type:chr_file rw_file_perms;
Chris PeBenito 0fbfa5
ifdef(`gnome-pty-helper.te', `allow iptables_t sysadm_gph_t:fd use;')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow iptables_t proc_t:file { getattr read };
Chris PeBenito 0fbfa5
allow iptables_t proc_net_t:dir search;
Chris PeBenito 0fbfa5
allow iptables_t proc_net_t:file { read getattr };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# system-config-network appends to /var/log
Chris PeBenito 0fbfa5
allow iptables_t var_log_t:file append;
Chris PeBenito 0fbfa5
ifdef(`firstboot.te', `
Chris PeBenito 0fbfa5
allow iptables_t firstboot_t:fifo_file write;
Chris PeBenito 0fbfa5
')