1.7 KiB
1.7 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
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
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