You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Use environment variables for secretsexport JWT_SECRET="your-secret-here"# Use parameterized queries
await _context.Users.FirstOrDefaultAsync(u => u.Id == userId);# Validate all inputsif (!ModelState.IsValid) return BadRequest(ModelState);# Use HTTPS everywhere
services.AddHttpsRedirection(options => options.HttpsPort = 443);
β DON'T
# Never commit secrets
β "ConnectionString": "Server=prod;Password=secret123"# Never use string concatenation for queries
β $"SELECT * FROM Users WHERE Id = '{userId}'"# Never trust user input
β return File(userInput, "application/octet-stream");# Never disable security features
β [AllowAnonymous] on sensitive endpoints
Secure Coding Checklist
π Authentication required for sensitive endpoints
π Authorization checks in place
β Input validation on all user inputs
π‘οΈ Output encoding for displayed data
π Security events logged
π Secrets stored securely (not in code)
π HTTPS enforced
π¦ Rate limiting configured
π¦ Dependency Management
Automated Security Scanning
Tool
Purpose
Frequency
Dependabot
Dependency updates
Daily
CodeQL
Code analysis
On PR
npm audit
JS vulnerabilities
On CI
safety
Python vulnerabilities
On CI
dotnet security-scan
.NET vulnerabilities
On CI
Update Policy
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Dependency Update Policy β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β π΄ Critical vulnerabilities β Patch within 24 hours β
β π High vulnerabilities β Patch within 7 days β
β π‘ Medium vulnerabilities β Patch within 30 days β
β π’ Low vulnerabilities β Next release cycle β
β π¦ Regular updates β Monthly review β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ