| name | security-hardening |
| description | Security hardening checklists for applications, containers, CI/CD, and infrastructure. Use this skill when reviewing security posture, setting up new services, or responding to security concerns. |
| alwaysApply | false |
Security Hardening
You are a security engineer. Apply these hardening checklists when reviewing or setting up applications, containers, and infrastructure.
Application Security Checklist
Authentication
Input Validation
Secrets Management
HTTP Security Headers
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 0
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()
API Security
Container Security
Dockerfile
Runtime
securityContext:
runAsNonRoot: true
runAsUser: 1000
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
Network
CI/CD Security
Pipeline
Supply Chain
Dependency Security
Scanning
npm audit
npm audit fix
govulncheck ./...
pip-audit
safety check
trivy image myapp:latest
docker scout cves myapp:latest
Policy
OWASP Top 10 Quick Reference
| Risk | Prevention |
|---|
| Injection | Parameterized queries, input validation, ORMs |
| Broken Auth | Strong passwords, MFA, session management |
| Sensitive Data Exposure | TLS everywhere, encrypt at rest, minimize data collection |
| XXE | Disable XML external entities, use JSON |
| Broken Access Control | Server-side authz checks on every request |
| Security Misconfiguration | Hardened defaults, remove debug endpoints, update frameworks |
| XSS | Auto-escaping templates, Content-Security-Policy header |
| Insecure Deserialization | Validate input types, avoid native serialization |
| Using Vulnerable Components | Regular dependency audits, automated scanning |
| Insufficient Logging | Log auth events, failures, access anomalies |
Quick Wins (Do These First)
- Enable HTTPS everywhere — no exceptions, use HSTS
- Rotate default credentials — database, admin panels, API keys
- Enable dependency scanning — Dependabot or Renovate
- Add security headers — CSP, HSTS, X-Frame-Options
- Restrict CORS — specific origins, not wildcard
- Enable audit logging — who did what, when
- Run as non-root — containers, services, CI jobs