@@ -169,6 +169,15 @@ The driver reports this behavior through
169169in-process and external drivers. Older drivers omit the field and retain the
170170conservative operator-managed behavior.
171171
172+ Drivers that can verify a platform-native sandbox credential advertise
173+ ` GetCapabilities.supports_sandbox_authentication ` . On the path-scoped
174+ ` IssueSandboxToken ` exchange, the gateway forwards the opaque bearer credential
175+ to that selected driver through ` AuthenticateSandbox ` . The driver returns only
176+ the authenticated sandbox ID. The gateway then verifies that its durable
177+ sandbox record exists and mints the gateway JWT. The driver socket is therefore
178+ a sandbox-identity trust boundary, but it does not grant user or administrator
179+ authority.
180+
172181## Deletion Lifecycle
173182
174183Lifecycle requests use per-sandbox gates to serialize stop, start, and
@@ -455,20 +464,23 @@ watcher emits only sandbox CR changes, not platform events.
455464
456465### SA Token Authentication
457466
458- The gateway 's ` K8sServiceAccountAuthenticator ` adapts its ` NamespaceValidator `
459- per mode ( ` crates/ openshell-server/src/auth/k8s_sa.rs ` ) :
467+ The Kubernetes driver 's ` AuthenticateSandbox ` implementation applies its named
468+ ` [ openshell.drivers.kubernetes] ` configuration per mode :
460469
461470- ** Shared:** ` Exact ` — accepts only the single configured namespace.
462471- ** Managed:** ` Prefix ` — accepts any namespace starting with ` openshell-{gateway_id}- ` .
463472- ** Operator:** ` Allowlist ` — accepts namespaces present in the dynamic
464473 ` BTreeSet ` populated by the label/file watchers. Starts empty (fail-closed)
465474 until the first watcher update.
466475
467- These checks rely on an ownership invariant. In shared and managed modes, the
468- gateway and its trusted Agent Sandbox controller exclusively administer the
469- sandbox namespace, Sandbox CRs, sandbox pods, and configured sandbox
470- ServiceAccount. Other principals must not create or mutate those resources or
471- use that ServiceAccount. In operator mode, the platform operator retains
476+ It validates the projected token with Kubernetes ` TokenReview ` , checks the live
477+ pod UID, and verifies the pod's controlling Sandbox CR UID and sandbox ID before
478+ returning the identity to the gateway. These checks rely on an ownership
479+ invariant. In shared and managed modes, the Kubernetes driver and its trusted
480+ Agent Sandbox controller exclusively administer the sandbox namespace, Sandbox
481+ CRs, sandbox pods, and configured sandbox ServiceAccount. Other principals must
482+ not create or mutate those resources or use that ServiceAccount. In operator
483+ mode, the platform operator retains
472484namespace lifecycle ownership, but must preserve the same exclusive control of
473485Sandbox CRs and the pods and ServiceAccount used for sandbox token bootstrap.
474486An allowlisted namespace is therefore a trust grant, not a tenant isolation
0 commit comments