Security Checklist
Mandatory
Section titled “Mandatory”-
BETTER_AUTH_SECRETis at least 32 random characters -
ADMIN_TOKENis at least 16 random characters - HTTPS is enforced for all public endpoints
-
SAAS_TRUSTED_ORIGINSlists only known SaaS frontend domains - Admin API is not exposed to the public internet (firewall or VPN)
Token Security
Section titled “Token Security”- Each SaaS backend verifies the JWT
audclaim against its own audience - SaaS backends fetch JWKS on startup and cache it (keys rotate infrequently)
- RS256 is used (not HS256), preventing key material exposure
- Token expiry is set per application via auth policy (default: 7 days)
OAuth Security
Section titled “OAuth Security”- PKCE is enforced for native/public clients
- Confidential clients require client_secret for token exchange
- Authorization codes are single-use and short-lived
- Redirect URIs are validated against registered whitelist
Webhook Security
Section titled “Webhook Security”- Inbound webhook signatures are verified (LS HMAC, Apple JWS)
- Outbound webhooks are signed with per-application secrets
- Webhook processing is idempotent (event IDs are deduplicated)
Data Protection
Section titled “Data Protection”- Passwords are hashed with bcrypt (handled by Better Auth)
- Client secrets are hashed with SHA-256 before storage
- API keys are hashed with SHA-256 before storage
- Database backups are encrypted at rest
Rate Limiting (Phase 3)
Section titled “Rate Limiting (Phase 3)”- Rate limiting is configured on login endpoints to prevent brute force
- API key usage is rate-limited per application
Monitoring
Section titled “Monitoring”- Structured logging is enabled (Pino)
- Failed login attempts are logged
- Webhook processing failures are logged and retried