fix(networking): make the public gateway :8080 WireGuard-only (F2) #41

Merged
sirius merged 1 commit from secops/internal-gw-8080 into master 2026-11-27 05:09:34 +00:00
Owner

Summary

Closes finding F2 of the 2026-11-27 cluster netsec audit.

gateway-system/public listens on 0.0.0.0:8080 (cilium-envoy, hostNetwork), and allowedRoutes.namespaces.from: All means no hostname restriction. The internal_gw nft table already made 8081/8084-8087 WireGuard-only but did not list 8080, so the LAN could serve itself Forgejo and every public hostname over plain HTTP by spoofing Host: — bypassing Cloudflare TLS/WAF/rate limits and putting credentials on the wire inside 192.168.1.0/24.

None of that is needed: the only legitimate client is cloudflared on rpi, which connects to 10.10.0.2:8080 from 10.10.0.1 over the mesh.

Changes

  • siriussec-internal-gw.nft — add 8080 to all three rules (lo, 10.10.0.0/24 + 10.244.0.0/16, drop), with the reasoning in the header. This is the file already installed as /etc/nftables.d/internal-gw.nft and loaded by internal-gw-firewall.service.
  • internal-gw-firewall.service — Description now names 8080.
  • rpi-ufw-internal-gw.sh — add 8080 so a future gateway=true relabel on the Pi cannot re-open the LAN path.
  • README.md, docs/internal-wireguard-services.md — document that :8080 is WG-only and why.

Verification (live, siriussec, 2026-11-27 ~05:15Z)

Both polarities, from two vantage points:

# LAN (laptop 192.168.1.126 -> 192.168.1.179)  BEFORE: 200 14609B (Forgejo)
LAN  forgejo Host -> code=000 time=6.001s   (curl 28, DROP)
LAN  from rpi 192.168.1.125 -> 192.168.1.179:8080 -> code=000 time=6.003s
# mesh (10.10.0.3 and 10.10.0.1 -> 10.10.0.2)
WG   siriusdevops.com -> 200 30179B ; forgejo -> 200 14609B ; piedmont -> 200 7067B
     siriusgrowthsolutions.com -> 200 83772B ; osint -> 200 246888B
# public through Cloudflare
https://siriusdevops.com, forgejo, piedmont, siriusgrowthsolutions, osint -> all 200

nft list table inet internal_gw now shows tcp dport { 8080, 8081, 8084, 8085, 8086, 8087 } on all three rules; accept counter at 2037 packets after the change (cloudflared), drop counter at 18 (the LAN probes). No regression on 8081/8085: still DROP from the LAN, still 302/200 from the mesh.

## Summary Closes finding **F2** of the 2026-11-27 cluster netsec audit. `gateway-system/public` listens on `0.0.0.0:8080` (cilium-envoy, hostNetwork), and `allowedRoutes.namespaces.from: All` means no hostname restriction. The `internal_gw` nft table already made `8081/8084-8087` WireGuard-only but **did not list 8080**, so the LAN could serve itself Forgejo and every public hostname over plain HTTP by spoofing `Host:` — bypassing Cloudflare TLS/WAF/rate limits and putting credentials on the wire inside `192.168.1.0/24`. None of that is needed: the only legitimate client is `cloudflared` on rpi, which connects to `10.10.0.2:8080` **from `10.10.0.1` over the mesh**. ## Changes - `siriussec-internal-gw.nft` — add `8080` to all three rules (`lo`, `10.10.0.0/24` + `10.244.0.0/16`, drop), with the reasoning in the header. This is the file already installed as `/etc/nftables.d/internal-gw.nft` and loaded by `internal-gw-firewall.service`. - `internal-gw-firewall.service` — Description now names 8080. - `rpi-ufw-internal-gw.sh` — add 8080 so a future `gateway=true` relabel on the Pi cannot re-open the LAN path. - `README.md`, `docs/internal-wireguard-services.md` — document that :8080 is WG-only and why. ## Verification (live, siriussec, 2026-11-27 ~05:15Z) Both polarities, from two vantage points: ``` # LAN (laptop 192.168.1.126 -> 192.168.1.179) BEFORE: 200 14609B (Forgejo) LAN forgejo Host -> code=000 time=6.001s (curl 28, DROP) LAN from rpi 192.168.1.125 -> 192.168.1.179:8080 -> code=000 time=6.003s # mesh (10.10.0.3 and 10.10.0.1 -> 10.10.0.2) WG siriusdevops.com -> 200 30179B ; forgejo -> 200 14609B ; piedmont -> 200 7067B siriusgrowthsolutions.com -> 200 83772B ; osint -> 200 246888B # public through Cloudflare https://siriusdevops.com, forgejo, piedmont, siriusgrowthsolutions, osint -> all 200 ``` `nft list table inet internal_gw` now shows `tcp dport { 8080, 8081, 8084, 8085, 8086, 8087 }` on all three rules; accept counter at 2037 packets after the change (cloudflared), drop counter at 18 (the LAN probes). No regression on `8081`/`8085`: still DROP from the LAN, still 302/200 from the mesh.
Finding F2 of the 2026-11-27 cluster netsec audit: cilium-envoy on siriussec
binds gateway-system/public on 0.0.0.0:8080, so anyone on 192.168.1.0/24 could
`curl -H 'Host: forgejo.siriusdevops.com' http://192.168.1.179:8080/` and get
Forgejo (and every public site) over plain HTTP — no Cloudflare TLS, WAF, rate
limits or bot protection, and credentials on the wire inside the LAN. Live:
200 / 14609 B before this change.

The `internal_gw` nft table that already makes 8081/8084-8087 WG-only simply
did not list 8080. Add it to all three rules (lo, mesh+pods, drop), and to the
rpi ufw guard so a future `gateway=true` relabel on the Pi cannot re-open it.

Nothing legitimate needs the LAN path: cloudflared runs on rpi and connects to
10.10.0.2:8080 from 10.10.0.1 over the mesh (`ss` on siriussec shows
`10.10.0.1:* -> 10.10.0.2:8080 ESTABLISHED`), which the 10.10.0.0/24 accept
covers. 10.244.0.0/16 stays accepted for in-cluster probes.

Verified both polarities: LAN 192.168.1.179:8080 -> timeout/DROP (from two
vantage points), mesh 10.10.0.2:8080 -> 200 for all five public hostnames, and
all five public URLs still 200 through Cloudflare.
sirius merged commit d874d4afaf into master 2026-11-27 05:09:34 +00:00
sirius deleted branch secops/internal-gw-8080 2026-11-27 05:09:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/homek8s!41
No description provided.