Key and secret rotation
Every credential in ZERG has an owner, a storage location, a rotation procedure, and a verification step. Rotate one class at a time and verify readiness after each.
Inventory
| Secret | Used by | Storage | Rotation impact |
|---|---|---|---|
| ZMQ CURVE server key | Sol ROUTER/PUB | <data_dir>/curve_server.cert (auto-generated) | All workers must trust the new key; coordinate a fleet window |
| Worker enrollment keys | Sol ↔ Luna READY | zmq_enrollment_keys / wild provisioning | Per-worker; rotate one worker at a time |
| Fleet secret (legacy) | Sol ↔ Luna | SOL_ZMQ_WORKER_SECRET | Only valid while zmq_fleet_legacy_compat is open; do not use for new fleets |
| Mango bridge HMAC | Mango → Sol events | MANGO_BRIDGE_HMAC_SECRET on both sides | Restart the bridge; replay window rejects stale frames |
| Mango audit chain key | Mango audit rows | MANGO_AUDIT_CHAIN_SECRET (+ prior keys) | Keep prior keys for verification across the boundary |
| Sol audit HMAC | Sol audit JSONL | audit_hmac_secret | Keep the old key available to verify historical logs |
| Provider keys | Sol provider pool | Env (api_key_env) or encrypted pool (provider_keys.bin) | Add new key, drain old key, then remove |
| TLS certificates | OpenResty / Mango edge | wild-managed | Reload the proxy; verify with openssl s_client |
| Minisign release key | Release artifacts | wild /fun/secrets/minisign + ci/minisign-pub-fingerprint | Release-act change: update pin, status, expiry together |
Procedure (generic)
- Stage the new secret without removing the old one.
- Restart or reload the consumer and confirm it is using the new value (log line or metric).
- Verify the dependent path end-to-end (worker READY, event delivered, login succeeds, artifact verifies).
- Remove the old secret after the verification window.
- Record the change in the audit log and the release notes.
Specific notes
CURVE: a worker that cannot verify the server key fails closed. Never disable CURVE to “fix” a rotation; fix trust.
Enrollment keys: a key bound to a worker_id cannot register as another worker. Revoke first, then re-provision.
Audit chains: verification accepts prior keys by epoch; a missing prior key produces a typed verdict, not a false pass.
Provider pool: the pool file is part of the data-dir backup scope. A corrupt store fails open loudly — treat it as an incident.
Minisign: rotation is a reviewed release commit; a lapsed expiry fails the release lane.
Verification checklist
[ ] zerg doctor is green.
[ ] zerg zmq-workers shows the expected fleet.
[ ] A task completes end-to-end.
[ ] /ready passes.
[ ] Audit verification passes (/api/v1/audit/verify for Sol; Audit.verify_integrity for Mango).
[ ] The old secret is removed from the host and the backup scope is updated.