Bug 1563629

Summary: RFE: Not able to add any description for particular port via "firewall-cmd" command
Product: Red Hat Enterprise Linux 8 Reporter: Nakul Dev <ndev>
Component: firewalldAssignee: Eric Garver <egarver>
Status: CLOSED MIGRATED QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: ajawarka, jmaxwell, mmhatre, nonalodiaasirei, sukulkar, todoleza
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: 8.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 10:14:51 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1682341    
Bug Blocks:    

Description Nakul Dev 2018-04-04 11:09:35 UTC
Description of problem:

Not having any option to add a description for a port added via "firewall-cmd" command.

Tried to add the description by manually editing the files, but it's getting overwritten while we add the next rule via "firewall-cmd" command.

This specific request is for adding multiple with a proper description for each of them, which was there in IPtables.

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

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.4 (Maipo)

Booted Kernel: 3.10.0-693.11.6.el7.x86_64

# rpm -qa  firewalld
firewalld-0.4.4.4-6.el7.noarch

How reproducible:

There are no options available to set the "description" together with the command to add port.

Steps to Reproduce:
1. Add the port with "--set-description" option:

==========================================================
# firewall-cmd --permanent --set-description="needed for OSI application" --add-port=3348/tcp
success

# cat /etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
  <short>Public</short>
  <service name="ssh"/>
  <service name="dhcpv6-client"/>
  <port protocol="tcp" port="3348"/> <<-----
</zone>
==========================================================

Port got added to the "public.xml" file but there are no descriptions.


2. Tried to add the description manually to the configuration file:

======================================================
# cat /etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
  <short>Public</short>
  <description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
  <service name="ssh"/>
  <service name="dhcpv6-client"/>
  <port protocol="tcp" port="3523"/> # needed for OSI application <<<---------
</zone>


 # firewall-cmd --permanent --add-port=3344/tcp
success


 # cat /etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
  <short>Public</short>
  <description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
  <service name="ssh"/>
  <service name="dhcpv6-client"/>
  <port protocol="tcp" port="3523"/>
  <port protocol="tcp" port="3344"/>
</zone>
======================================================


Actual results:

There is no description being set for any of the ports with "--set-description" option.


Expected results:

There should be some option to set a description for each port as per the user requirement.


Additional info:

We do have the option to set the description for particular service, zones, helper, ipset, icmptype which would be added to the corresponding ".xml" files.

Comment 3 Eric Garver 2018-04-04 13:45:44 UTC
The firewalld way for this is to create a custom service and add it the zone. The service name can provide context and the short can provide further information.
e.g.

  # firewall-cmd --permanent --new-service=foobar                                                                                                            
  # firewall-cmd --permanent --service=foobar --set-short="this is my description of foobar"
  # firewall-cmd --permanent --service=foobar --add-port=3384/tcp
  # firewall-cmd --permanent --add-service foobar

  # firewall-cmd --permanent --list-all
  public
    ... 
    services: dhcpv6-client ssh foobar

  # firewall-cmd --permanent --service=foobar --get-short
  this is my description of foobar

Comment 10 Amol Jawarkar 2018-05-24 16:05:01 UTC
Hi,

Just wanted to check, if there is any progress on this RFE.

Comment 11 Eric Garver 2018-05-24 18:40:54 UTC
(In reply to Amol Jawarkar from comment #10)
> Hi,
> 
> Just wanted to check, if there is any progress on this RFE.

No progress nor estimate of when it'll be done.

Comment 21 Sangam 2020-04-21 02:42:45 UTC
*** Bug 1739421 has been marked as a duplicate of this bug. ***

Comment 28 RHEL Program Management 2023-09-21 10:09:48 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 29 RHEL Program Management 2023-09-21 10:14:51 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.

Comment 30 shamrocksmelt 2023-11-08 01:43:04 UTC
I'm writing this comment because it wasn't until I restarted the systemctl with systemctl restart firewalld with sudo: https://geometrydashlite.co

I had attempted every suggestion above. the VM was restarted. In VNIC, I even made the rules. However, it wasn't fixed until the service was restarted. The Oracle Cloud Network environment VM: Compute Instance (using Oracle Linux 8 as a developer) https://access.redhat.com/articles/7032570