Add proxy setup for agents avoiding untrusted web access - #12584
Draft
PhilippMatthes wants to merge 13 commits into
Draft
PhilippMatthes wants to merge 13 commits into
PhilippMatthes wants to merge 13 commits into
Conversation
Remove the explicit HTTP proxy (Squid) and replace it with a transparent iptables + Envoy sidecar approach. The agent no longer needs HTTP_PROXY/HTTPS_PROXY environment variables. Architecture: - Init container installs iptables NAT+filter rules in the pod network namespace, redirecting TCP/80 and TCP/443 to Envoy - Envoy enforces domain allowlist by HTTP Host and TLS SNI - Wildcards supported (e.g. *.github.com) - ORIGINAL_DST clusters forward to the agent's resolved IPs - Unknown/missing SNI fails closed Added: - templates/agent-deployment.yaml - templates/envoy-configmap.yaml Removed: - templates/proxy-configmap.yaml (Squid) - templates/proxy-deployment.yaml (Squid) - templates/proxy-service.yaml (Squid)
Signed-off-by: Philipp Matthes <p.matthes@sap.com>
Logs ALLOW and DENY lines to stdout with the requested SNI so blocked domains are easily discoverable: kubectl logs deploy/agent-sandbox -c agent-sandbox-envoy | grep DENY
Users can now pass agent.container.command to override the entrypoint, agent.container.env for extra environment variables, agent.container.volumeMounts for additional mounts, and agent.volumes for extra pod volumes. All optional.
Allows exempting specific IP:port pairs from the sandbox, e.g. a local LLM API. Punches holes in both the iptables FILTER chain and the NetworkPolicy for each configured endpoint.
PhilippMatthes
force-pushed
the
agent-sandbox
branch
from
August 21, 2026 14:49
2cb5290 to
4849183
Compare
Signed-off-by: Philipp Matthes <p.matthes@sap.com>
Signed-off-by: Philipp Matthes <p.matthes@sap.com>
The Envoy ConfigMap, NetworkPolicy, and the pod enforce label used shared constant names, so deploying multiple sandboxes in one namespace collided. The enforce label in particular was namespace-global, making each NetworkPolicy match every agent pod rather than its own. Name the ConfigMap <agent>-envoy, the NetworkPolicy after agent.name, and make the enforce label per-agent, all via new helpers.
Signed-off-by: Philipp Matthes <p.matthes@sap.com>
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.
No description provided.