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 2226887 - filter_OUTPUT needs "ct state { established, related } accept"
Summary: filter_OUTPUT needs "ct state { established, related } accept"
Keywords:
Status: CLOSED DUPLICATE of bug 2156831
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: firewalld
Version: 8.6
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Eric Garver
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-26 20:05 UTC by mcolombo
Modified: 2023-07-27 13:46 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-27 13:43:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker NMT-686 0 None None None 2023-07-26 20:05:50 UTC
Red Hat Issue Tracker RHELPLAN-163604 0 None None None 2023-07-26 20:06:02 UTC

Description mcolombo 2023-07-26 20:05:30 UTC
Description of problem:
When setting output target to reject It breaks incoming connections. 

Version-Release number of selected component (if applicable):
NetworkManager-1.40.16-1.el8.x86_64

How reproducible:
Everytime

Steps to Reproduce:
1.Add the following rules.

firewall-cmd --permanent --new-policy outgoing_policy
firewall-cmd --permanent --policy outgoing_policy --add-ingress-zone HOST
firewall-cmd --permanent --policy outgoing_policy --add-egress-zone ANY
firewall-cmd --permanent --policy outgoing_policy --set-target=REJECT
firewall-cmd --permanent --policy outgoing_policy --add-service=dns
firewall-cmd --permanent --policy outgoing_policy --add-service=https
firewall-cmd --permanent --policy outgoing_policy --add-service=ssh

2.
3.

Actual results:
incoming ssh timesout 

Expected results:
Incoming ssh connections to work as the service is enabled for the active zone. 

Additional info:
Active incoming zone is set to allow incoming ssh connections. 

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp1s0
  sources: 
  services: cockpit dhcpv6-client ssh
  ports: 
  protocols: 
  forward: no
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 


Reproducer:
===========
RHEL 8.6 vm

[root@rhel-86 ~]# firewall-cmd --permanent --new-policy outgoing_policy
success
s-zone HOST86 ~]# firewall-cmd --permanent --policy outgoing_policy --add-ingress
success
-zone ANYl-86 ~]# firewall-cmd --permanent --policy outgoing_policy --add-egress-
success
=REJECThel-86 ~]# firewall-cmd --permanent --policy outgoing_policy --set-target=
success
e=dns@rhel-86 ~]# firewall-cmd --permanent --policy outgoing_policy --add-service
success
e=httpshel-86 ~]# firewall-cmd --permanent --policy outgoing_policy --add-service
success
e=ssh@rhel-86 ~]# firewall-cmd --permanent --policy outgoing_policy --add-service
success
[root@rhel-86 ~]# firewall-cmd --reload
success
[root@rhel-86 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:9b:a6:c8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.121/24 brd 192.168.122.255 scope global dynamic noprefixroute enp1s0
       valid_lft 3503sec preferred_lft 3503sec
    inet6 fe80::5054:ff:fe9b:a6c8/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever


fedora desktop

mcolombo@fedora#[~]# ssh root.122.121
ssh: connect to host 192.168.122.121 port 22: Connection timed out

RHEL 8.6 vm

[root@rhel-86 ~] nft insert rule "inet firewalld" filter_OUTPUT index 0 ct state { established, related } accept

fedora desktop

mcolombo@fedora#[~]# ssh root.122.121
root.122.121's password: 
Last login: Wed Jul 26 15:25:46 2023


Request:
========
Firewalld needs to add "ct state { established, related } accept" to filter_OUTPUT as this will allow outgoing packet in response to incoming connection that are already allowed by firewalld. 

Additional question:
====================
Is there a way to do this with direct rules?

Comment 1 Thomas Haller 2023-07-26 20:34:09 UTC
it seems this should be reported against firewalld. Reassigning.

also, the reproducer seems to have lines oddly mangled.
It's maybe somewhat understandable, nonetheless, would it be possible to post the correct reproducer?

Comment 2 Thomas Haller 2023-07-26 20:36:56 UTC
(In reply to Thomas Haller from comment #1)
> also, the reproducer seems to have lines oddly mangled.
> It's maybe somewhat understandable, nonetheless, would it be possible to
> post the correct reproducer?

Never mind. The mangled part is only the output from "RHEL 8.6 vm". The same script is under "1.Add the following rules." above.

Comment 3 mcolombo 2023-07-26 20:42:22 UTC
(In reply to Thomas Haller from comment #1)
> it seems this should be reported against firewalld. Reassigning.
> 


I didn't realize I did that. Thank you for switching that. 

> also, the reproducer seems to have lines oddly mangled.
> It's maybe somewhat understandable, nonetheless, would it be possible to
> post the correct reproducer?
As the reproducer breaks ssh I needed to use the console which mangled the output. The steps to reproduce have the full commands.

Comment 5 Eric Garver 2023-07-27 13:43:12 UTC

*** This bug has been marked as a duplicate of bug 2156831 ***


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