Simplicity first: Security should be simple to implement, simple to use, and simple to maintain.
Startup agility: Implement essential security from the start, but don't over-engineer. Add advanced security measures when you have real threats or compliance requirements.
- Consider security in design, not as an afterthought
- Use secure defaults
- Follow principle of least privilege
- Keep security simple and maintainable
- Identify threats relevant to your application
- Focus on realistic threats, not theoretical ones
- Prioritize based on impact and likelihood
- Keep threat models simple and actionable
- Don't model for threats you don't have
- Add security measures when you have real threats, not hypothetical ones
- Use multiple layers of security
- Don't rely on a single security control
- Keep layers simple and well-understood
- Monitor and test each layer
- Use established authentication libraries and services
- Implement secure password policies (but not overly complex)
- Support multi-factor authentication (MFA) when appropriate
- Use session management best practices
- Implement role-based access control (RBAC)
- Enforce authorization at multiple layers
- Use principle of least privilege
- Keep permission models simple and clear
- Use secure session tokens
- Implement session timeout
- Invalidate sessions on logout
- Protect against session fixation
- Encrypt sensitive data at rest
- Encrypt data in transit (TLS/SSL)
- Use strong, standard encryption algorithms
- Manage encryption keys securely
- Don't collect data you don't need
- Minimize data retention
- Sanitize data before storage
- Handle PII (Personally Identifiable Information) with care
- Never commit secrets to version control
- Use dedicated secret management systems
- Rotate secrets regularly
- Limit access to secrets
- Validate all user input
- Validate on both client and server
- Use allowlists when possible
- Sanitize input before processing
- Encode output to prevent injection attacks
- Use framework-provided encoding functions
- Context matters - encode appropriately
- Don't double-encode
- Use parameterized queries always
- Use ORM query builders appropriately
- Never concatenate user input into SQL
- Validate input types and ranges
- Use standard authentication methods (OAuth, API keys)
- Authenticate all API requests
- Use rate limiting to prevent abuse
- Implement API versioning for breaking changes
- Authorize every API request
- Validate permissions for each operation
- Don't trust client-side authorization
- Log authorization failures
- Validate all API inputs
- Sanitize API responses
- Use appropriate HTTP status codes
- Don't expose internal errors to clients
- Keep dependencies up to date
- Use dependency scanning tools
- Remove unused dependencies
- Prefer well-maintained, security-conscious libraries
- Monitor for known vulnerabilities
- Patch vulnerabilities promptly
- Test patches before deploying
- Have a process for emergency patches
- Log security-relevant events
- Monitor for suspicious activity
- Set up alerts for security incidents
- Keep logs secure and retain appropriately
- Have an incident response plan
- Practice incident response procedures
- Document security incidents
- Learn from incidents to improve
- Understand applicable compliance requirements
- Implement controls to meet requirements
- Document compliance measures
- Regular compliance reviews
- Audit access to sensitive resources
- Review security logs regularly
- Conduct security reviews of code changes
- Perform periodic security assessments
- Include security in testing strategy
- Test authentication and authorization
- Test input validation
- Perform penetration testing when appropriate
- Use static analysis security testing (SAST)
- Use dependency vulnerability scanning
- Integrate security testing into CI/CD
- Fix security issues before deployment
- Document security policies clearly
- Keep policies simple and actionable
- Update policies as threats evolve
- Make policies accessible to the team
- Document security procedures
- Keep runbooks for security incidents
- Document secure coding practices
- Maintain security architecture documentation
- Educate team on security best practices
- Make security everyone's responsibility
- Encourage security questions and discussions
- Learn from security mistakes
- Review and update security practices regularly
- Stay informed about security threats
- Share security learnings with the team
- Balance security with usability
- Real Threats: When you have actual security incidents or identified threats
- Compliance Requirements: When you have regulatory or compliance needs
- Scale: When you have more users/data that increases attack surface
- Sensitive Data: When handling more sensitive data than before
- Business Requirements: When business needs require enhanced security
- Assess Real Risks: Focus on actual threats, not theoretical ones
- Prioritize by Impact: Address high-impact, high-likelihood threats first
- Implement Incrementally: Add security measures as needed
- Test Security: Verify security measures work as intended
- Document Decisions: Record why security measures were added
- Don't add enterprise security patterns without enterprise threats
- Don't over-complicate security for theoretical attacks
- Don't ignore essential security (but don't over-engineer either)
- Don't add security measures "just in case" without evidence
- Don't sacrifice usability for theoretical security gains
- Security through obscurity
- Over-complicating security controls
- Ignoring security until later
- Using weak or custom encryption
- Storing secrets in code or config files
- Trusting client-side validation alone
- Skipping security testing
- Enterprise security patterns without enterprise threats
- Adding security complexity "just in case"
- Optimizing for theoretical attacks