Skip to content

Add proxy setup for agents avoiding untrusted web access - #12584

Draft
PhilippMatthes wants to merge 13 commits into
masterfrom
agent-sandbox
Draft

PhilippMatthes wants to merge 13 commits into
masterfrom
agent-sandbox

Conversation

@PhilippMatthes

Copy link
Copy Markdown
Member

No description provided.

PhilippMatthes and others added 9 commits August 17, 2026 12:13
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.
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>
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.

2 participants