2026-10-27 00:12:38 -04:00
|
|
|
# Internal Gateway host firewall
|
|
|
|
|
|
|
|
|
|
Cilium programs every Gateway listener on **all** nodes carrying
|
2026-10-27 01:04:12 -04:00
|
|
|
`node-role.kubernetes.io/gateway=true` and its Envoy binds
|
|
|
|
|
`0.0.0.0:<listener port>` in the host network namespace. So
|
|
|
|
|
`gateway-system/public` on 8080 and `internal/internal` on 8081 are *both*
|
|
|
|
|
listening on the LAN interfaces; the Gateway API object cannot say
|
|
|
|
|
"WireGuard only". The host firewall is the enforcement point.
|
|
|
|
|
|
|
|
|
|
**Since 2026-10-27 that label is on `siriussec` (10.10.0.2) only.** rpi used to
|
|
|
|
|
carry it as well; its Envoy bound the same ports but could never finish a
|
|
|
|
|
request to a backend pod on siriussec (TCP completes, no ACK on
|
|
|
|
|
`reserved:ingress`), so `10.10.0.1:8080/:8081/:8084` answered **503 after
|
|
|
|
|
exactly 5 s** for everything — even from rpi's own `127.0.0.1`. Clients that
|
|
|
|
|
tried either address saw the dashboards flap. One gateway node, one serving
|
|
|
|
|
address: `kubectl get nodes -l node-role.kubernetes.io/gateway=true` must return
|
|
|
|
|
exactly one node.
|
2026-10-27 00:12:38 -04:00
|
|
|
|
|
|
|
|
| Host | Mechanism | Artifact |
|
|
|
|
|
|------|-----------|----------|
|
2026-10-27 01:04:12 -04:00
|
|
|
| siriussec (10.10.0.2) — **load bearing** | nftables table `inet internal_gw`, loaded by a oneshot unit (same pattern as `k8s-api-firewall.service`) | `siriussec-internal-gw.nft`, `internal-gw-firewall.service` |
|
|
|
|
|
| rpi (10.10.0.1) — **inert guard** | ufw rules inserted above the `allow from 192.168.1.0/24` catch-all | `rpi-ufw-internal-gw.sh` |
|
2026-10-27 00:12:38 -04:00
|
|
|
|
2026-10-27 01:04:12 -04:00
|
|
|
Effective policy for `:8081` (Grafana) and `:8084` (Hubble UI):
|
2026-10-27 00:35:09 -04:00
|
|
|
**accept from 10.10.0.0/24 and 10.244.0.0/16, accept on lo, drop everything
|
|
|
|
|
else** (LAN, tailscale, public). Envoy binds every listener on `0.0.0.0`, so a
|
2026-10-27 01:04:12 -04:00
|
|
|
new internal listener port is a LAN exposure until it is added here. The
|
|
|
|
|
accept rules carry `counter`s: `nft list table inet internal_gw` shows packets
|
|
|
|
|
that reached the host and were allowed, which is the only way to tell "the
|
|
|
|
|
firewall accepted it and Envoy answered" from "the client never got there" —
|
|
|
|
|
rpi's ufw accept rules read 0 packets while requests to `10.10.0.1:8081` were
|
|
|
|
|
in fact reaching Envoy.
|
|
|
|
|
|
|
|
|
|
Nothing binds these ports on rpi any more, so its ufw rules no longer protect
|
|
|
|
|
anything; they are kept so a future `gateway=true` relabel does not silently
|
|
|
|
|
expose 8081/8084 on the Pi's LAN address. A stale client pointed at
|
|
|
|
|
`10.10.0.1:8081` therefore times out (ufw DROP) instead of being refused.
|
2026-10-27 00:12:38 -04:00
|
|
|
|
|
|
|
|
These are host units, not Flux objects — a node reinstall has to re-apply them.
|
|
|
|
|
Install:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# siriussec, as root
|
|
|
|
|
install -m 0644 siriussec-internal-gw.nft /etc/nftables.d/internal-gw.nft
|
|
|
|
|
install -m 0644 internal-gw-firewall.service /etc/systemd/system/
|
|
|
|
|
systemctl daemon-reload && systemctl enable --now internal-gw-firewall.service
|
|
|
|
|
|
|
|
|
|
# rpi, as root
|
2026-10-27 00:35:09 -04:00
|
|
|
bash rpi-ufw-internal-gw.sh
|
2026-10-27 00:12:38 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Verify:
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-10-27 01:04:12 -04:00
|
|
|
# siriussec — accept counters must be non-zero after a mesh/pod request,
|
|
|
|
|
# the drop counter non-zero after a LAN request
|
2026-10-27 00:12:38 -04:00
|
|
|
nft list table inet internal_gw
|
|
|
|
|
# rpi
|
2026-10-27 00:44:32 -04:00
|
|
|
ufw status | grep -E '8081|8084'
|
2026-10-27 00:12:38 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Negative test from the LAN must be a timeout (DROP), never 200:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
curl -m 3 -sS -o /dev/null -w '%{http_code}\n' http://192.168.1.179:8081/ # empty/000
|
|
|
|
|
curl -m 3 -sS -o /dev/null -w '%{http_code}\n' http://192.168.1.125:8081/ # empty/000
|
|
|
|
|
```
|
|
|
|
|
|
2026-10-27 00:35:09 -04:00
|
|
|
When a new internal listener port is added, add it to the `tcp dport { … }` set
|
|
|
|
|
in `siriussec-internal-gw.nft` and to `PORTS` in `rpi-ufw-internal-gw.sh` (which
|
|
|
|
|
inserts one deny for the port plus mesh and pod-CIDR allows above the LAN
|
|
|
|
|
catch-all), then reinstall both and re-run the two negative tests above with the
|
|
|
|
|
new port.
|