Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a5b08ad
feat(gateway): broker stable sandbox SPIFFE provider tokens
drew Oct 22, 2026
7410286
refactor(gateway): rename SPIFFE delegation configuration
drew Oct 22, 2026
22456ba
fix(provider): reuse broker channels and attribute grant failures
drew Oct 22, 2026
4a8efe1
test(provider): satisfy broker logging lint checks
drew Oct 22, 2026
4686ac0
fix(provider): harden broker caching and deployment prerequisites
drew Oct 23, 2026
de6dd89
refactor(identity): extract SPIRE sandbox identity adapter
drew Oct 23, 2026
e33dd11
refactor(identity): move shared SPIFFE types out of core
drew Oct 23, 2026
16f61f5
fix(supervisor): follow the sandbox reconciler leader (#4853)
drew Oct 23, 2026
3593be0
chore(sdk): drop regenerated frozen Go bindings
TaylorMutch Nov 10, 2026
626feae
chore: integrate main into SPIFFE token broker
TaylorMutch Nov 10, 2026
100986e
chore: merge latest main into SPIFFE token broker
TaylorMutch Nov 12, 2026
7f88a02
test(spiffe): verify provider tokens across supervisor failover
TaylorMutch Nov 13, 2026
0d71cfd
chore: merge main into SPIFFE token broker
TaylorMutch Nov 13, 2026
3f939a0
feat(crypto): verify TLS peers by SPIFFE identity
TaylorMutch Nov 13, 2026
89aad0f
feat(spiffe): use Broker API for sandbox identity issuance
TaylorMutch Nov 13, 2026
17c8b7b
test(spiffe): verify broker authorization and credential rotation
TaylorMutch Nov 13, 2026
4532524
docs(spiffe): clean up broker troubleshooting and test wording
TaylorMutch Nov 16, 2026
8a2ef16
chore: merge main into SPIFFE token broker
TaylorMutch Nov 16, 2026
d7b0c95
chore: merge main into SPIFFE token broker
TaylorMutch Nov 16, 2026
d4f7fba
feat(spiffe): authorize Broker agents across Kubernetes nodes
TaylorMutch Nov 18, 2026
5b31015
fix(spiffe): send canonical credential keys to the gateway
TaylorMutch Nov 18, 2026
1ebb5bc
perf(providers): resolve only the requested token grant profile
TaylorMutch Nov 18, 2026
e08ba9e
fix(providers): bound broker admission and refresh expired cache hits
TaylorMutch Nov 18, 2026
f623b53
chore(server): remove unused protobuf codec dependency
TaylorMutch Nov 18, 2026
7a5e0ff
fix(spiffe): classify identity failures without retrying configuratio…
TaylorMutch Nov 18, 2026
ca2c50e
fix(spiffe): unify gateway identity configuration and document shared…
TaylorMutch Nov 18, 2026
142e73e
test(providers): verify targeted snapshot freshness and cache reuse
TaylorMutch Nov 18, 2026
0c43416
test(spiffe): support remote fixtures and remove CSI consumers before…
TaylorMutch Nov 18, 2026
5f2a2c3
fix(providers): validate uncached sources before selecting a grant
TaylorMutch Nov 18, 2026
4480272
test(spiffe): validate agent replacement and remote supervisor failover
TaylorMutch Nov 18, 2026
32022ce
feat(spiffe): connect the gateway to its node-local Broker agent
TaylorMutch Nov 18, 2026
14a87e4
test(spiffe): validate node-local Broker routing across gateway reloc…
TaylorMutch Nov 18, 2026
dd97252
chore: merge main into SPIFFE broker branch
TaylorMutch Nov 18, 2026
fc7415c
fix(ci): satisfy certificate test lint and refresh merged lockfile
TaylorMutch Nov 18, 2026
0ee551e
test(crypto): initialize OpenSSL for SPIFFE certificate verification
TaylorMutch Nov 18, 2026
6834b2d
chore(spiffe): remove prototype tooling and stale guidance
TaylorMutch Nov 18, 2026
5f842ca
fix(providers): share acquisition failures with waiting requests
TaylorMutch Nov 18, 2026
be94c73
fix(core): initialize provider-token channels without eager connects
TaylorMutch Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .agents/skills/helm-dev-environment/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,53 @@ OPENSHELL_E2E_KUBE_IMAGE_PULL_SECRET=e2e-regcred \
mise run e2e:kubernetes:shared-supervisor
```

`mise run e2e:kubernetes:shared-supervisor-spiffe` installs pinned SPIRE charts
(`ci/values-spire-broker-stack.yaml`) and the `openshell.gateway.spiffe_broker`
overlay (`ci/values-supervisor-spiffe.yaml`). It exercises provider exchange and
abrupt supervisor takeover over TLS, using Sandbox CR UID registrations and
enforced Kubernetes authorization. Workload generation, Pod, process, and stable
SPIFFE identity survive; the new owner acquires a fresh provider token and the
broker rejects the old bearer. The fixture's 30-second workload X.509-SVIDs
exercise acquisition after credential rotation. The gateway Pod must pass
Restricted Pod Security admission. The task owns its SPIRE install and cluster.

The task creates three nodes (`HELM_K3S_AGENT_COUNT=2` adds two k3d agents) and
requires three SPIRE agents. Its cluster-scoped `server_spiffe_id_prefix` accepts
the concrete node identities, and a node alias distributes Sandbox registrations
to all eligible agents. The test selects each Broker backend in turn and forces
a new generation's acquisition, then replaces one agent and checks acquisition
without re-registering the sandbox. Exact-ID mode remains available for a fixed
endpoint. The installed SPIRE version and operator must expose the experimental
Broker API.

For remote clusters, set `OPENSHELL_E2E_HOST_GATEWAY_IP` to a host reachable
from Pods. Optional `OPENSHELL_E2E_SPIFFE_STS_PORT` and
`OPENSHELL_E2E_SPIFFE_TARGET_PORT` fix the test's host listener ports so an
operator can forward them through a reverse tunnel. Keep the tunnel available
through the test and remove it afterward. Use an explicit kubeconfig and context
to avoid repository environment defaults targeting a local cluster.
`OPENSHELL_E2E_SPIFFE_DRIVER_CONFIG_JSON` can pass a driver override to test
sandbox creation, such as a node selector for a Landlock-capable pool. Enable
`allow_driver_config` in the test gateway when using this override. GKE COS
nodes may lack Landlock; use compatible Ubuntu nodes for sandbox workloads.
For remote abrupt-failover coverage, set
`OPENSHELL_E2E_SUPERVISOR_PROCESS_CONTROL=1`. Before creating sandboxes, the test
adds an unprivileged process-control sidecar and enables the supervisor Pod's
shared process namespace. The sidecar sends SIGKILL to the supervisor as the
same UID; it needs no host PID namespace, capabilities, or runtime socket.
The default k3d/kind test continues to kill through the node container runtime.

### Shared supervisor high availability

`mise run e2e:kubernetes:shared-supervisor-spiffe-node-local` validates direct
node-local Broker TCP routing. The chart injects `OPENSHELL_NODE_IP` from
`status.hostIP` for `spiffe_broker.node_local_port`; it creates no Broker Service.
The task uses an external PostgreSQL fixture and a gateway Deployment, moves
the gateway across the SPIRE nodes, restricts Broker egress to its current node,
and forces fresh token acquisition on each node and after local agent replacement.
The shared-supervisor failover, credential rotation, and identity fencing checks
also run. Keep gateway/supervisor/sandbox images from the same branch.

The shared supervisor is always a pool of `supervisor.replicas` members
(default 1), or an HPA-managed pool when `supervisor.autoscaling.enabled=true`.
`ci/values-supervisor-autoscaling.yaml` enables the memory HPA (default `512Mi`
Expand Down
8 changes: 7 additions & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test-group = "kubernetes-ha"
# they kill members or gateways, or scale the pool. Never run them at once.
# Test names, not binary(), for the reason above.
[[profile.e2e-kubernetes.overrides]]
filter = "test(/^(losing_a_supervisor_pod_moves_its_sandboxes_without_restarting_them|scaling_a_supervisor_pool_up_and_down_keeps_its_sandboxes_running|pool_sessions_follow_their_supervisors_gateway|supervisors_spread_evenly_across_gateways)$/)"
filter = "test(/^(losing_a_supervisor_pod_moves_its_sandboxes_without_restarting_them|scaling_a_supervisor_pool_up_and_down_keeps_its_sandboxes_running|pool_sessions_follow_their_supervisors_gateway|shared_supervisor_acts_as_each_sandboxs_stable_spiffe_identity|supervisors_spread_evenly_across_gateways)$/)"
test-group = "kubernetes-shared-supervisor-pool"

# Scaling the pool runs two bounded Helm upgrades (up to 6 minutes each), waits
Expand All @@ -47,6 +47,12 @@ slow-timeout = { period = "60s", terminate-after = 20 }
filter = "test(/^pool_sessions_follow_their_supervisors_gateway$/)"
slow-timeout = { period = "60s", terminate-after = 20 }

[[profile.e2e-kubernetes.overrides]]
filter = "test(/^shared_supervisor_acts_as_each_sandboxs_stable_spiffe_identity$/)"
# Fresh acquisitions through every node and a replacement agent precede
# supervisor failover and credential rotation.
slow-timeout = { period = "60s", terminate-after = 15 }

# One bounded rollout per supervisor and one for the gateway, each followed by
# a settle round.
[[profile.e2e-kubernetes.overrides]]
Expand Down
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Do not rely on this file for a full inventory. The detailed public and contribut
| `crates/openshell-gateway/` | Gateway binary composition | Links selected first-party compute drivers into the backend-agnostic server registry |
| `crates/openshell-sdk/` | Shared client SDK | Async Rust gateway client (gRPC transport, TLS, OIDC refresh, edge tunnel); consumed by CLI, TUI, and `@openshell/sdk` |
| `crates/openshell-providers/` | Provider management | Credential provider backends |
| `crates/openshell-spiffe/` | SPIFFE identity types | Dependency-light SPIFFE ID mapping, claim parsing, and the sandbox identity provider interface |
| `crates/openshell-spire/` | SPIRE adapter | Gateway-owned SPIFFE Broker API client that issues and verifies stable sandbox JWT-SVIDs |
| `crates/openshell-tui/` | Terminal UI | Ratatui-based dashboard for monitoring |
| `crates/openshell-driver-kubernetes-secrets/` | Kubernetes Secrets credential driver | In-process `CredentialDriver` backend for OpenShell-managed K8s Secret storage |
| `crates/openshell-driver-vault/` | Vault credential driver | In-process `CredentialDriver` backend for Vault-compatible KV storage |
Expand Down
114 changes: 93 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions crates/openshell-cli/tests/ensure_providers_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ impl TestOpenShell {

#[tonic::async_trait]
impl OpenShell for TestOpenShell {
async fn get_sandbox_provider_access_token(
&self,
_request: tonic::Request<openshell_core::proto::GetSandboxProviderAccessTokenRequest>,
) -> Result<Response<openshell_core::proto::GetSandboxProviderAccessTokenResponse>, Status>
{
Err(Status::unimplemented("not used by this test server"))
}

async fn peer_notify_config_update(
&self,
_request: tonic::Request<openshell_core::proto::PeerNotifyConfigUpdateRequest>,
Expand Down
Loading
Loading