2019-02-01 20:03:42 +00:00
|
|
|
policy_module(iptables, 1.21.0)
|
2005-05-02 18:36:51 +00:00
|
|
|
|
2005-04-29 20:16:38 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2011-08-12 12:10:59 +00:00
|
|
|
attribute_role iptables_roles;
|
|
|
|
roleattribute system_r iptables_roles;
|
|
|
|
|
2005-04-29 20:16:38 +00:00
|
|
|
type iptables_t;
|
|
|
|
type iptables_exec_t;
|
2009-06-26 14:40:13 +00:00
|
|
|
init_system_domain(iptables_t, iptables_exec_t)
|
2011-08-12 12:10:59 +00:00
|
|
|
role iptables_roles types iptables_t;
|
2005-04-29 20:16:38 +00:00
|
|
|
|
2009-12-01 14:23:11 +00:00
|
|
|
type iptables_initrc_exec_t;
|
|
|
|
init_script_file(iptables_initrc_exec_t)
|
|
|
|
|
|
|
|
type iptables_conf_t;
|
|
|
|
files_config_file(iptables_conf_t)
|
|
|
|
|
2017-06-09 13:49:35 +00:00
|
|
|
type iptables_runtime_t alias iptables_var_run_t;
|
|
|
|
files_pid_file(iptables_runtime_t)
|
|
|
|
|
2005-04-29 20:16:38 +00:00
|
|
|
type iptables_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(iptables_tmp_t)
|
2005-04-29 20:16:38 +00:00
|
|
|
|
2015-10-20 18:33:56 +00:00
|
|
|
type iptables_unit_t;
|
|
|
|
init_unit_file(iptables_unit_t)
|
|
|
|
|
2005-04-29 20:16:38 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Iptables local policy
|
|
|
|
#
|
|
|
|
|
2017-02-15 23:47:33 +00:00
|
|
|
allow iptables_t self:capability { dac_override dac_read_search net_admin net_raw };
|
2005-05-04 17:01:46 +00:00
|
|
|
dontaudit iptables_t self:capability sys_tty_config;
|
2010-03-18 12:10:21 +00:00
|
|
|
allow iptables_t self:fifo_file rw_fifo_file_perms;
|
2005-05-04 17:01:46 +00:00
|
|
|
allow iptables_t self:process { sigchld sigkill sigstop signull signal };
|
2011-04-14 15:36:56 +00:00
|
|
|
allow iptables_t self:netlink_socket create_socket_perms;
|
2015-05-21 17:38:09 +00:00
|
|
|
allow iptables_t self:netlink_netfilter_socket create_socket_perms;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow iptables_t self:rawip_socket create_socket_perms;
|
2005-04-29 20:16:38 +00:00
|
|
|
|
2009-12-01 14:23:11 +00:00
|
|
|
manage_files_pattern(iptables_t, iptables_conf_t, iptables_conf_t)
|
|
|
|
files_etc_filetrans(iptables_t, iptables_conf_t, file)
|
|
|
|
|
2009-06-26 14:40:13 +00:00
|
|
|
can_exec(iptables_t, iptables_exec_t)
|
2005-04-29 20:16:38 +00:00
|
|
|
|
2017-06-09 13:49:35 +00:00
|
|
|
manage_files_pattern(iptables_t, iptables_runtime_t, iptables_runtime_t)
|
|
|
|
files_pid_filetrans(iptables_t, iptables_runtime_t, file)
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow iptables_t iptables_tmp_t:dir manage_dir_perms;
|
|
|
|
allow iptables_t iptables_tmp_t:file manage_file_perms;
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(iptables_t, iptables_tmp_t, { file dir })
|
2005-04-29 20:16:38 +00:00
|
|
|
|
2011-07-19 09:32:07 +00:00
|
|
|
kernel_getattr_proc(iptables_t)
|
2009-12-01 14:23:11 +00:00
|
|
|
kernel_request_load_module(iptables_t)
|
2005-04-29 20:16:38 +00:00
|
|
|
kernel_read_system_state(iptables_t)
|
|
|
|
kernel_read_network_state(iptables_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(iptables_t)
|
|
|
|
kernel_read_modprobe_sysctls(iptables_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
kernel_use_fds(iptables_t)
|
2005-04-29 20:16:38 +00:00
|
|
|
|
2011-04-14 15:36:56 +00:00
|
|
|
# needed by ipvsadm
|
|
|
|
corecmd_exec_bin(iptables_t)
|
|
|
|
corecmd_exec_shell(iptables_t)
|
|
|
|
|
2006-05-23 19:07:22 +00:00
|
|
|
corenet_relabelto_all_packets(iptables_t)
|
2010-03-18 12:10:21 +00:00
|
|
|
corenet_dontaudit_rw_tun_tap_dev(iptables_t)
|
2006-05-23 19:07:22 +00:00
|
|
|
|
2005-06-16 20:33:51 +00:00
|
|
|
dev_read_sysfs(iptables_t)
|
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(iptables_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(iptables_t)
|
2008-08-12 19:52:29 +00:00
|
|
|
fs_list_inotifyfs(iptables_t)
|
2005-04-29 20:16:38 +00:00
|
|
|
|
2007-08-20 18:26:08 +00:00
|
|
|
mls_file_read_all_levels(iptables_t)
|
2006-01-06 22:51:40 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(iptables_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(iptables_t)
|
2007-06-11 15:43:37 +00:00
|
|
|
files_read_etc_runtime_files(iptables_t)
|
2005-04-29 20:16:38 +00:00
|
|
|
|
2007-08-22 20:02:41 +00:00
|
|
|
auth_use_nsswitch(iptables_t)
|
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(iptables_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(iptables_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
# to allow rules to be saved on reboot:
|
2005-06-13 17:35:46 +00:00
|
|
|
init_rw_script_tmp_files(iptables_t)
|
2007-11-05 19:35:08 +00:00
|
|
|
init_rw_script_stream_sockets(iptables_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(iptables_t)
|
2005-04-29 20:16:38 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(iptables_t)
|
|
|
|
|
2011-08-12 12:10:59 +00:00
|
|
|
sysnet_run_ifconfig(iptables_t, iptables_roles)
|
2005-09-15 21:03:29 +00:00
|
|
|
sysnet_dns_name_resolve(iptables_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
|
2017-06-09 13:49:35 +00:00
|
|
|
userdom_use_inherited_user_terminals(iptables_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2011-04-14 15:36:56 +00:00
|
|
|
ifdef(`hide_broken_symptoms',`
|
|
|
|
dev_dontaudit_write_mtrr(iptables_t)
|
|
|
|
')
|
|
|
|
|
2007-06-11 15:43:37 +00:00
|
|
|
optional_policy(`
|
|
|
|
fail2ban_append_log(iptables_t)
|
|
|
|
')
|
|
|
|
|
2013-11-09 09:44:57 +00:00
|
|
|
optional_policy(`
|
|
|
|
firewalld_read_config_files(iptables_t)
|
2016-02-13 09:04:06 +00:00
|
|
|
firewalld_read_var_run_files(iptables_t)
|
2013-11-09 09:44:57 +00:00
|
|
|
firewalld_dontaudit_rw_tmp_files(iptables_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-02 23:41:11 +00:00
|
|
|
firstboot_use_fds(iptables_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
firstboot_rw_pipes(iptables_t)
|
2005-08-17 14:14:07 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2017-02-18 21:35:45 +00:00
|
|
|
modutils_run(iptables_t, iptables_roles)
|
2005-04-29 20:16:38 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-27 16:30:55 +00:00
|
|
|
# for iptables -L
|
|
|
|
nis_use_ypbind(iptables_t)
|
|
|
|
')
|
|
|
|
|
2006-12-04 20:10:56 +00:00
|
|
|
optional_policy(`
|
|
|
|
ppp_dontaudit_use_fds(iptables_t)
|
|
|
|
')
|
|
|
|
|
2009-12-01 14:23:11 +00:00
|
|
|
optional_policy(`
|
|
|
|
psad_rw_tmp_files(iptables_t)
|
|
|
|
')
|
|
|
|
|
2007-11-05 19:35:08 +00:00
|
|
|
optional_policy(`
|
|
|
|
rhgb_dontaudit_use_ptys(iptables_t)
|
|
|
|
')
|
|
|
|
|
2010-03-18 12:10:21 +00:00
|
|
|
optional_policy(`
|
2011-03-21 13:42:12 +00:00
|
|
|
shorewall_read_tmp_files(iptables_t)
|
2010-03-18 12:10:21 +00:00
|
|
|
shorewall_rw_lib_files(iptables_t)
|
2011-04-14 15:36:56 +00:00
|
|
|
shorewall_read_config(iptables_t)
|
2010-03-18 12:10:21 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-13 17:35:46 +00:00
|
|
|
udev_read_db(iptables_t)
|
2017-02-25 16:20:19 +00:00
|
|
|
# this is for iptables_t to inherit a file hande from xen vif-bridge
|
|
|
|
udev_manage_pid_files(iptables_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|