Skip to content

fix(driver): bypass Istio ambient inbound capture for sandbox pods#12

Closed
pdettori wants to merge 1 commit into
mainfrom
fix/istio-ambient-bypass
Closed

fix(driver): bypass Istio ambient inbound capture for sandbox pods#12
pdettori wants to merge 1 commit into
mainfrom
fix/istio-ambient-bypass

Conversation

@pdettori

@pdettori pdettori commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Annotates all sandbox pods with ambient.istio.io/bypass-inbound-capture: "true" so Istio ambient mode does not intercept inbound traffic to the pod's internal proxy port

Root Cause

On OpenShift with Istio ambient mesh (HBONE mode), ztunnel intercepts inbound TCP and re-originates connections from the pod's main IP (10.128.x.x) instead of preserving the sandbox veth source address (10.200.0.2). This breaks the proxy's /proc/net/tcp-based identity resolution — peer_addr() returns ztunnel's address, and the port lookup in the sandbox network namespace's TCP table finds nothing.

The sidecar-mode annotation (traffic.sidecar.istio.io/excludeInboundPorts) has no effect in ambient mode — only ambient.istio.io/bypass-inbound-capture works.

On Kind (upstream Istio 1.28), ztunnel already preserves source IPs through the REDIRECT, so this annotation is a harmless no-op there.

Test plan

  • go test ./internal/driver/ passes (new test for annotation)
  • Build new driver image and deploy to OpenShift
  • Verify sandbox egress policy works (identity resolution succeeds)
  • Verify Kind behavior unchanged

Fixes: kagenti/kagenti#1855

Assisted-By: Claude Code

On OpenShift with Istio ambient mesh (HBONE mode), ztunnel intercepts
inbound TCP to the pod and re-originates connections from the pod's
main IP instead of preserving the sandbox veth source address. This
breaks the proxy's /proc/net/tcp-based identity resolution because
peer_addr() returns ztunnel's address, not the sandbox's 10.200.0.2.

Always annotate sandbox pods with:
  ambient.istio.io/bypass-inbound-capture: "true"

This tells Istio ambient to skip inbound interception, preserving
the original source address on the veth pair so identity resolution
can correlate sockets to sandbox processes.

The sidecar-mode annotation (traffic.sidecar.istio.io/excludeInboundPorts)
has no effect in ambient mode.

Fixes: kagenti/kagenti#1855

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
@pdettori pdettori closed this Jun 8, 2026
@pdettori pdettori deleted the fix/istio-ambient-bypass branch June 8, 2026 18:36
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.

fix(openshell): sandbox egress policy denied on OpenShift — entrypoint_pid stuck at 0

1 participant