Skip to content

fix: enable shareProcessNamespace for sandbox pods#10

Merged
pdettori merged 1 commit into
mvpfrom
fix/share-process-namespace
Jun 5, 2026
Merged

fix: enable shareProcessNamespace for sandbox pods#10
pdettori merged 1 commit into
mvpfrom
fix/share-process-namespace

Conversation

@pdettori
Copy link
Copy Markdown

@pdettori pdettori commented Jun 5, 2026

Summary

  • Adds shareProcessNamespace: true to the sandbox pod spec in buildSandboxSpec()
  • Enables the supervisor's proxy to resolve process identity for sandbox exec commands
  • Without this, the proxy returns HTTP 403 on CONNECT because it cannot read /proc/<pid>/exe for processes spawned by the SSH relay

Context

When sandbox exec is used, the gateway relays the command to the supervisor's SSH daemon which spawns the process. The proxy's OPA evaluation path (resolve_tcp_peer_binary()) needs to walk /proc/*/fd/ to find which PID owns the socket, then read /proc/<pid>/exe for binary identity. Without a shared PID namespace, this fails silently and OPA denies the request (403).

With shareProcessNamespace: true, all processes share a single /proc view. The supervisor (PID 1) can see all spawned processes regardless of how they were created.

Risk: Low. The pod has a single user container (agent); sharing the PID namespace has no multi-container side effects.

Fixes: kagenti/kagenti#1830

Test plan

  • Build new driver image with this change
  • Deploy to HyperShift cluster with openshell stack
  • Run test_T4_3_sandbox_egress_policy.py::TestOpenShellSandboxWithPolicy::test_openshell_with_policy__curl_github_returns_200
  • Verify HTTP 200 (was 403 before)

Assisted-By: Claude Code

The proxy's OPA evaluation path requires /proc visibility to resolve
process identity via /proc/<pid>/exe. Without shareProcessNamespace,
processes spawned by `sandbox exec` (via SSH relay) cannot be identified
by the proxy, causing HTTP 403 on CONNECT requests even when the egress
policy allows the destination.

With shareProcessNamespace: true, all processes in the pod share a single
/proc view, allowing resolve_tcp_peer_binary() to walk /proc/*/fd/ and
find the binary owning any local TCP socket.

Fixes: kagenti/kagenti#1830

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
@pdettori pdettori merged commit b3a521d into mvp Jun 5, 2026
4 checks passed
@pdettori pdettori deleted the fix/share-process-namespace branch June 5, 2026 15:57
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.

1 participant