Repository navigation
feat(providers): support Vault-compatible JWT login - #6003
rafamolina1 wants to merge 1 commit into
Conversation
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>
|
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. |
|
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. |
Yes, that is indeed my concern.
Yes.
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). |
|
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? |
Summary
Add
vault_jwt_loginprovider 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
auth.client_tokenandauth.lease_durationthrough the existing bounded, verified HTTP transport. Support the configured additional CA bundle for this protocol.UnsupportedSupervisor, and reject unknown protocols explicitly.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
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