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.
Bug 1210563 - BUG: ip[6]tables init script does not handle the security table correctly in set_policy()
Summary: BUG: ip[6]tables init script does not handle the security table correctly in ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: iptables
Version: 6.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Phil Sutter
QA Contact: Tomas Dolezal
Ioanna Gkioka
URL:
Whiteboard:
Depends On:
Blocks: 1494012 1506394
TreeView+ depends on / blocked
 
Reported: 2015-04-10 05:33 UTC by Paul Moore
Modified: 2018-06-19 05:09 UTC (History)
8 users (show)

Fixed In Version: iptables-1.4.7-17.el6
Doc Type: Bug Fix
Doc Text:
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.
Clone Of:
: 1494012 (view as bug list)
Environment:
Last Closed: 2018-06-19 05:08:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch for /etc/init.d/{iptables,ip6tables} (577 bytes, patch)
2015-04-10 05:33 UTC, Paul Moore
no flags Details | Diff
Patch for /etc/init.d/{iptables,ip6tables} (583 bytes, patch)
2015-04-10 05:36 UTC, Paul Moore
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1859 0 None None None 2018-06-19 05:09:04 UTC

Description Paul Moore 2015-04-10 05:33:44 UTC
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.

Comment 1 Paul Moore 2015-04-10 05:36:17 UTC
Created attachment 1012954 [details]
Patch for /etc/init.d/{iptables,ip6tables}

Ooops, fix a minor typo in the patch for ip6tables.

Comment 3 Phil Sutter 2017-09-20 11:22:09 UTC
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

Comment 4 Paul Moore 2017-09-20 22:26:09 UTC
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.

Comment 17 errata-xmlrpc 2018-06-19 05:08:46 UTC
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


Note You need to log in before you can comment on or make changes to this bug.