- Never commit
.env
files to the repository - Use
.env.example
as a template for required environment variables - All sensitive values should be kept in
.env
files and not committed - Use
NEXT_PUBLIC_
prefix only for variables that need to be exposed to the client
- Store all API keys and secrets in environment variables
- Never hardcode sensitive information in the codebase
- Rotate keys and secrets regularly
- Use different keys for development and production
-
Environment Variables
- Keep sensitive data in
.env
files - Use
.env.local
for local development - Use proper environment-specific files (
.env.development
,.env.production
)
- Keep sensitive data in
-
API Security
- Implement rate limiting
- Use HTTPS for all API calls
- Validate all input data
- Implement proper error handling
-
Client-Side Security
- Don't expose sensitive data to the client
- Implement proper authentication
- Use secure session management
- Sanitize all user input
-
Development Guidelines
- Regular security audits
- Keep dependencies updated
- Follow security best practices
- Regular code reviews
If you discover a security vulnerability, please follow these steps:
- Do Not open a public issue
- Email your findings to [[email protected]]
- Provide detailed information about the vulnerability
- Wait for a response before disclosing publicly
- Environment variables properly configured
- No sensitive data in source control
- Dependencies are up to date
- Input validation implemented
- Rate limiting configured
- Error handling in place
- Authentication properly implemented
- Regular security audits scheduled