${VAR} and are expanded before parsing. Defaults and validation run after parsing.
Configuration model
The config schema maps tosvc/vault/config.go.
Vault loads configuration via config.Load, which expands ${VAR} environment variables before parsing.
Minimal config example:
Used for tracing attributes. Set to pod name in Kubernetes. Example:
vault-7d9b8c4f5d-2kq7m.Port for HTTP and RPC traffic. Example:
8060.Included in logs and traces. Example:
us-east-1.Used for RPC auth. Must be non-empty. Example:
"s3cr3t-token".Encryption
Encryption key configuration.
master_key values to be a base64 encoding of the serialized KeyEncryptionKey protobuf. This format is produced by the vault key generation code.
Example:
S3 storage
S3-compatible storage configuration.
Observability
Tracing and logging configuration. Each nested section is optional.
observability.metrics in the config file, but the vault runtime does not start a Prometheus endpoint.
Example:
Environment variables
The Helm chart provides these variables for the default config template:Bearer token for vault RPC auth. Example:
"s3cr3t-token".Base64-encoded master key. Example:
"CiV2YXVsdC1rZXktMSIsIk9TQjRvYjBqWnU9".Optional previous master key for rotation. Example:
"CiV2YXVsdC1rZXktMCIsIk9TQjRvYjBqWnU9".S3-compatible endpoint URL. Example:
"https://s3.us-east-1.amazonaws.com".Bucket name for encrypted objects. Example:
"unkey-vault".S3 access key ID. Example:
"AKIA...".S3 access key secret. Example:
"wJalrXUtnFEMI/K7MDENG/bPxRfiCY".Region label for observability. Example:
"us-east-1".OTEL exporter endpoint. Example:
"http://otel-collector.monitoring.svc.cluster.local:4318".OTEL exporter protocol. Example:
"http/protobuf".Authentication
Vault requires callers to pass anAuthorization: Bearer <token> header. The token must match bearer_token from the config.
Key management and rotation
Master keys and bearer tokens are managed manually. When you rotate keys, generate a new master key and update AWS Secrets Manager. Keep the previous master key inUNKEY_ENCRYPTION_PREVIOUS_MASTER_KEY until all data is re-encrypted.
Generate a master key
From the repo root, use the Unkey CLI to generate a base64-encoded master key:UNKEY_ENCRYPTION_MASTER_KEY.
Generate a bearer token
Vault accepts any non-empty bearer token. Use a strong random value and store it asUNKEY_VAULT_TOKEN:
- Generate a new master key and set it as
UNKEY_ENCRYPTION_MASTER_KEY. - Move the prior master key to
UNKEY_ENCRYPTION_PREVIOUS_MASTER_KEY. - Update AWS Secrets Manager for
unkey/vault. - Re-sync the Helm release to roll the vault pods.
- Remove
UNKEY_ENCRYPTION_PREVIOUS_MASTER_KEYafter re-encryption is complete.
RollDeks flow, which walks stored DEKs and rewrites them with the current master key.
Secret sources
The default Helm chart uses External Secrets to source the vault secrets fromunkey/vault in AWS Secrets Manager:
Used for RPC authentication. Example:
"s3cr3t-token".Base64-encoded master key. Example:
"CiV2YXVsdC1rZXktMSIsIk9TQjRvYjBqWnU9".Optional key for rotation. Example:
"CiV2YXVsdC1rZXktMCIsIk9TQjRvYjBqWnU9".S3 endpoint. Example:
"https://s3.us-east-1.amazonaws.com".Bucket name. Example:
"unkey-vault".Access key ID. Example:
"AKIA...".Access key secret. Example:
"wJalrXUtnFEMI/K7MDENG/bPxRfiCY".
