fix: enable shareProcessNamespace for sandbox pods#10
Merged
Conversation
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>
3 tasks
This was referenced Jun 5, 2026
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.
Summary
shareProcessNamespace: trueto the sandbox pod spec inbuildSandboxSpec()sandbox execcommands/proc/<pid>/exefor processes spawned by the SSH relayContext
When
sandbox execis 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>/exefor binary identity. Without a shared PID namespace, this fails silently and OPA denies the request (403).With
shareProcessNamespace: true, all processes share a single/procview. 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
test_T4_3_sandbox_egress_policy.py::TestOpenShellSandboxWithPolicy::test_openshell_with_policy__curl_github_returns_200Assisted-By: Claude Code