Repository navigation
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. |
drew
added this pull request to stack #4698
October 20, 2026 02:05
|
🌿 Preview your docs: https://nvidia-preview-pr-4732.docs.buildwithfern.com/openshell |
drew
force-pushed
the
feat/4731-stable-sandbox-spiffe/drew
branch
from
October 20, 2026 16:24
db063a9 to
8dfbd78
Compare
drew
force-pushed
the
feat/4731-stable-sandbox-spiffe/drew
branch
2 times, most recently
from
October 20, 2026 18:39
a876a1a to
437619a
Compare
drew
force-pushed
the
feat/4731-stable-sandbox-spiffe/drew
branch
from
October 20, 2026 22:10
3da8000 to
5fbece5
Compare
drew
force-pushed
the
feat/4731-stable-sandbox-spiffe/drew
branch
from
October 20, 2026 22:38
5fbece5 to
1899b5b
Compare
drew
force-pushed
the
feat/4731-stable-sandbox-spiffe/drew
branch
2 times, most recently
from
October 20, 2026 22:53
96ba1b7 to
e0b6cec
Compare
drew
force-pushed
the
feat/4731-stable-sandbox-spiffe/drew
branch
3 times, most recently
from
October 21, 2026 00:20
b4c1940 to
b733887
Compare
drew
force-pushed
the
feat/4731-stable-sandbox-spiffe/drew
branch
from
October 21, 2026 00:55
b733887 to
8e6786b
Compare
drew
force-pushed
the
feat/4731-stable-sandbox-spiffe/drew
branch
from
October 21, 2026 01:05
8e6786b to
6dd2cbb
Compare
3 of 6 tasks
…PIRE delegation A shared supervisor's own Workload API identity names the supervisor, so provider token grants failed closed for every hosted sandbox. With SPIRE delegation configured, a hosted session now obtains the JWT-SVID registered for its sandbox from the SPIRE agent's private admin socket through the Delegated Identity API, and uses it in the existing RFC 7523 and RFC 8693 grant flows. The SPIFFE ID derives from the immutable sandbox ID, <prefix>/gateway/<gateway-id>/sandbox/<sandbox-id>, so it survives restarts and runtime replacement. Each generation must earn its own authorization: - The registration now carries the gateway ID and session verification keys from the gateway's launch authentication. The session's current gateway JWT must verify against them and name exactly the registered sandbox, runtime generation, and credential epoch. - Before issuance, an authenticated gateway read confirms that the gateway still accepts the session's current credentials. - The agent is asked for one selector naming the gateway and sandbox. Exactly one SVID with the expected ID must come back, verified against the agent's JWT bundle; nothing falls back to another identity. - The session is re-authorized after every wait and before any cached token is served or a new one cached; a failed check discards the session's cache. Dedicated supervisors keep their Workload API identity unchanged. `mise run test:spire-delegation` runs these rules against a pinned SPIRE server and agent. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
The Kubernetes driver accepts an experimental_supervisor_spiffe_delegation table with the gateway topology: the SPIRE agent admin socket, the prefix of sandbox SPIFFE IDs, and the group that owns the admin socket. With it, the driver also accepts provider_spiffe_workload_api_socket_path for the gateway's own identity; without it, the topology still refuses provider SPIFFE identity. Both socket paths must be canonical and in separate, non-nested directories, the group must not be root, and the gateway ID must be a SPIFFE path segment. The chart passes the settings to the shared supervisor, mounts only the admin socket's directory from the node into the shared supervisor Pod, adds the socket group to its supplemental groups, and runs it as a service account of its own, so SPIRE can authorize exactly that Pod as a delegate. Gateway and workload Pods receive nothing new. SPIRE registration stays with the operator. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
…ties The e2e:kubernetes:shared-supervisor-spiffe lane installs pinned SPIRE hardened charts with the agent admin socket exposed for the shared supervisor, enables SPIRE delegation, and registers sandbox identities with ClusterStaticEntry resources as an operator would. Two sandboxes on one shared supervisor exchange a stored subject token through the existing RFC 8693 flow, each under its own SPIFFE ID, with a token service that only lets the identity an intermediate token names redeem it. The test checks that an unregistered sandbox is refused rather than served with the supervisor's identity, that a restart acquires again under the same SPIFFE ID, that a sandbox recreated under the same name has a new identity, and that no workload Pod or sandbox holds SPIFFE sockets, environment, or SVIDs. The wrapper removes the SPIRE fixture, including its CRDs, on exit. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
…visor Document the experimental_supervisor_spiffe_delegation table, the stable SPIFFE ID mapping, the SPIRE setup operators provide (admin socket and group, authorized delegate, per-sandbox registration entries), and how restarts, recreation, removal, and key rotation affect identities. Update the crate READMEs and the cluster debugging and Helm development skills. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
…ture provider_spiffe_workload_api_socket_path names a CSI mount inside gateway and dedicated supervisor Pods, while the SPIRE admin socket is a node hostPath mounted only into the shared supervisor, so comparing the two paths established nothing. The driver and chart now validate only the admin socket path itself, and the docs no longer require separate directories. The e2e SPIRE fixture refuses a cluster that already has SPIRE CRDs, creates its own namespace (openshell-e2e-spire by default) before claiming ownership, installs rather than upgrades, and removes only that namespace, its CRDs, and registration entries labeled with that namespace. The SPIRE delegation harness uses uv for host Python. The configuration reference now states that gateway session JWTs must expire and what cache hits check: the session's current JWT locally, with the gateway confirming the generation only before new issuance. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
… entries The SPIRE Controller Manager only reconciles entries of its own class, <namespace>-<release>. The fixture namespace is now openshell-e2e-spire by default and can be overridden, so the test derives the class from the fixture namespace instead of assuming the old spire-spire. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
…shell-crypto Main routes first-party key generation through the openshell-crypto facade. Generate the SPIRE delegation fixture's Ed25519 gateway key with it instead of calling rcgen's backend directly. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
drew
force-pushed
the
feat/4731-stable-sandbox-spiffe/drew
branch
from
October 21, 2026 01:48
6dd2cbb to
85cba03
Compare
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
…tion Merge the sandbox instance naming from the shared supervisor branch. Resolve conflicts by keeping the gateway SPIRE broker, the ProviderIdentitySource selection, and the shared OAuth cache TTL semantics while applying the instance names to the token grants, network inputs, shared host files, and READMEs. Describe the SPIFFE end-to-end test's hosted placement as a sandbox instance. Authentication sessions, session JWTs, the session-control protocol, and the openshell.ai/sandbox-runtime-supervisor-session annotation keep their names. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
…delegation at startup Merge the single hosted-instance registry from refactor/4700-instance-lifecycle-owner/drew and adapt provider token grants. Hosted instances now choose a token grant resolver once when their networking starts. GatewayTokenGrantResolver holds only the instance's authenticated gateway endpoint, forwards the credential key and request ID, and validates the final token. SpiffeTokenGrantResolver keeps local Workload API acquisition, the RFC 8693 intermediate exchange, and the instance cache, and still fails closed without a socket. The duplicate workload identity enum and the per-request gateway branch are gone. The gateway parses its SPIRE delegation settings once into SpiffeDelegation, held by every ServerState, instead of reparsing the SPIFFE ID prefix on each request. Cache hits and fresh tokens now pass one final grant-configuration and session check, and a fresh token is cached only after that check; the session checks around each remote call remain. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
ServerState::new_with_credentials now returns a configuration error when the SPIRE delegation settings are invalid, instead of panicking, so every gateway startup path that builds state reports bad deployment settings. The CLI still rejects them early with SpiffeDelegation::validate_config without building the runtime value, and ServerState::new keeps its documented panic for callers that skip validation. Also correct the hosted instance admission docs: a failed admission retains no instance, but deleting its directory is best effort and the next admission deletes stale files before reuse. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
6 tasks done
This branch has not been deployed
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
Let the Kubernetes shared supervisor use each sandbox's stable SPIFFE identity while keeping SPIRE access, JWT-SVIDs, and provider exchanges on the gateway. The supervisor authenticates with its gateway-issued sandbox session and receives only the final provider access token for injection into an admitted upstream request. Sandbox workloads receive no SPIFFE sockets or credentials.
Stacked on #4702, above #4701, #4695, and #4656. The previous supervisor-owned implementation is preserved on the backup branch.
Related Issue
Closes #4731
Changes
GetSandboxProviderAccessToken. The caller supplies only a gateway-issued, endpoint-bound credential key. The gateway checks the signed session, persisted generation, credential epoch, token lineage, and active state; attachment, endpoint, audience, and scopes come from trusted configuration.<prefix>/gateway/<gateway-id>/sandbox/<sandbox-id>from verified identity, require exactly the expected SVID, and verify signature, audience, and expiry against the agent's current trust bundle. Stop/start preserves identity; recreating the sandbox changes it.GatewayTokenGrantResolverfromSpiffeTokenGrantResolver, both implementing the existing resolver trait. Gateway mode holds only an authenticated gateway endpoint, with no local SPIFFE client, HTTP client, or grant cache. Dedicated supervisors retain their Workload API path, intermediate exchange, and local cache.openshell.gateway.experimental_spiffe_delegation. Helm mounts the private admin socket only on the gateway; its component Workload API setting remains available. Update the existing SPIRE fixture, generated Go bindings, and gRPC mocks for the additive RPC. Public documentation is deferred.SPIRE trusts the gateway as a delegate: operators must provision sandbox registrations within its agent's scope and control node placement. This does not add assignment-scoped SPIRE authorization, automatic registration, HA, other-driver enablement, or validated Kata support. Already-issued provider bearer tokens retain their normal expiration. Existing transport/session identifiers remain compatible.
Release Notes
Testing
The focused shared-supervisor, SPIFFE, and dedicated lifecycle scenarios compile. A fresh-cluster live run was blocked before OpenShell deployment: containerd could not create an inotify watcher (
too many open files; hostfs.inotify.max_user_instances=128), so the node never registered. No live scenarios ran; the temporary cluster was removed. No protobuf, SDK, or Helm files changed in this simplification follow-up; their earlier checks were not rerun.Checklist