Skip to content

feat(chart): add an egress NetworkPolicy - #51

Merged
rtrompier merged 2 commits into
mainfrom
feat/network-policy
Aug 6, 2026
Merged

feat(chart): add an egress NetworkPolicy#51
rtrompier merged 2 commits into
mainfrom
feat/network-policy

Conversation

@rtrompier

Copy link
Copy Markdown
Contributor

What

Adds a NetworkPolicy to the chart, enabled in prod. It is egress-only in this PR: DNS plus public HTTP/HTTPS, and nothing else. Every private range is excluded, so the app can no longer open connections to anything on the internal network.

Why

The app is a server-side fetcher: it connects to the upstream router and to MCP servers whose URL comes from the request (server_url in the request schema). Today the pod has unrestricted egress, so a crafted server_url can reach internal services (databases, caches, the Kubernetes API). This policy removes that reachability at the network layer, independently of any application-side validation.

Observed egress over a 2-hour window was public 443 only, which this policy allows (80 is allowed too, since MCP endpoints in the wild are not always TLS).

Notes

  • Ingress restriction is deliberately left off (networkPolicy.ingress.enabled: false). It comes in a follow-up, after a canary on another app, because a wrong load-balancer range would black-hole traffic. The allow-list itself is supplied by the deployment layer, never committed here.
  • enabled is a values flag, so rollback is a one-line revert.
  • The except blocks are the standard RFC1918 + link-local ranges; the link-local one also covers the instance metadata endpoint (defense in depth — the nodes already run with a metadata hop limit of 1).
  • DNS allows TCP/53 as well as UDP/53, since answers above 512 bytes fall back to TCP.

The renamed Argo app reads env/prod.yaml only, and the hub-prod app is
gone. This file is dead.
DNS plus public HTTP/HTTPS only; every private range is excluded. The
app fetches MCP servers at a URL supplied by the request, so without
this a crafted server_url reaches internal services. Ingress
restriction is gated off for now and its allow-list comes from the
deployment layer.
@rtrompier
rtrompier marked this pull request as ready for review August 6, 2026 07:25
@rtrompier
rtrompier merged commit 5fb4ecb into main Aug 6, 2026
1 check failed
@rtrompier
rtrompier deleted the feat/network-policy branch August 6, 2026 07:25
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