This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2156831 - Allow RHEL8 firewalld 0.9.3 to accept established and related connections with reject/drop policies
Summary: Allow RHEL8 firewalld 0.9.3 to accept established and related connections wit...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: firewalld
Version: 8.7
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Eric Garver
QA Contact: Tomas Dolezal
URL:
Whiteboard:
: 2226887 (view as bug list)
Depends On:
Blocks: 2183216 2196599
TreeView+ depends on / blocked
 
Reported: 2022-12-28 23:02 UTC by rablanco@redhat.com
Modified: 2023-07-27 13:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 2196599 (view as bug list)
Environment:
Last Closed: 2023-05-19 17:10:16 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-505 0 None Migrated None 2023-10-06 07:51:59 UTC

Description rablanco@redhat.com 2022-12-28 23:02:28 UTC
Description of problem:

Allow RHEL8 firewalld 0.9.3 to accept established and related connections with reject/drop policies

Version-Release number of selected component (if applicable):

firewalld 0.9.3 

How reproducible:

1) You need to apply the following policy

firewall-cmd --new-policy out --permanent
firewall-cmd --set-target REJECT --policy out --permanent
firewall-cmd --policy out --add-egress-zone ANY --permanent
firewall-cmd --policy out --add-ingress-zone HOST --permanent


2) then try to connect from a other machine via ssh , it should be blocked 



The case notes shows that the following line is missed on Redhat 8


chain filter_OUTPUT {
		type filter hook output priority filter + 10; policy accept;
		ct state { established, related } accept <<-------------------- this is missing in RHEL 8.0!!!!!!!
		oifname "lo" accept
		ip6 daddr { ::/96, ::ffff:0.0.0.0/96, 2002::/24, 2002:a00::/24, 2002:7f00::/24, 2002:a9fe::/32, 2002:ac10::/28, 2002:c0a8::/32, 2002:e000::/19 } reject with icmpv6 type addr-unreachable
		jump filter_OUTPUT_POLICIES_pre
		jump filter_OUTPUT_POLICIES_post
	}



3) After inserting the line manually, the problem is fix but we need to modify the firewalld code in order to place the rule from the begining


Temporary fix 
# nft insert rule inet firewalld filter_OUTPUT 'ct state { established, related } accept'


Actual results:


The server is blocked after applying the policy


Expected results:


- All outgoing traffic should be blocked expect for the already established connections


Additional info:


We found the solution here

https://github.com/firewalld/firewalld/pull/709/commits/4581f83ea51d55ec7929d8a81ff485918a10e34e 


On the case I left a note about the changes on the py scripts in order to fix the issue 


case : 03398728

Comment 6 Eric Garver 2023-07-27 13:43:12 UTC
*** Bug 2226887 has been marked as a duplicate of this bug. ***


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