Skip to content
Skip to Content

Firewall

The ufw rules the setup writes on every connected server, the rules that keep ports Docker publishes closed, the private network's rules, the fail2ban settings, and what a disconnect leaves.

The setup turns on ufw, Ubuntu's firewall, on every server it connects. It replaces any rules the server had.

The default rules

DirectionRule
IncomingRefused by default.
OutgoingAllowed.
TCP on the SSH port the setup chose (between 20000 and 60000)Allowed, labelled OpenPanel SSH.
TCP 80Allowed, labelled HTTP.
TCP 443Allowed, labelled HTTPS.

The SSH port you connected on, usually 22, is closed once SSH has moved to its new port.

Ports Docker publishes

Docker writes its own forwarding rules, which pass before ufw's, so a port a container publishes would otherwise be open to the internet whatever ufw says. The setup adds rules to Docker's DOCKER-USER chain, in ufw's own files (/etc/ufw/after.rules and after6.rules), for IPv4 and IPv6:

TrafficRule
Answers to connections a container madeAllowed
From Docker's own networks, and from the private network's interfaceAllowed
To a published port 80 or 443, from outsideAllowed
Anything else to a container, from outsideDropped

The setup checks that Docker's forwarding passes through these rules, and stops if it does not. OpenPanel's own services publish no ports: their traffic reaches them through the agent.

The private network

When the server joins the organization's private network, the setup adds two rules, both labelled OpenPanel private network:

RuleWhy
Everything arriving on the network's interface, quietlane0So your organization's devices and servers reach the server on every port of its private address.
UDP 41641So other devices can connect to the server directly instead of through a relay.

fail2ban

fail2ban watches SSH on its new port. An address with 5 failed sign-ins within 10 minutes is banned for an hour.

See the rules on a server

A server's page shows its firewall under Security, from a live reading. On the server itself, sudo ufw status verbose lists the rules.

Ports for your services

Your services need no port on the server's firewall. Their HTTP, TCP and UDP traffic arrives at OpenPanel's edge and reaches them through the agent's own outgoing connection, so the server opens nothing for them. See the Ports reference for every port OpenPanel uses.

After a disconnect

A clean disconnect removes the two private-network rules. The other rules stay, with SSH still on its new port, and so do the rules for Docker's ports: they only protect the server. See Disconnect and force disconnect.