Vaults and secrets Enterprise
With the Vault feature, you can reference secrets stored in external vault providers directly inside Kreya. This lets you keep sensitive values like API keys, passwords, and tokens in a dedicated secret manager while using them seamlessly in your operations, authentication configurations, and environments.
How it works
Vaults work by referencing secrets rather than storing them inside in Kreya. When you reference a secret from a vault:
- Kreya connects to the vault provider
- The secret value is fetched on demand when needed
- The value is used in the operation, authentication, environment, ...
Since secrets are referenced dynamically, changing a value in your vault is immediately reflected in Kreya. There is no need to manually update them in Kreya.
Automatically discover secrets
Vault providers that support discovery show an Automatically discover secrets checkbox. When enabled, Kreya maps every secret exposed by the configured provider and makes the secrets table read-only. Disable the option to maintain the mappings manually.
Automatic mapping is limited to 100 secrets. If your vault contains more than 100 secrets, disable Automatically discover secrets and map the required secrets manually.
Referencing secrets
Templating
Once a vault is configured, you can reference secrets using the following templating syntax:
{{ secrets.vault_name.secret_name }}
Where:
vault_nameis the name you gave the vaultsecret_nameis the name you gave your secret
Scripting
Use kreya.secrets.get in operation scripts and standalone Kreya scripts to retrieve a secret:
const apiKey = await kreya.secrets.get('My vault', 'API key');
Pass the exact, case-sensitive vault and secret names configured in Kreya, including any spaces or punctuation. The vault configuration for the active environment is used, falling back to the configuration for all environments. The call throws if the vault or secret is missing, or if the vault provider cannot retrieve the value.
See the Kreya base script API reference for more details.
Supported vault providers
| Provider | Documentation |
|---|---|
| HashiCorp Vault | Learn how to connect to HashiCorp Vault and reference secrets |
| Azure Key Vault | Connect Azure Key Vault and reference current or versioned secrets |
| .NET user secrets | Reference local .NET development secrets |
Is your favorite vault provider missing? Write us at [email protected]!
Security considerations
- Vault secrets are fetched at runtime.
- Most vault providers require authentication which needs to be configured. Where possible, use credentials that only have read access to the required secrets.
- For team collaboration, ensure that vault access credentials are managed securely and are available only to team members who need them. Do not store credentials to access your secret provider in Kreya project files.