2026-10-27 00:12:38 -04:00
|
|
|
#!/usr/sbin/nft -f
|
2026-10-27 00:44:32 -04:00
|
|
|
# Internal (WireGuard-only) gateway listeners: TCP 8081 (Grafana) and 8084
|
2026-10-27 00:35:09 -04:00
|
|
|
# (Hubble UI).
|
2026-10-27 00:12:38 -04:00
|
|
|
#
|
|
|
|
|
# Cilium's hostNetwork Envoy binds every Gateway listener on 0.0.0.0, so the
|
2026-10-27 00:35:09 -04:00
|
|
|
# internal listeners are open on the LAN interface the moment the Gateway is
|
|
|
|
|
# programmed. This table makes them answer only from the WireGuard mesh and the
|
2026-10-27 00:12:38 -04:00
|
|
|
# pod network. DROP (not reject) so a LAN scan sees a timeout, not a port that
|
|
|
|
|
# tells you something is listening.
|
|
|
|
|
#
|
2026-10-27 00:35:09 -04:00
|
|
|
# Adding an internal service: add its listener port to the set in all three
|
|
|
|
|
# rules below, reinstall this file, then
|
|
|
|
|
# `systemctl reload-or-restart internal-gw-firewall.service`. The same list
|
|
|
|
|
# must also be added to the rpi ufw rules (rpi-ufw-internal-gw.sh).
|
|
|
|
|
#
|
|
|
|
|
# Loaded by internal-gw-firewall.service on siriussec. `destroy` (not `delete`)
|
|
|
|
|
# so re-running the unit REPLACES the table instead of appending a second copy
|
|
|
|
|
# of the rules, and does not fail when the table does not exist yet.
|
|
|
|
|
destroy table inet internal_gw
|
2026-10-27 00:12:38 -04:00
|
|
|
table inet internal_gw {
|
|
|
|
|
chain input {
|
|
|
|
|
type filter hook input priority filter; policy accept;
|
|
|
|
|
|
|
|
|
|
# local process / kubelet probes
|
2026-10-27 00:44:32 -04:00
|
|
|
tcp dport { 8081, 8084 } iifname "lo" accept
|
2026-10-27 00:12:38 -04:00
|
|
|
|
|
|
|
|
# WireGuard mesh (Legion = 10.10.0.3, nodes, remote hub spokes)
|
|
|
|
|
# and the pod network (in-cluster scrapers, probes)
|
2026-10-27 00:44:32 -04:00
|
|
|
tcp dport { 8081, 8084 } ip saddr { 10.10.0.0/24, 10.244.0.0/16 } accept
|
2026-10-27 00:12:38 -04:00
|
|
|
|
|
|
|
|
# everything else: LAN, tailscale, public
|
2026-10-27 00:44:32 -04:00
|
|
|
tcp dport { 8081, 8084 } counter drop
|
2026-10-27 00:12:38 -04:00
|
|
|
}
|
|
|
|
|
}
|