updated firewall docs
This commit is contained in:
1 file changed
+34
-5
@@ -4,10 +4,12 @@ id: home-server.mercury
|
|||||||
type: reference
|
type: reference
|
||||||
scope: [mercury, vps, firewall, fail2ban, uptime-kuma]
|
scope: [mercury, vps, firewall, fail2ban, uptime-kuma]
|
||||||
sensitivity: private-infrastructure
|
sensitivity: private-infrastructure
|
||||||
last_reviewed: "2026-10-27"
|
last_reviewed: "2026-10-30"
|
||||||
sources:
|
sources:
|
||||||
- kind: owner-report
|
- kind: owner-report
|
||||||
reference: "Hosting/firewall snapshot 2026-10-06; Fail2ban CLI/config and Kuma runtime 2026-10-26"
|
reference: "Hosting/firewall snapshot 2026-10-06; Fail2ban CLI/config and Kuma runtime 2026-10-26"
|
||||||
|
- kind: owner-report
|
||||||
|
reference: "SSH moved to TCP 58250; UFW status verbose after TCP-only web rule change, provider incoming firewall, ss -lntup and docker ps supplied 2026-10-30"
|
||||||
- kind: live-inspection
|
- kind: live-inspection
|
||||||
reference: "Hostname mercury and nginx 1.26.3 inspected 2026-10-27; firewall/hosting not revalidated"
|
reference: "Hostname mercury and nginx 1.26.3 inspected 2026-10-27; firewall/hosting not revalidated"
|
||||||
- kind: repository
|
- kind: repository
|
||||||
@@ -16,7 +18,7 @@ sources:
|
|||||||
paths: [mercury/stacks/uptime-kuma/docker-compose.yml]
|
paths: [mercury/stacks/uptime-kuma/docker-compose.yml]
|
||||||
related: [home-server.networking, home-server.operations, home-server.backups]
|
related: [home-server.networking, home-server.operations, home-server.backups]
|
||||||
update_triggers: [hosting-renewal, vps-resize, os-upgrade, firewall-change, kuma-change]
|
update_triggers: [hosting-renewal, vps-resize, os-upgrade, firewall-change, kuma-change]
|
||||||
unknowns: [renewal-price-and-date, creation-timestamp-timezone, certificate-renewal-method, mercury-backup-policy, fail2ban-enforcement-details-and-log-retention]
|
unknowns: [renewal-price-and-date, creation-timestamp-timezone, certificate-renewal-method, mercury-backup-policy, fail2ban-enforcement-details-and-log-retention, docker-firewall-enforcement, sshd-jail-port-after-ssh-move]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Mercury VPS
|
# Mercury VPS
|
||||||
@@ -32,7 +34,7 @@ unknowns: [renewal-price-and-date, creation-timestamp-timezone, certificate-rene
|
|||||||
| Hostname | `mercury`; older snapshot: `my-vps` |
|
| Hostname | `mercury`; older snapshot: `my-vps` |
|
||||||
| Public interface | `ens6`; `185.230.217.66/32` |
|
| Public interface | `ens6`; `185.230.217.66/32` |
|
||||||
| Created / payment | `2026-03-01 20:48:51`, timezone unknown; GBP 10 prepaid/year |
|
| Created / payment | `2026-03-01 20:48:51`, timezone unknown; GBP 10 prepaid/year |
|
||||||
| Administration | From Jupiter: `ssh mercury`; nginx/WireGuard apt-managed |
|
| Administration | SSH on TCP `58250`: `ssh -p 58250 jay@185.230.217.66`; from Jupiter: `ssh mercury` with `Port 58250` in that host's SSH client configuration; nginx/WireGuard apt-managed |
|
||||||
| Certificates | `/etc/letsencrypt/live/<domain>/{fullchain.pem,privkey.pem}`; renewal method unknown |
|
| Certificates | `/etc/letsencrypt/live/<domain>/{fullchain.pem,privkey.pem}`; renewal method unknown |
|
||||||
|
|
||||||
- Ingress, tunnel addresses and nginx configuration: [Networking](networking.md).
|
- Ingress, tunnel addresses and nginx configuration: [Networking](networking.md).
|
||||||
@@ -48,8 +50,34 @@ unknowns: [renewal-price-and-date, creation-timestamp-timezone, certificate-rene
|
|||||||
|
|
||||||
## Firewall / Fail2ban
|
## Firewall / Fail2ban
|
||||||
|
|
||||||
- Supplied firewall: UFW/iptables INPUT + FORWARD `DROP`; OUTPUT `ACCEPT`.
|
- Latest owner-supplied `ufw status verbose` snapshot **2026-10-30**: UFW active; public allows for TCP `80,443,58250` and UDP `51820`, each for IPv4 and IPv6. The earlier unqualified `80`/`443` rules have been replaced with TCP-only rules; no port `22` or UDP `80,443` allow remains.
|
||||||
- Allows TCP `22,80,443`; UDP `80,443,51820`. Docker forwarding has separate rules.
|
- UFW defaults: **deny incoming, allow outgoing, deny routed**; logging on (`low`); new profiles `skip`. Docker forwarding has separate rules and published container ports can bypass UFW INPUT filtering; the UFW defaults alone do not prove Docker port filtering.
|
||||||
|
- Last supplied provider incoming firewall: TCP `80,443,8443,8447,58250`; UDP `51820`, all sources. Removal of `8443,8447` has not been confirmed. This is separate from UFW; traffic must pass both layers.
|
||||||
|
|
||||||
|
### Public port policy
|
||||||
|
|
||||||
|
| Port | Recommendation | Reason |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| TCP `80` | Keep for now | nginx redirects HTTP to HTTPS. Mercury certificate renewal is unconfirmed; HTTP-01 renewal would also require it. Jupiter's DNS-01 setup does not establish Mercury's renewal method. |
|
||||||
|
| TCP `443` | Keep | Public nginx HTTPS ingress, including Uptime Kuma. |
|
||||||
|
| UDP `51820` | Keep | WireGuard carries Mercury-to-Jupiter application traffic. |
|
||||||
|
| TCP `58250` | Keep while public SSH is needed | Current administration port. Restrict source IPs only if stable administrator addresses and recovery access are available. |
|
||||||
|
| TCP `8443,8447` | Remove provider allows | No dependency in the documented ingress or repository configuration; neither has a listener or Docker port publication in the supplied 2026-10-30 output. |
|
||||||
|
| UDP `80,443` | No allowance needed; removed from UFW | Documented nginx uses TCP HTTP/HTTPS, not QUIC/HTTP/3. The supplied provider policy also has no UDP allows for these ports. |
|
||||||
|
|
||||||
|
Owner-supplied `sudo ss -lntup` and `sudo docker ps --format 'table {{.Names}}\t{{.Ports}}'` output on **2026-10-30** confirms:
|
||||||
|
|
||||||
|
- nginx listens on IPv4 TCP `80,443`; sshd on IPv4/IPv6 TCP `58250`; WireGuard on IPv4/IPv6 UDP `51820`. No listener on `22,8443,8447` or UDP `80,443`.
|
||||||
|
- `portainer_agent` publishes only `10.0.0.1:9001` over WireGuard; `uptime-kuma` publishes only `127.0.0.1:3001`. Neither requires another public provider allow.
|
||||||
|
- DNS `53`, SMTP `25` and containerd `33999` listen only on loopback. `systemd-resolved` listens on TCP/UDP `5355` (LLMNR) on wildcard addresses; do not add a public allow. UDP `68` is the DHCP client, not an application port to disable.
|
||||||
|
- `beszel-agent` is running but no TCP `45876` listener appears. A running container does not establish monitoring connectivity; inspect its logs and effective listener configuration before treating Beszel as healthy.
|
||||||
|
|
||||||
|
The TCP-only UFW web rules are confirmed for IPv4 and IPv6. Provider rule removal remains a recommendation, not a confirmed change. Do not close public `58250` until an alternative administration path has been tested with a fresh SSH connection; retain the current session and provider recovery console.
|
||||||
|
|
||||||
|
Do not open backend ports publicly: Traefik `8081` is on Jupiter over WireGuard; Kuma `3001` is loopback-only; Portainer agent `9001` is bound to Mercury's WireGuard address. Mercury's Beszel agent is intended to listen on TCP `45876`; its rule must be limited to `10.0.0.2` -> `10.0.0.1` over WireGuard, as described in `jupiter-stacks/mercury/stacks/beszel-agent/README.md`. That rule and listener are absent from the supplied snapshots.
|
||||||
|
|
||||||
|
### Fail2ban
|
||||||
|
|
||||||
- Fail2ban **1.1.0**, enabled at boot; effective settings from **2026-10-26**:
|
- Fail2ban **1.1.0**, enabled at boot; effective settings from **2026-10-26**:
|
||||||
|
|
||||||
| Jail | Source | Retries / window | Ban |
|
| Jail | Source | Retries / window | Ban |
|
||||||
@@ -60,6 +88,7 @@ unknowns: [renewal-price-and-date, creation-timestamp-timezone, certificate-rene
|
|||||||
|
|
||||||
- All three: action `nftables`; `ignoreip` empty. SSH journal `+` means **OR**.
|
- All three: action `nftables`; `ignoreip` empty. SSH journal `+` means **OR**.
|
||||||
- nginx jails target `http,https`. Action names do not prove blocked chains, ports or IPv6 coverage.
|
- nginx jails target `http,https`. Action names do not prove blocked chains, ports or IPv6 coverage.
|
||||||
|
- After moving SSH to `58250`, verify the `sshd` jail's effective action targets TCP `58250` (or all ports), not only the default `ssh`/`22`. For a multiport action, set `port = 58250` in the persistent `[sshd]` override and reload Fail2ban; inspect the generated nftables rules to confirm enforcement. This has not been revalidated since the port move.
|
||||||
- Persistent overrides: `/etc/fail2ban/jail.local` (nginx filters/paths/retries; botsearch timing) and `jail.d/defaults-debian.conf` (SSH systemd backend/match; nftables defaults).
|
- Persistent overrides: `/etc/fail2ban/jail.local` (nginx filters/paths/retries; botsearch timing) and `jail.d/defaults-debian.conf` (SSH systemd backend/match; nftables defaults).
|
||||||
- `banaction_allports=nftables[type=allports]` is defined; active use is unconfirmed. Other timing values are inherited.
|
- `banaction_allports=nftables[type=allports]` is defined; active use is unconfirmed. Other timing values are inherited.
|
||||||
- Log: `/var/log/fail2ban.log`; DB: `/var/lib/fail2ban/fail2ban.sqlite3`; `dbpurgeage=86400`.
|
- Log: `/var/log/fail2ban.log`; DB: `/var/lib/fail2ban/fail2ban.sqlite3`; `dbpurgeage=86400`.
|
||||||
|
|||||||
Reference in new issue
Block a user