2.4 KiB
2.4 KiB
Secret Rotation Checklist (Production)
Target: my.votcloud.com
Host: 102.69.243.167
Scope
Rotate the following regularly (monthly/quarterly or after any incident):
JWT_SECRETJWT_REFRESH_SECRETPOSTGRES_PASSWORDADMIN_PASSWORD
Recommended:
BACKUP_ENCRYPTION_KEY(with controlled key migration plan)- Proxmox API token secret
- Payment/webhook secrets
Enterprise hardening:
- Keep one grace window for webhook secret rotation (
*_previous) to avoid dropped payment events during provider cutover. - Validate new Proxmox token directly against
/api2/json/versionbefore applying it in panel settings.
Runbook (Safe Order)
- Create timestamped app/env/db backup.
- Rotate env secrets in
.env.production. - Apply DB password rotation (
ALTER USER ... WITH PASSWORD ...). - Restart app stack with new env.
- Re-seed admin (
npm run prisma:seed) to sync rotated admin password. - Revoke all active sessions (
AuthSession) to invalidate old sessions. - Verify:
GET /api/health- Admin login
- Core pages (
/rbac,/profile,/system,/audit-logs)
- Save secure summary with new admin credentials under
/root/.
Automation Script
Use:
sudo bash /opt/proxpanel/infra/deploy/rotate-production-secrets.sh
Script guarantees:
- Backup directory created in
/opt/proxpanel-backups/<timestamp>-secret-rotation/ - DB pre-rotation dump created
- Post-rotation health + login verified
- Summary written to
/root/proxpanel-secret-rotation-<timestamp>.txt
For integration secrets (Proxmox + payment/webhook + alerting endpoints), use:
sudo bash /opt/proxpanel/infra/deploy/rotate-integration-secrets.sh \
--proxmox-token-secret 'new_token_secret' \
--paystack-secret 'new_paystack_secret' \
--flutterwave-webhook-hash 'new_hash'
After external provider cutover is confirmed, clear grace secrets:
sudo bash /opt/proxpanel/infra/deploy/rotate-integration-secrets.sh \
--finalize-payment-webhook-grace
Rollback Plan
If post-rotation checks fail:
- Restore
.env.productionfrom backup. - Restore previous app files if needed.
- Restore DB dump if schema/state corruption occurred.
- Recreate containers:
docker compose --env-file .env.production -f infra/deploy/docker-compose.production.yml up -d --build
Audit Trail
Store:
- Rotation timestamp
- Operator identity
- Backup directory used
- Health verification evidence
- Any rollback events