Vault Secret Rotation - Akira
Frequency
- API tokens: every 6 months or on suspected compromise.
- Database passwords: every 12 months.
- SignalWire PAT: every 12 months.
- Telegram bot token: every 12 months or on suspected compromise.
- Sentry DSN: rotate only when project or organization policy requires it.
Canonical files
- Vault:
infra/group_vars/all/vault.yml. - Manifest:
infra/group_vars/all/_secrets_manifest.yml. - Helper runbook: secret-rotation.md.
General rolling procedure
Use this pattern for secrets consumed by live services.
- Generate the new secret.
- Add it to vault with a
_newsuffix, for examplevault_nats_password_new. - Update affected services so both old and new values are accepted.
- Cycle services one by one.
- Verify all services use the new secret.
- Remove the old secret from vault and rename
_newto the canonical name. - Update
_secrets_manifest.ymlwith the rotation date. - Update
CHANGELOG.md.
Avoid rotating secrets during an active deploy unless the deploy is the mitigation for a security incident.
Check current secret age
./scripts/check_secrets_age.sh
python3 scripts/check_secrets_age.py
Edit vault
ansible-vault edit infra/group_vars/all/vault.yml \
--vault-password-file ~/.akira-vault-pass.txt
Specific secrets
vault_signalwire_token
-
Create a new Personal Access Token in the SignalWire dashboard.
-
Add
vault_signalwire_token_newto the vault. -
Re-run signaling deploy for FreeSWITCH.
ansible-playbook -i infra/inventory/staging.yml \infra/playbooks/deploy_signaling.yml \--vault-password-file ~/.akira-vault-pass.txt \--tags freeswitch -
Verify FreeSWITCH package and repository auth still work.
-
Revoke the old token in SignalWire.
-
Rename the new vault key to
vault_signalwire_token.
vault_postgres_app_password
-
Generate a new random password with at least 24 characters.
-
Add
vault_postgres_app_password_newto vault. -
Create or alter the app role password during a maintenance window.
ALTER USER akira_app PASSWORD '<new-password>'; -
Re-deploy backend and workers.
-
Verify app, CDR worker, and reports can connect.
-
Remove the old value from vault after all old connections are drained.
vault_nats_password
-
Generate a new password.
-
Add
vault_nats_password_newto vault. -
Update NATS config to accept old and new credentials during the rolling window.
-
Reload NATS.
docker exec nats nats-server -sl -
Re-deploy all clients: CDR worker, Kamailio CDR bridge, backend, and tools.
-
Verify stream and consumer health.
nats stream info AKIRA_CDRnats consumer info AKIRA_CDR cdr_worker -
Remove the old credential.
Telegram bot token
- Create the replacement token through BotFather.
- Add
vault_telegram_bot_token_newto vault. - Deploy the notification owner service.
- Send a test alert to the ops channel.
- Revoke the old token.
Sentry DSN
Sentry DSNs are project-specific identifiers, not passwords. Rotate only when the Sentry project changes or when organization policy requires a new DSN.
Post-rotation smoke test
ansible-playbook -i infra/inventory/staging.yml \
infra/playbooks/smoketest.yml \
--vault-password-file ~/.akira-vault-pass.txt
Completion checklist
- New secret verified in service.
- Old secret revoked or removed.
- Manifest
last_rotationupdated. -
CHANGELOG.mdupdated. - Relevant service owner notified.