Skip to content

VPS & Server audit fixes

Firewall & Network: fixing all 6 checks

The firewall and network audit asks two things of the host itself: which ports are listening on an external interface, and whether anything on the box is filtering the traffic that reaches them.

Two checks are automated for UFW only, so on a firewalld, nftables or plain iptables host, Firewall Allow Rules and Outbound Firewall Policy both skip even when you run as root with everything else in place. The remaining skips are privilege, since four of the six checks need root to read firewall state, or a missing tool: no ufw, firewall-cmd, nft or iptables at all, neither ss nor netstat, no Docker daemon it can query, or no iproute2 for the IPv6 check.

CtrlOpsFirewall & Network audit6 CHECKS
Checks in this audit
6
Rated high severity
2
Need root or sudo
4
Automated run time
~14s

Transcribed from the vps-security-firewall-network audit script. For what the audit covers rather than how to fix it, see the Firewall & Network checklist, or how the CtrlOps Security Audit runs.

Every check

Find your finding

Listed in the order the audit runs them. Take the check name from the third field of the result line and open its page.

  1. 01Firewall StateSoonChecks whether a firewall (UFW, firewalld, nftables, iptables) is present and activeSeverity: HIGHNeeds rootCan return FAIL · SKIP · PASS
  2. 02Firewall Allow RulesSoonAudits configured firewall allow rules (UFW)Severity: MEDIUMNeeds rootCan return WARN · SKIP · PASS
  3. 03Docker Firewall BypassSoonChecks for Docker containers publishing ports on all interfaces, bypassing the firewallSeverity: HIGHNeeds rootCan return WARN · SKIP · PASS
  4. 04Open PortsSoonLists services listening on external interfacesSeverity: MEDIUMNo root neededCan return FAIL · WARN · SKIP · PASS
  5. 05IPv6 Firewall CoverageSoonChecks whether IPv6 traffic is covered by the firewallSeverity: MEDIUMNo root neededCan return FAIL · WARN · SKIP · PASS
  6. 06Outbound Firewall PolicySoonChecks the default outbound/egress firewall policySeverity: LOWNeeds rootCan return WARN · SKIP · PASS

Why checks skip

A SKIP is never a pass

A skipped check verified nothing at all. The most common cause is privilege: 4 of the 6 checks in this audit need root for a complete result. Before every run, each script works out which of four privilege modes it is in.

rootThe audit runs as UID 0.Every privileged branch runs directly. No check skips for lack of permission.
nopasssudo -n true succeeds, so the account has passwordless sudo.Privileged commands run through sudo -n.
passA sudo password was supplied in the CtrlOps audit settings and accepted.Privileged commands run through sudo -S.
noneSKIPNone of the above worked.CAN_ROOT=0. Every privileged branch returns SKIP with a "Need root" message rather than guessing.

If many checks skip with a “need root” message, run the audit as root, grant the audit account sudo (with or without NOPASSWD), or supply the sudo password in the CtrlOps audit settings.

Keep going

FAQ

Firewall & Network questions

Can't find your answer? Join Discord

  • The result is correct for what the check measures, which is filtering on the host itself: ufw status, firewalld state, an nftables ruleset, or an iptables INPUT chain with a DROP or REJECT policy. AWS security groups, DigitalOcean Cloud Firewalls and Hetzner firewalls all filter before traffic reaches the VM and are invisible to anything running on it. Relying on them alone is a defensible architecture, but the audit takes the defence-in-depth position, so either enable a host firewall as a second layer or record this as an accepted exception.

  • Both. ss and netstat report the address a socket is bound to, not whether anyone outside can reach it, so a port bound to 0.0.0.0 behind a host firewall or a cloud security group still counts here. The check drops 127.0.0.1 and ::1, counts TCP and UDP together, warns above five total, and fails outright on ports 23, 21, 3389, 5900, 5901, 11211, 873, 2049 and 111 wherever they appear externally. Use it as the inventory of what is bound and an external nmap as the test of what is reachable.

  • Allow the SSH port before you enable anything: sudo ufw allow 22/tcp, using the port the SSH audit reported rather than assuming 22, then sudo ufw enable and confirm with sudo ufw status while your existing session stays open. Do not try to fix the Docker Firewall Bypass warning with a ufw rule, because Docker publishes ports through the FORWARD chain and its own rules sit ahead of yours. The fix there is the port mapping itself: publish as 127.0.0.1:8080:80 instead of 8080:80 for anything that is not meant to be public.

Stop juggling tools. Start managing fleets.

PuTTY
Termius
MobaXterm
WinSCP
SecureCRT
Royal TS
Warp
CtrlOps14 tools left
Webmin
aaPanel
RunCloud
Dokploy
IP spreadsheet
bash (2)
sticky notes

One app. All your servers. No context switching. Free to start, free to leave.

Start instantly · No credit card · Cancel anytime

Your privacy preferences. We use product analytics to improve CtrlOps. Google Analytics cookies and live chat stay off until you allow them. Cookie policy