Skip to content

feat(providers): support Vault-compatible JWT login - #6003

Open
rafamolina1 wants to merge 1 commit into
ai-openshell:mainfrom
rafamolina1:feat/5999-vault-jwt-login/rafamolina1
Open

rafamolina1 wants to merge 1 commit into
ai-openshell:mainfrom
rafamolina1:feat/5999-vault-jwt-login/rafamolina1

Conversation

@rafamolina1

Copy link
Copy Markdown

Summary

Add vault_jwt_login provider grants so a sandbox can authenticate with its SPIFFE JWT-SVID and inject a short-lived Vault/OpenBao client token into an admitted request. Keep the assertion and issued token in the supervisor and cap caching by the issuer lease.

Related Issue

Closes #5999

Changes

  • Add typed YAML/protobuf configuration for JWT login role and optional namespace, with strict HTTPS and protocol-specific validation.
  • Send JSON login requests and parse auth.client_token and auth.lease_duration through the existing bounded, verified HTTP transport. Support the configured additional CA bundle for this protocol.
  • Isolate cache entries by sandbox, credential/destination, protocol, audience, role, and namespace; use monotonic lease deadlines and preserve OAuth cache semantics.
  • Advertise supervisor support on push and polling paths, withhold incompatible grants with UnsupportedSupervisor, and reject unknown protocols explicitly.
  • Add unit and sandbox E2E coverage, review schema fingerprints, and update provider/configuration docs and the CLI skill.

Release Notes

Provider profiles can now exchange sandbox SPIFFE identities for Vault or OpenBao client tokens using grant_type: vault_jwt_login. Configure the issuer role to bind the approved SPIFFE subject and audience, and upgrade the gateway and supervisor before attaching the profile.

Testing

  • Unit tests added/updated: 145 provider tests, 17 OAuth/JWT HTTP tests, 15 core grant tests, and 104 supervisor-network grant/injection tests passed.
  • Affected Rust Clippy checks, Rust formatting, and shell syntax checks passed.
  • TypeScript protobuf generation, protobuf lint, Biome lint, type checking, 204 tests with coverage, and build passed using the constituent SDK CI commands; mise is unavailable locally.
  • Fern 5.112.0 check completed with zero errors and three warnings.
  • Gateway compatibility validation: one supervisor support test and 11 storage tests passed using an existing compiled test binary. The current public/durable inventory and frozen-storage tests passed in a small standalone harness using the repository test logic and current generated descriptors.
  • E2E coverage added and compile-checked with the Podman feature.
  • Run the Podman E2E lane in CI or a provisioned test environment; Podman is unavailable locally.

Rebuilding the complete gateway unit-test binary exceeded a 3 GiB memory ceiling, including a retry without debug symbols. All subsequent work kept one build job/test thread and the same memory limit. The lightweight schema harness does not replace a fresh full gateway test run in CI.

Checklist

  • Follows Conventional Commits.
  • Commit is signed off for DCO.
  • User-facing documentation and related skill updated.

Exchange sandbox SPIFFE JWT-SVIDs using Vault and OpenBao JSON login,
with explicit role, optional namespace, and issuer-bounded token caching.
Negotiate supervisor support and reject unsupported grant configuration
without falling back to OAuth. Add protocol, cache, compatibility, and
sandbox integration coverage with operator documentation.

Refs ai-openshell#5999

Signed-off-by: rafamolina1 <128931481+rafamolina1@users.noreply.github.com>
@grs

grs commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

My concern with this would that it would encourage the retrieval of secrets directly by the sandboxed processes, which goes against the goal of keeping secrets out of the sandbox.

Perhaps a better solution would be token retrieval option that would use the SPIFFE SVID for authentication (creating the intermediate login token if that is needed), retrieve a secret from a given path and insert that into an outgoing request? That way the secrets stay out of the sandbox, but are inserted dynamically from vault when needed.

@rafamolina1

Copy link
Copy Markdown
Author

Thanks for raising this. In the current implementation, the supervisor performs the JWT login and injects the returned client token into the approved outgoing request. Neither the JWT-SVID nor the client token is exposed to the sandboxed process. This follows #5999’s use case of an internal API that accepts Vault-issued tokens.

Your concern still applies if the approved destination is a Vault secret-read endpoint: its response could expose the secret to the workload.

The flow you suggest would keep the Vault client token as an intermediate credential, read a configured secret path inside the trusted runtime, and inject the selected secret into the final API request. That capability is not implemented in this PR. We should clarify whether it should replace or extend the token-grant use case before changing the implementation.

@grs

grs commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Your concern still applies if the approved destination is a Vault secret-read endpoint: its response could expose the secret to the workload.

Yes, that is indeed my concern.

The flow you suggest would keep the Vault client token as an intermediate credential, read a configured secret path inside the trusted runtime, and inject the selected secret into the final API request.

Yes.

That capability is not implemented in this PR. We should clarify whether it should replace or extend the token-grant use case before changing the implementation.

You could probably argue either way. My instinct would be to have a separate config element for this as an alternative to token_grant (e.g. token_retrieval).

@rafamolina1

Copy link
Copy Markdown
Author

A separate token_retrieval element makes sense: it distinguishes retrieving a credential from issuing a token.

For Vault, the trusted runtime would authenticate using the sandbox’s SPIFFE identity, keep the login token internal, read the configured secret path/field, and inject the retrieved value only into an admitted request to the configured destination. I’d make token_retrieval and token_grant mutually exclusive per credential.

I can implement that flow. Would you prefer me to update this PR, or implement it in a separate issue/PR while keeping #5999 scoped to token grants?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Vault-compatible JWT login in SPIFFE-backed provider grants

2 participants