HashiCorp Vault Enterprise
Kreya supports referencing secrets from HashiCorp Vault, one of the most popular secret management solutions. This section explains how to configure HashiCorp Vault in Kreya and reference secrets in your operations.
Prerequisites
Before you can use HashiCorp Vault with Kreya, make sure you have:
- A running HashiCorp Vault instance (local or remote)
- An appropriate secret engine mounted (e.g. a Key/Value store)
- Vault credentials with read access to the secrets you want to reference
Vault configuration
To configure HashiCorp Vault in Kreya:
- Open Project → Vaults & Secrets in the menu
- Click on the icon and enter a name for your vault
- Select HashiCorp Vault as vault type
- Enter the required connection details:
| Setting | Description |
|---|---|
| Vault URL | The URL of your HashiCorp Vault instance (e.g., https://vault.example.com:8200) |
| Authentication method | Token, JWT, or OIDC (browser login). |
| Token | The Vault token used for token authentication. |
| Authentication mount | The JWT/OIDC auth mount, without the auth/ prefix. Defaults to jwt or oidc. |
| Role | Optional Vault role. Leave empty to use the mount's default role. |
| JWT | A signed JWT to exchange for a Vault token. Supports templates. |
| Callback URL | OIDC callback URL. See the defaults for each browser below. |
| Namespace | Optional vault namespace. |
| Secrets engine type | The type of your secrets engine. Currently Key/Value v1 and v2 are supported. |
| Secret engine | The path/name of the secret engine |
For example:
Once you have configured your vault, hit the 'Test connection' button to see if everything works.
OIDC authentication
Select OIDC (browser login) and configure the authentication mount and optional role.
Vault must already be configured with your identity provider; no identity-provider client secret is needed in Kreya.
Allow the exact callback URL in both the Vault role and the identity provider.
Kreya supports the authorization-code flow with query parameters.
The built-in browser intercepts the callback before navigation, so the callback URL can use any HTTP(S) host
and does not require a listening server. Its default is https://callback.kreya.app.
With Use native browser enabled, Kreya listens at http://localhost:<port> (port 8250 by default).
Only the port is editable, and it must be available. If you change the callback URL or port, update both allowlists.
When you test the authenticated connection, discover secrets, or read a secret, Kreya asks for confirmation before opening your browser if login is needed. Kreya keeps issued Vault tokens in memory, renews renewable tokens when needed, and signs in again after expiry. Sessions are separate for each project, vault, and environment. Clear HashiCorp Vault sessions under Purge caches in the application settings, or restart Kreya, to sign in again. Use token or JWT authentication for unattended CLI runs.
Successful authentication does not necessarily grant permission to list Vault's secret engines. In that case, the connection test shows a permission warning; reading a secret still works if the token has access to it.
JWT authentication
Select JWT and provide a signed JWT accepted by the configured Vault role.
For example, {{ auth.configs.my_auth.value }} uses an existing Kreya authentication configuration,
or {{ env.vault_jwt }} reads a JWT from your environment data. The JWT's issuer, audience, and claims
must match the role's requirements. Kreya exchanges it for a Vault token before reading secrets.
The authentication configuration supplying this JWT must not depend on secrets from the same vault.
Secrets configuration
To use secrets in Kreya, you need to define each one in the Secrets tab.
| Column | Description |
|---|---|
| Name | A name of your choosing for the secret. This name will be used when referencing the secret inside Kreya. |
| Path | The path to your secret inside HashiCorp Vault. May be nested, e.g. path/to/my/secret. |
| Key | HashiCorp secrets are key/value objects. Define the key of your secret. |
| Value | This allows you to preview the value of the secret and check if everything worked correctly. |
For example:
Kreya supports HashiCorp KV version 1 and version 2 secrets engines. Enable Automatically discover secrets to recursively map every key below the configured mount. Discovered names are normalized for use in Kreya: path services/api with key token becomes services_api_token. Use the generated name shown in the secrets table in templates and scripts.
Referencing secrets
See Referencing secrets for how to use configured secrets in templates and scripts.