Files
OpenShell/crates/openshell-sandbox
Drew Newberry 32f026442e feat(sandbox): initiate supervisor connections across compute drivers (#4656)
* feat(sandbox): support sandbox-initiated supervisor connections

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* refactor(sandbox): consolidate control transport setup

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* test(sandbox): remove prototype-specific unit tests

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* feat(kubernetes): migrate legacy control flow on restart

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* docs: remove prototype changes from published docs

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(sandbox): adapt reverse control to published backend protocol

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* feat(sandbox): initiate supervisor connections across compute drivers

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(docker): stage reverse control socket for the supervisor identity

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* refactor(sandbox): keep runtime transports behind the backend

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(docker): mount the runtime control volume read-only

The sandbox runtime only dials the supervisor-owned control socket, so
it does not need write access to the control volume. Mount it read-only
in the runtime container and stop staging the control directory through
the runtime bundle; the supervisor stager already initializes it through
its own writable mount.

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(kubernetes): separate legacy and runtime-initiated control services

Keep os-boundary selecting the workload and add os-supervisor for runtime-initiated connections. Bind the mode marker to its runtime generation so a restart by an older gateway does not inherit stale mode metadata. Preserve the legacy Service across creation and restart, validate the active endpoint, and drop the Service patch permission.

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

---------

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
2026-10-20 18:25:45 +00:00
..

Sandbox runtime

openshell-sandbox owns the Linux workload isolation mechanisms and their kernel qualification probes. The linux module contains seccomp notifications and child filters, task-memory access, process-signal mediation, procfs descriptor lookup, socket identity, Landlock qualification, and the workload launch thread.

sandbox::linux composes policy enforcement. The top-level linux module owns the lower-level mechanisms used by that orchestration and the boundary server. Unsafe kernel ABI, process-launch, and descriptor-ownership operations stay in this runtime crate behind safe APIs where their contracts can be enforced.

The network broker retains source socket descriptors only while preparing a workload endpoint. A successful connection or listen releases that reference; the kernel then tracks the lifetime through workload-owned descriptors. Native accept and repeated listen preserve the socket's loopback confinement. Closing the last workload reference to a listener removes it without waiting for registry collection. Broker source descriptors always use close-on-exec independently of the workload's requested descriptor flags.

A boundary configured with RuntimeInitiatedTlsTcp binds no listener. It dials only the driver-provided supervisor addresses, which must be concrete, non-loopback, and share one port, and serves TLS and gRPC over that outbound connection. It keeps one spare connection that the supervisor has not yet used and dials a replacement when the supervisor starts HTTP/2 on it or the spare closes. Live connections keep the same disconnect, freeze, and recovery-deadline handling as listener mode, and the workload still cannot connect to the control port.