Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Both `iptables` and `ip6tables` services now recognize the security table in the set_policy() function
Previously, when the security table was used, the `iptables` or `ip6tables` services failed to clear correctly the firewall ruleset during the shutdown. As a consequence, an error message was displayed when stopping these services. With this update, both `iptables` and `ip6tables` init scripts recognize but ignore the security table when clearing the firewall ruleset. As a result, the error message is no longer displayed in the described scenario.
Created attachment 1012952[details]
Patch for /etc/init.d/{iptables,ip6tables}
Description of problem:
When the security table is being used (e.g. secmark) the iptables and ip6tables init scripts fail in set_policy() due to not recognizing the security table. In order to preserve the separation between the host-based firewall rules and SELinux based secmark labeling the init scripts should be made *aware* of the security table so the scripts do not fail, but the should not take any action against the security table in set_policy() .
Version-Release number of selected component (if applicable):
iptables-1.4.7-16.el6.x86_64
iptables-ipv6-1.4.7-16.el6.x86_64
How reproducible:
Every time.
Steps to Reproduce:
1. service iptables start
2. /sbin/iptables -t security -A FORWARD -p icmp -j LOG
3. service iptables stop
Actual results:
# service iptables start
iptables: Applying firewall rules: [ OK ]
# /sbin/iptables -t security -A FORWARD -p icmp -j LOG
# service iptables stop
iptables: Setting chains to policy ACCEPT: security filter [FAILED]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
Expected results:
# service iptables start
iptables: Applying firewall rules: [ OK ]
# /sbin/iptables -t security -A FORWARD -p icmp -j LOG
# service iptables stop
iptables: Setting chains to policy ACCEPT: security filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
Additional info:
The same problem applies to both the IPv4 and IPv6 init scripts.
Hi Paul,
(In reply to Paul Moore from comment #0)
> Description of problem:
> When the security table is being used (e.g. secmark) the iptables and
> ip6tables init scripts fail in set_policy() due to not recognizing the
> security table. In order to preserve the separation between the host-based
> firewall rules and SELinux based secmark labeling the init scripts should be
> made *aware* of the security table so the scripts do not fail, but the
> should not take any action against the security table in set_policy() .
I agree this is a bug in iptables.init, but I wonder about one aspect: Why should the init script ignore the security table? Assuming that a user may add custom rules to it as well, I'd handle it just like the other tables, setting policies of builtin chains to ACCEPT if iptables is stopped. What are your reasons against that?
Thanks, Phil
The general idea is when it comes to the SELinux iptables/netfilter rules is that they should be immune to iptables flush, and similar, commands. The reasoning is that many sysadmins are trained to do certain things which could compromise a SELinux system using an iptables/netfilter configuration to label traffic using secmark.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2018:1859
Created attachment 1012952 [details] Patch for /etc/init.d/{iptables,ip6tables} Description of problem: When the security table is being used (e.g. secmark) the iptables and ip6tables init scripts fail in set_policy() due to not recognizing the security table. In order to preserve the separation between the host-based firewall rules and SELinux based secmark labeling the init scripts should be made *aware* of the security table so the scripts do not fail, but the should not take any action against the security table in set_policy() . Version-Release number of selected component (if applicable): iptables-1.4.7-16.el6.x86_64 iptables-ipv6-1.4.7-16.el6.x86_64 How reproducible: Every time. Steps to Reproduce: 1. service iptables start 2. /sbin/iptables -t security -A FORWARD -p icmp -j LOG 3. service iptables stop Actual results: # service iptables start iptables: Applying firewall rules: [ OK ] # /sbin/iptables -t security -A FORWARD -p icmp -j LOG # service iptables stop iptables: Setting chains to policy ACCEPT: security filter [FAILED] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] Expected results: # service iptables start iptables: Applying firewall rules: [ OK ] # /sbin/iptables -t security -A FORWARD -p icmp -j LOG # service iptables stop iptables: Setting chains to policy ACCEPT: security filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] Additional info: The same problem applies to both the IPv4 and IPv6 init scripts.