Information
firewalld controls which traffic a zone allows by permitting named services (predefined protocol/port groups such as ssh or dhcpv6-client ) and individual ports . Traffic that is not matched by an allowed service or port is handled by the zone's target (accept, reject, or drop). Only the services and ports required for the system's role should be permitted, keeping the exposed attack surface to a minimum.
To reduce the attack surface of a system, all services and ports should be blocked unless required
NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance.
Solution
Run the following command to remove an unnecessary service:
# firewall-cmd --remove-service=<service>
Example:
# firewall-cmd --remove-service=cockpit
Run the following command to remove an unnecessary port:
# firewall-cmd --remove-port=<port-number>/<port-type>
Example:
# firewall-cmd --remove-port=25/tcp
Run the following command to make new settings persistent:
# firewall-cmd --runtime-to-permanent
Impact:
Removing a service or port that is required for the system's role will break access to it. Confirm each permitted service and port against site policy before removing, and validate that remote access (such as SSH) is retained.