Uh oh!
There was an error while loading. Please reload this page.
feat(kubernetes): add sidecar supervisor topology - #2076
Conversation
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
🌿 Preview your docs:https://nvidia-preview-pr-2076.docs.buildwithfern.com/openshell |
Label |
4f981c2 to
8c9ae53Comparemrunalp
commented
Jul 6, 2026
Some comments with help of agent1. Central trust boundary — the workload can use the sandbox's gateway identity . 2. nftables fence only covers TCP/UDP. 3. 4. Doc drift in the debug skill. |
e00a00b to
ed858ebCompareTaylorMutch
commented
Jul 6, 2026
Addressed this by moving the supervisor and sandbox to run with different GIDs. Updated the other areas with clarifying comments. |
mrunalp
commented
Jul 7, 2026
Deployed this branch on an OpenShift 4.22 cluster (K8s 1.35) with Root causeIn
Step 2 runs as root with Note the state dir was already changed to |
TaylorMutch
commented
Jul 7, 2026
@mrunalp I reproduced locally and pushed a fix. Please have a look when you get a chance! |
3d80066 to
254cdbeCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
drew
commented
Jul 7, 2026
Looks like you've rebased now since that's been merged? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mrunalp
commented
Jul 8, 2026
Discussed with @TaylorMutch: Suggestion: keep Landlock (and seccomp) in sidecar |
TaylorMutch
commented
Jul 8, 2026
Add the Kubernetes sidecar supervisor topology, its Helm/Skaffold configuration, topology documentation, and sidecar e2e matrix coverage. Skip root-only sandbox identity rewriting when process enforcement is network-only so the low-permission sidecar process container can start successfully. Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Run nftables setup as individual commands so optional conntrack and log expressions can fail without rolling back required table, chain, and reject rules. Signed-off-by: Seth Jennings <sjenning@redhat.com> Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Render sidecar pods with a shared process namespace, keep binary-aware network policy enabled, and move Kubernetes sidecar settings under the nested sidecar config table. Also apply unprivileged Landlock/seccomp setup in NetworkOnly supervisor mode so sidecar topology keeps sandbox child hardening without privileged process setup. Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Coordinate sidecar policy and provider bootstrap over a local Unix socket so the process leaf no longer reads policy/provider snapshot files. Report entrypoint startup through the control channel and keep gateway credentials confined to the network sidecar. Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
9d3bef7 to
93b86f8CompareUh oh!
There was an error while loading. Please reload this page.
- Repin codebase-grounding.md to 8eacb47 (sidecar supervisor topology, NVIDIA#2076); update capabilities line numbers (1534→2538, 1540→2544), init container line numbers (191→423, 993→1506, 1185→2113), and remove the stale "no native sidecars today" claim. Add openshell-network-init and openshell-supervisor-network sidecar entries and expand the rg pattern. - Add Implementation column to topology-matrix.md; mark Co-located/in-pod and Same-pod composite as implemented (original topology and NVIDIA#2076 respectively); remaining patterns noted as proposed. Signed-off-by: Jordan Ganoff <jordan.ganoff@docker.com>
All line numbers and function names verified against the post-sidecar state of the codebase (commit 8eacb47, NVIDIA#2076). Changes: - process.rs: ProcessHandle::spawn 440→527, netns param 446→535; drop_privileges call sites 603/700→710/812, enforcement 613/705→721/818-819; enter_netns_and_sandbox now documented at ssh.rs:1245 - CLONE_NEWNET call sites: process.rs:589→695, ssh.rs:619/1186→653/1262, supervisor_session.rs:610→735, netns/mod.rs:363→342 (226 unchanged) - CLONE_NEWNS: was one unshare at :393; now unshare at :449 and a new setns at :480 added for sidecar mount-namespace entry - nft fail-open: line 264→265, return Ok(()) range 272-277→277; note that the sidecar path (netns/mod.rs:477) requires nft and returns an error if absent, fixing the invariant bug for the sidecar topology - nft_ruleset.rs: policy accept 41→53; accept rules 43-49→56-92; reject rules now at 106+ - VM driver MASQUERADE: runtime.rs:417/436→418/437 - Agent command: main.rs:331→601; sleep infinity driver.rs:1886→2937, clarify it is set via SANDBOX_COMMAND env var - OPA evaluation: proxy.rs:1611 / evaluate_opa_tcp renamed to authorize_egress_intent at proxy.rs:1955; NetworkInput built at :2032 - openshell.proto: clarify no lifecycle Attach; note AttachSandboxProvider (provider record attachment, not isolation lifecycle) - README.md appendix: update pinned commit reference a5161d0→8eacb477 Signed-off-by: Jordan Ganoff <jordan.ganoff@docker.com>
Summary
Adds an experimental Kubernetes
sidecarsupervisor topology after the combined-topology base from #2074. The defaultcombinedtopology remains unchanged;sidecaris opt-in and may change as we continue validating the permission model, pod layout, and configuration surface across Kubernetes runtimes.The goal of
sidecaris to move pod-level network enforcement, gateway authentication, gateway session handling, and SSH relay ownership out of the agent container and into a dedicated network sidecar. The agent container runs as the resolved sandbox UID/GID withrunAsNonRoot,allowPrivilegeEscalation: false, and all Linux capabilities dropped.Outcome
combinedas the default topology and full OpenShell enforcement path.topology = "sidecar"under[openshell.drivers.kubernetes]and nests sidecar-only settings under[openshell.drivers.kubernetes.sidecar]; Helm renders the same shape fromsupervisor.topologyandsupervisor.sidecar.*.shareProcessNamespace: truefor sidecar pods so the network sidecar can resolve workload process and binary identity through/proc.supervisor.sidecar.processBinaryAwareNetworkPolicy=falsedrops the sidecarSYS_PTRACEcapability and downgrades sidecar network policy to endpoint/L7 enforcement without matchingpolicy.binaries.deploy/helm/openshell/ci/values-sidecar-kata.yamlas the local/CI-dev overlay used for Kata validation.Enforcement Model
combinedremains the complete OpenShell sandbox contract: network policy, filesystem policy, process controls, supervisor privilege drop, supervisor identity mount isolation, gateway relay, SSH, exec, and file sync all run through the existing agent-container supervisor path.sidecaris network-focused but no longer disables all process-side enforcement:/procinspection.Runtime Validation Status
gcloud container clusters create-auto --workload-policies=allow-net-admin; the Google Cloud CLI reference listsallow-net-adminas the supported Autopilot workload policy: https://docs.cloud.google.com/sdk/gcloud/reference/container/clusters/create-auto#--workload-policiesdeploy/helm/openshell/ci/values-sidecar-kata.yaml. This validation passed without using the supervisor sideload init container.Related Issue
References #1827, #981, #899, #1305.
Related PRs: #1973, #2074, #2016.
Changes
sidecartopology and sidecar-specific configuration.supervisor_topologytotopologyand move sidecar settings underopenshell.drivers.kubernetes.sidecar.network-onlybehavior for sidecar mode while preserving workload launch, Landlock/seccomp application, and SSH/session relay behavior.SYS_PTRACEcapability when users accept the downgrade.Testing
git diff --check origin/main..feat/kubernetes-sidecar-topology-v2cargo check -p openshell-driver-kubernetes -p openshell-sandbox -p openshell-supervisor-process -p openshell-supervisor-networkcargo test -p openshell-driver-kubernetes --libcargo test -p openshell-supervisor-process --libmise run helm:testmarkdownlint-cli2 docs/kubernetes/topology.mdx docs/kubernetes/setup.mdxruby -e 'require "yaml"; YAML.load_file(".github/workflows/branch-e2e.yml"); puts "ok"'mise run rust:lintmise run rust:format:check && mise run rust:lintcargo test -p openshell-supervisor-processCARGO_BUILD_JOBS=1 mise run pre-commitOpenShell / Branch Checkspassing on this branch, including Linux amd64 and arm64 Rust jobs.HELM_K3S_LB_HOST_PORT=18080 mise run e2e:kubernetes:sidecar--workload-policies=allow-net-admin.deploy/helm/openshell/ci/values-sidecar-kata.yaml; validation passed without the supervisor sideload init container.Checklist