Pre-Deployment Checklist
1
Change All Secrets
Replace every default password and secret in
.env:2
Configure HTTPS
Never run production without TLS encryption. Use a reverse proxy with SSL certificates.
3
Enable Firewall
Restrict network access to only required ports.
4
Set Up Backups
Implement automated database backups with off-site storage.
5
Configure SMTP
Set up transactional email for password resets and notifications.
Secrets Management
Critical Secrets
These must be changed before production:POSTGRES_PASSWORD
POSTGRES_PASSWORD
Risk: Root database accessGenerate:Requirements:
- Minimum 32 characters
- Mix of letters, numbers, special characters
- Unique per installation
- Store in password manager
JWT_SECRET
JWT_SECRET
Risk: Token forgery, authentication bypassGenerate:Requirements:
- Minimum 32 characters (64+ recommended)
- Keep absolutely secret
- Never expose in client code
- Rotating requires regenerating all JWT keys
DASHBOARD_PASSWORD
DASHBOARD_PASSWORD
Risk: Administrative access to StudioGenerate:Requirements:
- Strong password (20+ characters)
- Enable 2FA if available
- Rotate quarterly
SERVICE_ROLE_KEY
SERVICE_ROLE_KEY
Risk: Bypasses Row Level SecurityGenerate: Use JWT generator with your
JWT_SECRETRequirements:- Only use server-side
- Never expose in frontend code
- Never commit to repositories
- Rotate if compromised
Secret Rotation
Regularly rotate sensitive credentials:Network Security
Firewall Configuration
Allow only necessary ports:Reverse Proxy with HTTPS
Use nginx or Caddy as a TLS termination proxy:- nginx
- Caddy
- Traefik
/etc/nginx/sites-available/supabase
SSL Certificates
Use Let’s Encrypt for free SSL certificates:Database Security
Row Level Security (RLS)
Always enable RLS on user-facing tables:Postgres Security
Connection Security
postgresql.conf
pg_hba.conf
Authentication Security
Password Policies
Enforce strong passwords in GoTrue:.env
Rate Limiting
Protect against brute force attacks:volumes/api/kong.yml
Multi-Factor Authentication
Enable MFA for administrative accounts:.env
OAuth Security
Secure OAuth configurations:Storage Security
Bucket Policies
Restrict file access with policies:File Upload Restrictions
.env
Monitoring & Auditing
Audit Logging
Track security events:Failed Login Monitoring
Incident Response
Security Breach Procedure
1
Contain the Breach
- Immediately rotate all secrets
- Block compromised IP addresses
- Revoke compromised API keys
- Disable affected user accounts
2
Assess Impact
- Review audit logs
- Identify affected data
- Check for data exfiltration
- Document timeline
3
Remediate
- Apply security patches
- Fix vulnerabilities
- Restore from clean backup if needed
- Update security policies
4
Notify Stakeholders
- Alert affected users
- Report to authorities if required
- Update security documentation
Emergency Access Revocation
Security Checklist
Before going to production:- All default passwords changed
- Strong, unique secrets generated
- HTTPS enabled with valid SSL certificate
- Firewall configured
- Database backups automated
- RLS enabled on all user tables
- SMTP configured for email
- OAuth providers verified
- File upload restrictions set
- Rate limiting configured
- Monitoring and alerts set up
- Audit logging enabled
- Incident response plan documented
- Regular security updates scheduled
Next Steps
Updates
Keep your stack secure with regular updates
Backups
Implement backup and recovery
Monitoring
Set up security monitoring
Compliance
Meet regulatory requirements
