Security Best Practices for Authoh
Security Best Practices for Authoh
Proper security configuration is essential for protecting your authentication infrastructure and user data. This guide covers recommended security practices for your Authoh implementation.
Account Security
Enable Multi-Factor Authentication (MFA)
Require MFA for all administrators and team members:
- Go to Dashboard > Organization > Security
- Enable Require MFA for all organization members
- Choose which MFA methods to allow:
- Authenticator apps (recommended)
- SMS verification
- Email codes
- WebAuthn/security keys (most secure)
Implement Strong Password Policies
Enforce strong passwords for your users:
- Navigate to Dashboard > Security > Password Policy
- Configure the following settings:
- Minimum password length: 12 characters (recommended)
- Require uppercase, lowercase, numbers, and special characters
- Enable dictionary-based weak password detection
- Set password expiration (if required by your security policy)
- Prevent password reuse
Manage API Keys Securely
Protect your API keys and secrets:
- Use separate API keys for different environments (development, staging, production)
- Rotate API keys regularly (at least every 90 days)
- Never commit API keys to source code repositories
- Use environment variables or secrets management solutions
- Enable key rotation notifications
Example secure API key storage:
// INCORRECT - Keys in source code
const authohClient = new AuthohClient({
clientId: 'abc123456789',
clientSecret: 'verysecretvalue'
});
// CORRECT - Keys in environment variables
const authohClient = new AuthohClient({
clientId: process.env.AUTHOH_CLIENT_ID,
clientSecret: process.env.AUTHOH_CLIENT_SECRET
});
Application Configuration
Enable CORS Protection
Properly configure CORS to prevent cross-site attacks:
- Go to Dashboard > Applications > Your App > Settings > CORS
- Add specific origins instead of using wildcards
- Only allow necessary HTTP methods
- Configure appropriate caching directives
// Example of secure CORS configuration
const corsOptions = {
origin: ['https://yourdomain.com', 'https://app.yourdomain.com'],
methods: ['GET', 'POST'],
allowedHeaders: ['Authorization', 'Content-Type'],
maxAge: 86400
};
Implement Proper Token Handling
Secure your JWT tokens:
- Use short expiration times for access tokens (15-60 minutes)
- Configure refresh token rotation
- Use HttpOnly, secure cookies for web applications
- Implement token validation on all protected endpoints
Example secure token storage in a web application:
// INCORRECT - Storing tokens in localStorage
localStorage.setItem('access_token', accessToken);
// CORRECT - Using cookies with proper flags
document.cookie = `access_token=${accessToken}; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`;
Configure Callback URLs
Limit redirect URLs to prevent open redirect vulnerabilities:
- Go to Dashboard > Applications > Your App > Settings > URLs
- Add only specific callback/redirect URLs
- Avoid using wildcards or patterns that could be exploited
Infrastructure Security
IP Allowlisting
Restrict dashboard access by IP (for enterprise plans):
- Navigate to Dashboard > Organization > Security > Network
- Enable IP allowlisting
- Add the IP ranges that should have dashboard access
- Save your configuration
Regular Security Scanning
Implement regular security checks:
- Enable Security Scanning in your dashboard
- Schedule automated vulnerability assessments
- Review security notifications promptly
- Address identified vulnerabilities
Enable Logging and Monitoring
Set up comprehensive logging:
- Go to Dashboard > Monitoring > Logs
- Configure log retention periods
- Enable alert notifications for suspicious activities:
- Failed login attempts
- Unusual location logins
- Admin account changes
- API key usage from new locations
Data Protection
Protect sensitive user data:
- Enable Field Encryption for sensitive user metadata
- Configure data retention policies
- Implement proper GDPR controls
- Use pseudonymization where appropriate
Advanced Security Features
Implement Rate Limiting
Protect against brute force and denial-of-service attacks:
- Go to Dashboard > Security > Rate Limiting
- Enable rate limiting for login and registration endpoints
- Configure appropriate thresholds:
- Login attempts: 5-10 per minute per IP
- Registration: 3-5 per hour per IP
- Password reset: 3 per hour per user/IP
// Example rate limiting configuration
{
"endpoints": {
"/api/auth/login": {
"limit": 5,
"window": "1m"
},
"/api/auth/register": {
"limit": 3,
"window": "1h"
}
},
"defaultAction": "block"
}
Implement Brute Force Protection
Prevent automated password guessing:
- Navigate to Dashboard > Security > Brute Force Protection
- Enable account lockout after consecutive failed attempts
- Configure lockout duration and reset conditions
- Set up notification alerts for locked accounts
Bot Protection
Protect authentication endpoints from bots:
- Go to Dashboard > Security > Bot Protection
- Enable CAPTCHA for suspicious login attempts
- Configure browser fingerprinting
- Enable machine learning-based detection (Enterprise plan)
Security Response Plan
Incident Response
Prepare for security incidents:
- Document your incident response plan
- Identify team members responsible for security incidents
- Configure security alerts to appropriate channels (email, Slack, etc.)
- Practice your response plan regularly
User Communication
Plan for security communications:
- Prepare email templates for security incidents
- Configure your notification settings in Dashboard > Organization > Notifications
- Document your process for notifying affected users
Security Contact
Establish security contacts:
- Set up a security@ email address for vulnerability reports
- Consider implementing a bug bounty program
- Designate security contacts in your organization
Compliance Considerations
Regulatory Compliance
Configure necessary compliance settings:
- Go to Dashboard > Compliance
- Enable applicable regulations:
- GDPR (European Union)
- CCPA/CPRA (California)
- HIPAA (Healthcare - US)
- SOX (Financial - US)
- LGPD (Brazil)
- Configure data residency settings if needed
Audit Logging
Maintain comprehensive audit logs:
- Navigate to Dashboard > Monitoring > Audit Logs
- Configure log retention periods according to compliance requirements
- Set up log export to your SIEM system if needed
- Enable logging for all security-critical events
Regular Security Maintenance
Update Frequently
Keep your Authoh instance updated:
- For cloud users: Updates are applied automatically
- For self-hosted: Subscribe to security bulletins and apply updates promptly
- Review release notes for security-related changes
Regular Security Reviews
Schedule periodic security reviews:
- Conduct quarterly reviews of your Authoh security settings
- Review user access rights and remove unused accounts
- Update security policies based on changing requirements
- Consider external security assessments annually
Security Resources
For more information about securing your Authoh implementation:
If you discover a security vulnerability, please report it immediately to security@authoh.com or through our security vulnerability form.