Skip to content

feat(network-policy): opt-in operator egress NetworkPolicy for the kustomize base (#299) - #317

Merged
thc1006 merged 1 commit into
mainfrom
feat/operator-egress-networkpolicy
Jul 31, 2026
Merged

feat(network-policy): opt-in operator egress NetworkPolicy for the kustomize base (#299)#317
thc1006 merged 1 commit into
mainfrom
feat/operator-egress-networkpolicy

Conversation

@thc1006

@thc1006 thc1006 commented Jul 31, 2026

Copy link
Copy Markdown
Owner

The network-layer half of the remoteControl.endpoint SSRF defense tracked in #299.

Context

#299's proposed defense is two-layer: an app-layer host allow-list (already shipped as --remote-control-allowed-endpoint-hosts in #300) plus a network-layer egress restriction. The Helm chart already ships the egress policy (dist/chart/templates/manager/networkpolicy.yaml, gated by networkPolicy.enable, with per-CR gNB/Prometheus port values and extraEgress for CIDR-scoping). But the kustomize base (config/network-policy/) only had the metrics ingress rule — so a non-Helm (kubectl apply -k) deployment had no egress control. This adds the parity resource.

Change

config/network-policy/allow-egress-traffic.yaml — default-deny egress with explicit allows:

  • DNS (53 TCP/UDP)
  • HTTPS 443 (Kubernetes API server + CelesTrak + Space-Track GP fetch)
  • Prometheus 9090 (NTNSlice metricsSource)
  • gNB 8001 (NTNCellConfig runtime push)

Added to the already opt-in config/network-policy bundle (config/default/kustomization.yaml keeps - ../network-policy commented out), so existing deployments are unchanged. Needs a NetworkPolicy-enforcing CNI (Calico/Cilium; Kind's kindnet does not enforce, so it is inert on e2e).

SSRF note (in the file)

The port-only gNB/Prometheus rules allow those ports to any destination, which does not stop the operator dialing an arbitrary host on that port. The file documents replacing the port-only gNB rule with a CIDR-scoped to: [ipBlock] block to actually bound egress to sanctioned gNB subnets — that, plus the app-layer allow-list, is what closes the probing surface. The ground-station monitoring endpoint (also CR-controlled) is called out as another egress to scope.

Verification

kustomize build config/network-policy renders both policies (Egress + Ingress); kustomize build config/default unchanged (bundle stays commented out).

With this, #299's two-layer defense exists in both the Helm and kustomize paths; the remaining #299 items (a ServiceReference alternative to free-form host:port) stay tracked there.

…stomize base (#299)

The Helm chart already restricts operator egress (networkPolicy.enable), but the kustomize
base had only the metrics ingress rule, so a non-Helm deployment had no egress control. Add
config/network-policy/allow-egress-traffic.yaml — the network-layer half of the
remoteControl.endpoint SSRF defense: default-deny egress with explicit allows for DNS, HTTPS
443 (API server / CelesTrak / Space-Track), and the per-CR Prometheus (9090) and gNB (8001)
ports. It joins the already opt-in config/network-policy bundle (disabled by default; needs a
NetworkPolicy-enforcing CNI), so existing deployments are unchanged. Documents that the
port-only gNB rule must be replaced with a CIDR-scoped to: block to actually bound where the
operator may dial; the app-layer --remote-control-allowed-endpoint-hosts list is the complement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant