SEQN Auth Monitoring and Non-Email Alerts

SEQN Auth should be monitored like a customer-facing SaaS control plane. Invitation email delivery and OTP email are handled through the hosted Croox service, but operational alerting should still use non-email channels such as Slack, Discord, ntfy, PagerDuty, Opsgenie, Uptime Kuma, Grafana Alertmanager, or a private webhook receiver.

Monitoring principles

  • Monitor from outside the VPS for public HTTPS, DNS, and Caddy coverage.
  • Monitor from inside the VPS for container, database, backup, and disk coverage.
  • Keep secret-bearing checks inside trusted runners only.
  • Alert on symptoms first, then use logs and admin audit events for root-cause analysis.
  • Prefer low-noise alerts with clear severity and runbook links.

Synthetic checks

CheckLocationCadenceExpected resultAlert when
Public healthExternal1 minuteGET https://auth.seqn.in/healthz returns 2002 consecutive failures
Public configExternal5 minutesGET /v1/config returns safe public JSON2 consecutive failures
SDK CORS preflightExternal5 minutesOPTIONS /v1/client/config allows x-seqn-publishable-keyHeader missing or non-204 response
Client configTrusted synthetic runner5 minutesGET /v1/client/config with a canary pk_live_ returns an active app2 consecutive failures
Backend key healthTrusted synthetic runner5 minutesGET /v1/backend/application with a canary sk_live_ returns ok: true2 consecutive failures
Authenticated smokeTrusted synthetic runnerAfter deploy and dailynpm run smoke:authenticated with a canary session exits 0Any failed session/org/console/boundary check
Hosted console boundaryExternal5 minutesAnonymous GET /auth/console redirects to loginResponse is 200 with console data or 5xx
Admin boundaryExternal5 minutesAnonymous GET /v1/audit-logs returns 401Response is 200 or 5xx
Croox email/OTP canaryTrusted synthetic runnerDailynpm run smoke:croox-email sends one direct email and one OTP email through comms.seqn.inCroox smoke is blocked or fails
Invite email canaryTrusted synthetic runnerDailyA canary invitation queues and sends through Croox when enabledDelivery remains pending/retrying or Croox is disabled unexpectedly
OIDC discoveryExternal5 minutesAuthentik issuer discovery returns 2002 consecutive failures
TLS certificateExternalDailyCert expires in more than 14 daysExpiry under 14 days
Docker healthVPS1 minuteAuthentik, Redis, Postgres, and Silver Auth containers are healthyAny core service unhealthy for 3 minutes
DatabaseVPS1 minutePostgres healthchecks pass and disk has free spaceHealthcheck failure or disk under 20 percent free
Ops readiness auditVPSHourly and after deploynpm run audit:ops exits 0 from /srv/silver-authAny FAIL line
BackupsVPSHourlyLatest local backup is younger than the schedule SLABackup age exceeds SLA
Restore drill proofVPSAfter each fresh backup and before launchLatest backup has fresh successful RESTORE_DRILL.jsonMissing, failed, or stale restore proof
Offsite backupsVPS or offsite monitorHourlyLatest encrypted offsite archive is younger than the schedule SLAOffsite age exceeds SLA

Example probes

Consolidated readiness report:

cd /srv/silver-auth
npm run readiness:public-mvp

Public unauthenticated checks:

npm --prefix services/silver-auth-api run smoke:public-mvp

Trusted runners with a canary app should add:

SEQN_AUTH_PUBLISHABLE_KEY=pk_live_...
SEQN_AUTH_SECRET_KEY=sk_live_...
npm --prefix services/silver-auth-api run smoke:public-mvp

VPS-local operations audit:

cd /srv/silver-auth
npm run audit:ops

Croox email/OTP smoke:

cd /srv/silver-auth
SEQN_AUTH_CROOX_CANARY_TO=ops@example.com npm run smoke:croox-email

Non-destructive restore drill:

cd /srv/silver-auth
npm run drill:restore

Individual probes:

curl -fsS https://auth.seqn.in/healthz
curl -fsS https://auth.seqn.in/v1/config
curl -i -X OPTIONS \
  -H "Origin: http://localhost:3000" \
  -H "Access-Control-Request-Method: GET" \
  -H "Access-Control-Request-Headers: x-seqn-publishable-key" \
  https://auth.seqn.in/v1/client/config
curl -fsSI https://auth.seqn.in/auth/console

Trusted key checks:

curl -fsS \
  -H "X-SEQN-Publishable-Key: $SEQN_AUTH_PUBLISHABLE_KEY" \
  "$SEQN_AUTH_BASE_URL/v1/client/config"

curl -fsS \
  -H "Authorization: Bearer $SEQN_AUTH_SECRET_KEY" \
  "$SEQN_AUTH_BASE_URL/v1/backend/application"

Authenticated canary session check:

cd /srv/silver-auth
SEQN_AUTH_SESSION_COOKIE='silver_session=...' npm run smoke:authenticated

Container checks:

cd /srv/silver-auth
docker compose -f deploy/vps-stack.compose.yml --env-file .env ps

Backup freshness check:

find /srv/silver-auth/backups -mindepth 1 -maxdepth 1 -type d -printf '%T@ %p\n' | sort -n | tail -1

Alert routing

SeverityExamplesTargetResponse target
P0Public health down, auth callback broken, DB unavailable, restore neededPagerDuty/Opsgenie/phone push plus Slack incident channel15 minutes
P1Backend key health fails, OIDC discovery down, offsite backup stale, sustained 5xxSlack incident channel plus on-call push1 hour
P2Single synthetic failure, high 429, webhook retry backlog, disk under 30 percentSlack ops channel or ntfyNext business day
P3Documentation drift, pricing-policy cleanup, non-urgent hardening taskProject trackerPlanned work

Non-email alert payload

Use a compact JSON payload for webhook-based alerting:

{
  "service": "seqn-auth",
  "severity": "P1",
  "check": "backend-key-health",
  "status": "firing",
  "summary": "Canary backend key health failed twice",
  "runbook": "docs/seqn-auth/support-admin-runbook.md",
  "startedAt": "2026-05-12T00:00:00Z"
}

Never include sk_live_, whsec_, OIDC client secrets, Authentik API tokens, database passwords, session cookies, or backup encryption keys in alert payloads.

Alert review cadence

  • Daily: check active alerts, recent 5xx, recent 429, and backup freshness.
  • Weekly: review noisy alerts and adjust thresholds.
  • Monthly: test one P1 alert route and one backup freshness alert.
  • Quarterly: run a tabletop restore and incident response drill.