| title | Security Best Practices |
|---|---|
| description | Comprehensive security guidelines for ObjectStack Protocol implementations |
Comprehensive security guidelines for ObjectStack Protocol implementations
const authConfig = {
providers: [
{
type: 'email_password',
passwordPolicy: {
minLength: 12,
requireUppercase: true,
requireNumbers: true,
requireSpecialChars: true,
},
},
],
twoFactor: {
enabled: true,
required: true,
},
};- Use short session lifetimes (1-24 hours)
- Set secure cookie flags (httpOnly, secure, sameSite)
- Invalidate sessions on password change
- Implement least privilege principle
- Use role-based access control
- Apply field-level security
- Encrypt sensitive fields at rest
- Use HTTPS/TLS for all traffic
- Implement proper key management
- Mask sensitive data in logs
- Sanitize error messages
- Redact PII in responses
- Limit API requests per user
- Block brute force attacks
- Implement exponential backoff
- Validate all inputs with Zod schemas
- Use parameterized queries
- Prevent SQL/NoSQL injection
- Configure CORS properly
- Enable CSRF protection
- Validate origin headers
- Store secrets in environment variables
- Never commit secrets to git
- Rotate secrets regularly
- Use secret management services
- Log security events
- Track data access
- Monitor authentication attempts
- GDPR data export/erasure
- HIPAA encryption requirements
- SOC2 audit trails
- [ ] HTTPS enforced
- [ ] MFA enabled
- [ ] Rate limiting configured
- [ ] Input validation on all endpoints
- [ ] Secrets in environment variables
- [ ] Audit logging enabled
- [ ] Regular security updates
For detailed information, see AUTHENTICATION_STANDARD.md
Last Updated: 2026-01-22