4.1.4 Ensure ufw outgoing default is configured

Information

The default policy for outgoing traffic determines if applications and services running on your server can initiate connections to external networks without requiring specific UFW rules.

With a default deny outgoing policy the firewall will deny ALL outgoing traffic and is a highly restrictive policy that requires the addition of specific allow rules.

Solution

Run the following command to set the default for outgoing to deny :

# ufw default deny outgoing

Warning: Any port or protocol without a explicit allow before the default deny will be blocked.

Impact:

Any port and protocol not explicitly allowed will be blocked. The following rules are an example of some outgoing allow rules that should be considered before applying this default deny.

ufw allow out http
ufw allow out https
ufw allow out ntp # Network Time Protocol
ufw allow out to any port 53 # DNS
ufw allow out to any port 853 # DNS over TLS
ufw logging on

See Also

https://workbench.cisecurity.org/benchmarks/24330

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-7, CCI|CCI-000382, CSCv7|9.4

Plugin: Unix

Control ID: 1b4bc1009aceef1eb6fdc7b34b55144f9fec0be1b8f1db225b5ba3997e6959f5