UFW Baseline

Last updated

Security → UFW. The simple port-open / port-close baseline. UFW has only this role; IP-trust decisions live in CrowdSec Decisions.

Default rules

The installer applies:

PortProtocolPurpose
22tcpSSH and SFTP. Opened on the first install only, while UFW is still off; later runs leave SSH rules alone
25tcpSMTP MTA
53tcp+udpPowerDNS authoritative
80tcpHTTP (and ACME HTTP-01)
443tcpHTTPS
465tcpSMTP submission TLS
587tcpSMTP submission STARTTLS
993tcpIMAPS
995tcpPOP3S
4190tcpManageSieve (mail filters)
8443tcpThe panel (HTTPS)
21, 40000–40100tcpFTP and its passive ports, only with the ftp module

Default policy: deny incoming, allow outgoing (outbound per-user is constrained by Egress).

Page surface

  • The current ruleset rendered as a sortable table.
  • Per-row Disable to take a port closed.
  • Add port form for non-standard ports (additional SSH, alternate web port).
  • A warning panel listing any rule of the form from <ip> — the move of IP decisions to CrowdSec replaced these with CrowdSec decisions; the warning surfaces any that escaped migration.

Migrating from old ufw deny

jabali ufw migrate-ip-bans

Walks ufw status numbered, lifts every from <ip> deny rule into a CrowdSec decision with reason=migrated-from-ufw, then deletes the UFW rule. Idempotent.

Why this split

UFW is excellent at static port baselines, and the operator-readable syntax stays useful for “is :25 open?” debugging. UFW is a poor fit for the high-cardinality, short-lived per-IP block decisions CrowdSec produces. Splitting the responsibilities keeps each tool playing to its strengths.

IPv6

The same port rules apply over IPv6. CrowdSec scenarios match both address families uniformly.

CLI

Standard UFW commands work:

ufw status numbered
ufw allow 8443/tcp
ufw delete <rule-number>

…but for IP-blocking always use cscli instead of ufw deny from.