Skip to Content
LYNKORIADocs

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 high passes; 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.yaml allowBuilds was 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=true only behind the ingress named by CLIENT_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_ORIGIN and WEBHOOK_ALLOWED_ORIGINS list exact HTTPS origins only.
  • manual Secrets are App Platform encrypted values; nothing secret is in the rendered spec, Git, images or logs. SERVICE_KEY_PEPPER and WEBHOOK_SECRET_MASTER differ.
  • 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 with scanStatus: 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-src names 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.mjs passes 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.

On this page