Secrets in Vault: env: and vault: references wherever a secret file is named, and the store's own secrets sealed under a master key — Vault transit or a local key

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 23:21:44 +02:00
1 parent bce54f0941
commit 35657c1417
20 files changed
+837 -14

No files matched your search

+37
View File
@@ -1394,6 +1394,43 @@ and point it at `https://<gateway>/scim/v2` with that token as the bearer.
join and leave them. Membership in a group is removed when someone leaves
it.
## Secrets in Vault
Every setting that names a file holding a secret — the store's `@address`,
`api_key_file`, `auth.oidc.client_secret_file`, `auth.scim.token_file`, a
webhook's `secret_file` — also takes `env:VARIABLE` or a field of a secret in
HashiCorp Vault or OpenBao:
```yaml
auth:
store: "@vault:secret/llmgw/store#dsn"
secrets:
vault:
addr: https://vault.internal:8200
ca_file: /etc/llmgw/vault-ca.pem
role_id_file: /etc/llmgw/secrets/vault-role-id # AppRole; or token_file,
secret_id_file: /etc/llmgw/secrets/vault-secret-id # or VAULT_TOKEN
master_key: vault-transit:llmgw
```
These are read when the gateway starts (an external model's key, each time
the catalog changes): a secret rotated in Vault is taken up at the next
restart.
**The store's own secrets** — what every engine's key is derived from — are
kept in the store, and so in its backups. `secrets.master_key` seals them:
- `vault-transit:KEY` seals with Vault's transit engine. The key never leaves
Vault, so neither the store nor any backup of it opens without Vault.
- Anything else is a reference to 32 random bytes (`openssl rand -hex 32`),
used here: better than nothing, but a key in `/etc/llmgw` is in every backup
beside what it seals. Keep it in Vault or the environment.
Values kept plain from before are sealed the first time they are read after
the key is set. The key cannot be changed once set without losing them: a new
one cannot open what the old one sealed (the engines are then restarted with
new keys: `llmgw ctl restart --all`).
## The firewall
`server init`, `node add`, `server add` and `mirror init` each keep that