homek8s/infrastructure/networking/internal/host-firewall
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Lance Walters 48b2b6ac01 internal gateway: single serving address (siriussec only) + a probe that notices when it flaps
rpi carried node-role.kubernetes.io/gateway=true, so cilium-envoy bound 8080/8081/8084
there too. Its Envoy completes TCP to a backend pod on siriussec but never finishes
the request: every hit on 10.10.0.1:8081/8084 hung 5s and returned 503, even from the
Pi own 127.0.0.1, while 10.10.0.2 answered in ms. Clients that tried either address
saw the dashboards flap. Remove the label from rpi: one gateway node, one address.

The Gateway status.addresses still lists every node InternalIP (cilium#29060 ignores
spec.addresses) - it is not a VIP; only 10.10.0.2 serves.

Add blackbox-exporter + Probe (8081, 8084 every 30s) + PrometheusRule alerts so a
regression is visible in the stack instead of on a phone. Give the internal_gw nft
accept rules counters so an allowed request is provable.
2026-10-27 00:57:39 -04:00
..
internal-gw-firewall.service hubble: bare-IP listener (8082) for the UI + WireGuard-only firewall on both gateway nodes 2026-10-27 00:35:16 -04:00
README.md hubble: move the UI listener to 8084 — 8082 is taken on rpi 2026-10-27 00:44:36 -04:00
rpi-ufw-internal-gw.sh hubble: move the UI listener to 8084 — 8082 is taken on rpi 2026-10-27 00:44:36 -04:00
siriussec-internal-gw.nft internal gateway: single serving address (siriussec only) + a probe that notices when it flaps 2026-10-27 00:57:39 -04:00

Internal Gateway host firewall

Cilium programs every Gateway listener on all nodes carrying node-role.kubernetes.io/gateway=true (rpi = 10.10.0.1, siriussec = 10.10.0.2) 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:

Host Mechanism Artifact
siriussec (10.10.0.2) 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) ufw rules inserted above the allow from 192.168.1.0/24 catch-all rpi-ufw-internal-gw.sh

Effective policy for :8081 (Grafana) and :8084 (Hubble UI) on both hosts: 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 new internal listener port is a LAN exposure until it is added here.

These are host units, not Flux objects — a node reinstall has to re-apply them. Install:

# 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
bash rpi-ufw-internal-gw.sh

Verify:

# siriussec
nft list table inet internal_gw
# rpi
ufw status | grep -E '8081|8084'

Negative test from the LAN must be a timeout (DROP), never 200:

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

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.