3.5.1.6 Ensure ufw firewall rules exist for all open ports

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

Any ports that have been opened on non-loopback addresses need firewall rules to govern traffic.

Note:

Changing firewall settings while connected over network can result in being locked out of the system

The remediation command opens up the port to traffic from all sources. Consult ufw documentation and set any restrictions in compliance with site policy

Rationale:

Without a firewall rule configured for open ports default firewall policy will drop all packets to these ports.

Solution

For each port identified in the audit which does not have a firewall rule, add rule for accepting or denying inbound connections:
Example:

# ufw allow in <port>/<tcp or udp protocol>

See Also

https://workbench.cisecurity.org/files/3228