@@ -177,6 +177,15 @@ The driver reports this behavior through
177177in-process and external drivers. Older drivers omit the field and retain the
178178conservative operator-managed behavior.
179179
180+ Drivers that can verify a platform-native sandbox credential advertise
181+ ` GetCapabilities.supports_sandbox_authentication ` . On the path-scoped
182+ ` IssueSandboxToken ` exchange, the gateway forwards the opaque bearer credential
183+ to that selected driver through ` AuthenticateSandbox ` . The driver returns only
184+ the authenticated sandbox ID. The gateway then verifies that its durable
185+ sandbox record exists and mints the gateway JWT. The driver socket is therefore
186+ a sandbox-identity trust boundary, but it does not grant user or administrator
187+ authority.
188+
180189## Deletion Lifecycle
181190
182191Lifecycle requests use per-sandbox gates to serialize stop, start, and
@@ -465,20 +474,23 @@ watcher emits only sandbox CR changes, not platform events.
465474
466475### SA Token Authentication
467476
468- The gateway 's ` K8sServiceAccountAuthenticator ` adapts its ` NamespaceValidator `
469- per mode ( ` crates/ openshell-server/src/auth/k8s_sa.rs ` ) :
477+ The Kubernetes driver 's ` AuthenticateSandbox ` implementation applies its named
478+ ` [ openshell.drivers.kubernetes] ` configuration per mode :
470479
471480- ** Shared:** ` Exact ` — accepts only the single configured namespace.
472481- ** Managed:** ` Prefix ` — accepts any namespace starting with ` openshell-{gateway_id}- ` .
473482- ** Operator:** ` Allowlist ` — accepts namespaces present in the dynamic
474483 ` BTreeSet ` populated by the label/file watchers. Starts empty (fail-closed)
475484 until the first watcher update.
476485
477- These checks rely on an ownership invariant. In shared and managed modes, the
478- gateway and its trusted Agent Sandbox controller exclusively administer the
479- sandbox namespace, Sandbox CRs, sandbox pods, and configured sandbox
480- ServiceAccount. Other principals must not create or mutate those resources or
481- use that ServiceAccount. In operator mode, the platform operator retains
486+ It validates the projected token with Kubernetes ` TokenReview ` , checks the live
487+ pod UID, and verifies the pod's controlling Sandbox CR UID and sandbox ID before
488+ returning the identity to the gateway. These checks rely on an ownership
489+ invariant. In shared and managed modes, the Kubernetes driver and its trusted
490+ Agent Sandbox controller exclusively administer the sandbox namespace, Sandbox
491+ CRs, sandbox pods, and configured sandbox ServiceAccount. Other principals must
492+ not create or mutate those resources or use that ServiceAccount. In operator
493+ mode, the platform operator retains
482494namespace lifecycle ownership, but must preserve the same exclusive control of
483495Sandbox CRs and the pods and ServiceAccount used for sandbox token bootstrap.
484496An allowlisted namespace is therefore a trust grant, not a tenant isolation
0 commit comments