Skip to content

feat: NetworkPolicy to prevent proxy bypass in proxy-sidecar mode #1940

Closed as not planned

Description

@mrsabath

Feature Description

Implement the NetworkPolicy that prevents proxy bypass in proxy-sidecar mode — the enforcement half of epic #1429. HTTP_PROXY routing is advisory: an agent process can ignore the env vars and make direct outbound connections. A Kubernetes NetworkPolicy that denies direct egress from the agent container (allowing egress only from the proxy sidecar) closes that bypass gap and makes proxy routing enforceable without iptables or privileged mode.

Scope

  • NetworkPolicy that denies direct egress from the agent container(s) in a proxy-sidecar pod
  • Only the proxy sidecar is permitted to make outbound connections
  • Must not break in-cluster traffic the agent legitimately needs (K8s API, DNS, the proxy itself) — coordinate with the NO_PROXY concerns in kagenti-operator#384
  • Define behavior on clusters without a NetworkPolicy-enforcing CNI (document the limitation)

Acceptance criteria

  • With the policy applied, an agent attempting a direct (non-proxy) outbound connection is blocked
  • Traffic through the proxy sidecar succeeds (token exchange, tool calls, LLM egress)
  • DNS and K8s API access for the agent are preserved
  • Default deployment needs no iptables and no privileged mode (epic success criterion)

Related work

  • Webhook auto-generation of this policy: sibling issue (epic epic: Replace iptables Traffic Interception with Enforceable Proxy Routing #1429 Enforcement)
  • Operator NetworkPolicy machinery to reuse/align with: kagenti-operator#345 (merged, Sandbox support in NetworkPolicy controller), kagenti-operator#224 (closed, per-agent egress scoping), kagenti-operator#385 (open, per-agent egress for AgentRuntime)
  • NO_PROXY pitfalls: kagenti-operator#384

Epic: #1429 — Replace iptables Traffic Interception with Enforceable Proxy Routing
Section: Enforcement

Activity

  1. added
    enhancement
    Identity
    on Jun 12, 2026
  2. github-actions commented on Aug 24, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this issue is still relevant, please comment or remove the stale label.

  3. github-actions commented on Sep 8, 2026

    @github-actions

    This issue was closed because it has been stale for 14 days with no activity. Feel free to reopen if this is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Identityenhancementstale

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions