Security Practices
Overview
Procedure for implementing security throughout the software development lifecycle
Steps
Step 1: Understand security context
Assess the security landscape for your system:
- Identify data sensitivity (PII, financial, health)
- Understand compliance requirements
- Identify threat actors and motivations
- Map attack surface (entry points)
- Review existing security controls
- Understand risk tolerance
Step 2: Perform threat modeling
Systematically identify and analyze threats:
- Decompose system into components
- Identify trust boundaries
- For each component, identify threats using STRIDE:
- Spoofing (identity)
- Tampering (data)
- Repudiation (deniability)
- Information disclosure
- Denial of service
- Elevation of privilege
- Prioritize threats by risk
- Identify mitigations for each threat
Step 3: Design security architecture
Design security controls for the system:
- Design authentication mechanism
- Design authorization model
- Plan data protection (encryption, masking)
- Design secure communication channels
- Plan logging and monitoring
- Design for defense in depth
Step 4: Implement secure coding practices
Apply security during development:
- Validate all input
- Encode all output appropriately
- Use parameterized queries
- Implement proper error handling
- Manage secrets securely
- Use security-focused code review
- Follow OWASP guidelines
Step 5: Perform security testing
Verify security through testing:
- Run static analysis (SAST)
- Run dependency vulnerability scanning
- Perform dynamic testing (DAST)
- Test authentication and authorization
- Test for OWASP Top 10 vulnerabilities
- Consider penetration testing
Step 6: Configure security monitoring
Set up detection and response capabilities:
- Configure security logging
- Set up alerting for suspicious activity
- Implement intrusion detection
- Monitor for vulnerability announcements
- Establish incident response process
- Plan regular security reviews
Step 7: Document and maintain
Document security for ongoing maintenance:
- Document security architecture
- Document threat model
- Create security runbooks
- Establish security update process
- Plan regular security assessments
- Train team on security practices
When to Use
- Designing security architecture for new system
- Reviewing code for security vulnerabilities
- Implementing authentication and authorization
- Handling sensitive data (PII, credentials, payments)
- Preparing for security audit
- Responding to security incident
- Training developers on secure coding
- Establishing security standards for a team
Verification
- Threat model covers all significant risks
- Authentication and authorization are robust
- OWASP Top 10 vulnerabilities addressed
- Sensitive data is properly protected
- Security testing completed
- Monitoring and alerting configured
- Incident response plan exists
Input: $ARGUMENTS
Apply this procedure to the input provided.