Coderaft Vault
A single dedicated container that owns every secret used by the Coderaft platform. Replaces 8 scattered secret stores and provides a consistent, mTLS-only API with per-product ACL enforcement.
Mandatory component. Every Coderaft install includes the Vault. It is not optional. Phase 0 (shipped 2026-05-07) delivers the container and API. Phases 1–5 migrate each legacy store into it.
Architecture
coderaft-vault (Go HTTP + mTLS)
───────────────────────────────
/data/vault.db (SQLite, AES-256-GCM)
/keys/master.key (age, root-owned, 0400)
───────────────────────────────
mTLS ↕ internal Docker network only
───────────────────────────────
dashboard-apiwolfguardravenscanredfox
- Port 8200 — bound to internal Docker network only, never exposed to the internet
- Each product has a unique client certificate signed by the Vault CA
- Vault validates client cert SAN against an ACL and returns only the secrets the client is authorised for
Encryption model
- DEK (Data Encryption Key) — AES-256-GCM random 32-byte key, generated once at first start
- DEK wrapping — age-encrypted using the master key file (
/keys/master.key). The Vault is "sealed" at rest — products that boot while the Vault is sealed fall back to DB config or SetupMode - Secrets — each value is AES-256-GCM encrypted with the DEK before writing to SQLite
Recovery phrase warning: The vault generates a 24-word BIP39 recovery phrase on first start. Store it on an encrypted USB drive and in a password manager. Losing both
/keys/master.key and the recovery phrase means all encrypted data is irrecoverable.
API reference
| Method | Path | Description |
|---|---|---|
| GET | /v1/health | Returns {"sealed": bool, "version": "..."} |
| POST | /v1/unseal | Unseal with recovery phrase shares |
| POST | /v1/seal | Emergency seal — wipes in-memory DEK (admin only) |
| POST | /v1/secret/get | {"name": "license_key"} → {"value": "..."} (mTLS + ACL) |
| POST | /v1/secret/set | Write a secret (mTLS + ACL) |
| POST | /v1/secret/delete | Delete a secret (mTLS + ACL) |
| GET | /v1/secret/list | Returns all secret names (admin only) |
API examples # Health check
curl https://coderaft-vault:8200/v1/health
# Read a secret (mTLS — client cert required)
curl --cert /etc/wolfguard/vault-client.pem \
--key /etc/wolfguard/vault-client.key \
-X POST https://coderaft-vault:8200/v1/secret/get \
-d '{"name":"platform/identity/oidc"}'
Extension interfaces (§3.bis contract)
All core code calls interfaces only. Upgrading from v1 (file-based) to v2 (HSM / Shamir) requires zero data migration — only the wrapped DEK is re-wrapped once.
Interface v1 (shipped) v2 (roadmap) MasterKeyProviderage file (/keys/master.key) PKCS#11 (HSM / YubiHSM) SealerPassphrase (1-of-1) Shamir (3-of-5 operator shares) AuditorHMAC-chained file log WORM auditor (S3 Object Lock) AuthVerifiermTLS cert + ACL + MFA verifier, Step-up verifier Crypto stdlib AES-GCM + GOFIPS=1 build flag
Migration phases
Phase Scope 0 ✓ Vault container, API, tests, cosign (shipped 2026-05-07) 1 dashboard-api: Azure tenant/client/secret → Vault 2 dashboard-api: LICENSE_KEY lifecycle → Vault 3 WolfGuard, Ravenscan, RedFox: per-product secret stores → Vault 4 dashboard-api: JWT signing key → Vault JWT issuer 5 Cleanup: remove SOPS, .env.enc, per-product secret envs
Next steps
- → Identity Architecture — OIDC global config via Vault
- → Security Architecture — full platform security controls
- → WolfGuard Remediation — credential references via Vault