Use Nebla

Firewalls

A firewall is a named set of allow rules for a server's public network. You apply it to servers directly or through a label selector, so new servers with a matching label are covered from their first boot.

Nebla writes the rules into each server's own Proxmox VM firewall. The datacenter firewall must be on for them to apply. See Connect Proxmox.

How rules work

Rules only allow traffic. What isn't allowed is dropped:

  • A server with no firewall allows all traffic.
  • A server with any firewall drops inbound traffic that no rule allows.
  • Outbound traffic is dropped only when one of the server's firewalls has an outbound rule. Then only what the outbound rules allow gets out.

When several firewalls apply to one server, their rules add up.

Create a firewall

Open Firewalls, choose Create firewall and add rules under Inbound and Outbound. Each rule has:

FieldValues
Protocoltcp, udp, icmp, esp or gre
PortA port such as 22 or a range such as 8000-8100, for TCP and UDP only
Source IPsFor inbound rules: up to 50 CIDRs. 0.0.0.0/0, ::/0 means anywhere.
Destination IPsFor outbound rules: up to 50 CIDRs.
DescriptionOptional, up to 255 characters
nebla firewall create --name web
nebla firewall add-rule web --direction in --protocol tcp --port 22 --source-ips 0.0.0.0/0,::/0
nebla firewall add-rule web --direction in --protocol tcp --port 443 --source-ips 0.0.0.0/0,::/0

Apply it

Under Applied to, pick a server, or a label selector such as role=web or env!=prod. The panel previews which servers match. A server's Firewalls tab shows each firewall that covers it, and whether it applies directly or through a selector.

You can also pick firewalls when you create a server. Nebla puts the rules in place before the server first boots.

nebla firewall apply-to-resource web --type server --server web1
nebla firewall apply-to-resource web --type label_selector --label-selector role=web

Selectors are comma-separated terms that all must match: key=value, key!=value, key (the label exists) and !key (it doesn't).

Limits

  • A firewall holds up to 100 rules, and a project up to 50 firewalls.
  • A server can have up to 5 firewalls.
  • The rules covering one server can expand to at most 250 Proxmox rules. IPv4 and IPv6 parts of a rule count separately, and long address lists may split into several rules.

Proxmox loads rule changes on a cycle of about 10 seconds, so a change takes a few seconds to apply. Nebla checks the rules on every server and repairs any that were changed in Proxmox by hand.