feat(chart): add an egress NetworkPolicy - #51
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_urlin the request schema). Today the pod has unrestricted egress, so a craftedserver_urlcan 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
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.enabledis a values flag, so rollback is a one-line revert.exceptblocks 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).