Pre-deploy security checklist
Run before every production deployment; record the answers in the release ticket.
Each item is either verified by CI (auto) or must be checked by a person (manual). Do not deploy with an unchecked manual item unless the release ticket records who accepted the risk.
Code and dependencies
- auto CI is green for the exact commit: format, lint, typecheck, tests (including Valkey), build, OpenAPI drift, bundle secret check.
- auto
pnpm audit --prod --audit-level highpasses; gitleaks reports no leaks; Trivy finds no fixable high/critical issues in the API and scanner images. - manual New dependencies were reviewed (maintainer, install scripts, licence);
pnpm-workspace.yamlallowBuildswas not widened without review. - manual Changes to auth, tokens, sockets, attachments, webhooks or the console had a second reviewer.
Configuration
- manual
NODE_ENV=production; the API started (configuration validation enforces TLS URLs, database CA, scanner and no dev overrides). - manual
TRUST_PROXY=trueonly behind the ingress named byCLIENT_IP_HEADER, and a client-supplied value for that header is overwritten (curl with a fake header; check the audit IP). - manual
ALLOWED_ORIGINS,CONSOLE_ORIGINandWEBHOOK_ALLOWED_ORIGINSlist exact HTTPS origins only. - manual Secrets are App Platform encrypted values; nothing secret is in the rendered spec, Git, images or logs.
SERVICE_KEY_PEPPERandWEBHOOK_SECRET_MASTERdiffer. - manual The migration job alone has
MIGRATION_DATABASE_URL_DIRECT; the runtime role cannot run DDL and has the 30 s statement timeout.
Infrastructure
- manual Firewalls: media Droplet exposes only 80/443 TCP, 7881 TCP, 3478 UDP and 50000-60000 UDP; SSH only from operator IPs; PostgreSQL/Valkey trust only the App (temporary operator rules removed); the scanner listens on the private interface only.
- manual The Spaces bucket is private, CORS lists product origins only, and the lifecycle rules (incomplete uploads,
quarantine/) are applied. - manual ClamAV signatures are fresh (the scanner's own
/health/ready), and an upload through the API completes withscanStatus: clean(the API's readiness checks only PostgreSQL and Redis, so it stays ready when the scanner is down and attachments fail closed). - manual Console: password accounts exist only for current staff; Cloudflare Access (if used) requires MFA; the console CSP
connect-srcnames the API origin.
Access and keys
- manual Service keys are scoped to the minimum scopes and one environment; unused keys are revoked.
- manual Console roles were reviewed: no stale owners or admins; departed users are disabled (
pnpm admin:user disable). - manual Key rotation dates for messaging JWT, LiveKit keys, webhook master and pepper are within policy (operations).
After deploy
- manual
scripts/verify-production.mjspasses against the deployed API. - manual Anonymous requests are denied; a
lynk_test_key is rejected in production; cross-project access returns 404. - manual Alerts fire to a real receiver (send a test alert).
See also the production checklist for functional verification.