highnetwork
Ensure nftables default deny firewall policy
nftables-default-deny · RHEL ≥ 8 · 1 impl
Description
When using nftables directly, the default policy should be to deny all traffic that is not explicitly allowed.
Rationale
A default deny policy ensures that only explicitly allowed traffic can pass through the firewall, reducing the attack surface.
Check → Remediate
Checkcommand
# Check for drop policy on input and forward chains ruleset=$(nft list ruleset 2>/dev/null) if echo "$ruleset" | grep -qE "chain input.*policy drop" && echo "$ruleset" | grep -qE "chain forward.*policy drop"; then echo "OK: nftables default deny policy is configured" exit 0 fi echo "FAIL: nftables default deny policy not configured" exit 1
- expected_exit:
- 0
Remediatemanual
- note:
- Configure nftables default deny policy: nft chain inet filter input { policy drop \; } nft chain inet filter forward { policy drop \; }
Framework references
CIS
rhel9 4.3.3
NIST 800-53
SC-7
NIST 800-171
3.1.3[e]3.13.1[e]3.13.1[f]3.13.6[a]
CMMC Level 2
AC.L2-3.1.3SC.L2-3.13.1SC.L2-3.13.6
#firewall#nftables#security