$npx -y skills add Aedelon/claude-code-blueprint --skill security-auditProactive security audit: OWASP top 10, dependency vulnerabilities, secrets detection, input validation, auth patterns, and secure defaults. MUST BE USED when user mentions: "security", "vulnerability", "audit", "OWASP", "CVE", "security review", "pentest", "injection", "XSS", "C
| 1 | # Security Audit |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Systematic security review covering OWASP Top 10, dependency vulnerabilities, secrets, and secure patterns. |
| 6 | |
| 7 | ## Process |
| 8 | |
| 9 | ``` |
| 10 | Phase 1: SCAN -> Automated scans (deps, secrets, patterns) |
| 11 | Phase 2: ANALYZE -> Manual review of high-risk areas |
| 12 | Phase 3: CLASSIFY -> Rate findings by severity |
| 13 | Phase 4: RECOMMEND -> Propose fixes with priority |
| 14 | ``` |
| 15 | |
| 16 | ## Phase 1: Automated Scans |
| 17 | |
| 18 | ### Dependency Vulnerabilities |
| 19 | |
| 20 | ```bash |
| 21 | # JavaScript/TypeScript |
| 22 | npm audit |
| 23 | |
| 24 | # Python |
| 25 | uv run pip-audit |
| 26 | |
| 27 | # Rust |
| 28 | cargo audit |
| 29 | ``` |
| 30 | |
| 31 | ### Secrets Detection |
| 32 | |
| 33 | Search for hardcoded secrets using Grep: |
| 34 | |
| 35 | ``` |
| 36 | Patterns to search for: |
| 37 | - API keys: long alphanumeric strings in config files |
| 38 | - Credentials: password/token/secret assignments with literal values |
| 39 | - Cloud provider keys: AWS access key patterns (starts with AKIA) |
| 40 | - Private key headers: PEM format key blocks |
| 41 | - Connection strings: database URIs containing embedded credentials |
| 42 | - .env files: verify .env is listed in .gitignore |
| 43 | ``` |
| 44 | |
| 45 | Use Grep tool to search for these patterns across the codebase. Focus on: |
| 46 | - Configuration files (*.config.*, *.yml, *.yaml, *.json, *.toml) |
| 47 | - Source code with string assignments to variables named key, secret, token, password |
| 48 | - Environment variable files that should NOT be committed |
| 49 | |
| 50 | ### Dangerous Code Patterns |
| 51 | |
| 52 | Search with Grep for: |
| 53 | |
| 54 | | Pattern | Risk | What to Search | |
| 55 | |---------|------|----------------| |
| 56 | | eval/exec | Code injection | `eval(`, `exec(`, `Function(` | |
| 57 | | SQL concatenation | SQL injection | String concatenation in SQL queries | |
| 58 | | Shell execution | Command injection | `subprocess.call`, `os.system`, `child_process.exec` | |
| 59 | | Unsafe HTML | XSS | `dangerouslySetInnerHTML`, `innerHTML =`, `v-html` | |
| 60 | | Unsafe deserialization | RCE | `pickle.load`, `yaml.load` without SafeLoader | |
| 61 | | Open redirect | Phishing | Redirects using user-controlled input | |
| 62 | | Path traversal | File access | `../` patterns in user-controlled paths | |
| 63 | |
| 64 | ## Phase 2: Manual Review |
| 65 | |
| 66 | ### OWASP Top 10 Checklist |
| 67 | |
| 68 | | # | Vulnerability | What to Check | |
| 69 | |---|--------------|---------------| |
| 70 | | A01 | Broken Access Control | Auth middleware on all routes, RBAC, CORS | |
| 71 | | A02 | Cryptographic Failures | TLS, proper password hashing (bcrypt/argon2), no weak hashing for passwords | |
| 72 | | A03 | Injection | SQL parameterized queries, XSS escaping, command injection | |
| 73 | | A04 | Insecure Design | Business logic flaws, missing rate limiting | |
| 74 | | A05 | Security Misconfiguration | Default credentials, verbose errors in prod, CORS wildcard | |
| 75 | | A06 | Vulnerable Components | Outdated deps, known CVEs | |
| 76 | | A07 | Auth Failures | Session management, brute force protection, MFA | |
| 77 | | A08 | Data Integrity | Unsigned updates, CI/CD pipeline security | |
| 78 | | A09 | Logging Failures | Missing audit logs, PII in logs | |
| 79 | | A10 | SSRF | Unvalidated URLs, internal network access | |
| 80 | |
| 81 | ### Authentication Review |
| 82 | |
| 83 | ``` |
| 84 | Check: |
| 85 | - Password storage -> bcrypt/argon2 (NOT md5/sha1/sha256) |
| 86 | - Session management -> Secure, HttpOnly, SameSite cookies |
| 87 | - JWT -> Algorithm validation, expiry, refresh tokens |
| 88 | - Rate limiting -> Login attempts, API endpoints |
| 89 | - CORS -> Not wildcard for authenticated routes |
| 90 | - CSRF -> Tokens on state-changing operations |
| 91 | ``` |
| 92 | |
| 93 | ### Input Validation Review |
| 94 | |
| 95 | ``` |
| 96 | Check: |
| 97 | - User inputs -> Validated and sanitized at entry |
| 98 | - File uploads -> Type validation, size limits, no path traversal |
| 99 | - API parameters -> Schema validation (zod, pydantic, joi) |
| 100 | - Database queries -> Parameterized, no string concatenation |
| 101 | - Redirects -> Whitelist-only destinations |
| 102 | ``` |
| 103 | |
| 104 | ## Phase 3: Classify Findings |
| 105 | |
| 106 | | Severity | Criteria | Action | |
| 107 | |----------|----------|--------| |
| 108 | | CRITICAL | Remote code execution, auth bypass, data leak | Fix immediately | |
| 109 | | HIGH | XSS, SQL injection, broken access control | Fix before deploy | |
| 110 | | MEDIUM | Missing headers, weak validation, info disclosure | Fix soon | |
| 111 | | LOW | Best practice violations, minor misconfigs | Plan fix | |
| 112 | | INFO | Suggestions, hardening opportunities | Optional | |
| 113 | |
| 114 | ## |