Security Audit
What This Does
Performs a comprehensive security audit of an application — combining static analysis (SAST), dynamic analysis (DAST), manual code review, and threat modeling. Produces a prioritized findings report with remediation guidance. Designed for pre-launch reviews, periodic assessments, or after significant codebase changes.
Instructions
Define the audit scope. Clarify:
- What's being audited? (full app, specific module, API, auth system)
- Tech stack and frameworks
- Authentication and authorization mechanisms
- External integrations and data flows
- Previous audit findings (if any)
- Compliance requirements (SOC2, HIPAA, PCI, GDPR)
Threat modeling. Before reviewing code, understand the attack surface:
- Assets: What data and systems need protection?
- Threats: Who would attack and why? (STRIDE model)
- Entry points: Where does untrusted input enter?
- Trust boundaries: Where do privilege levels change?
- Draw the data flow diagram and mark trust boundaries
Static analysis (SAST). Review code for vulnerabilities:
- Injection: SQL, NoSQL, command, LDAP injection points
- Authentication: Password handling, session management, MFA
- Authorization: Access control checks, IDOR vulnerabilities
- Cryptography: Weak algorithms, hardcoded keys, improper randomness
- Data exposure: PII in logs, verbose errors, insecure storage
- Configuration: Debug modes, default credentials, unnecessary features
Manual code review focus areas:
Priority 1 (always review):
- Authentication flows (login, register, password reset, MFA)
- Authorization checks (every endpoint, every data access)
- Input validation (every user-facing input)
- Data serialization/deserialization
- File upload handling
- Payment/financial logic
Priority 2 (review if time permits):
- Error handling (information leakage)
- Logging (sensitive data exposure)
- Third-party integrations (trust boundaries)
- Admin functionality
- API rate limiting
Dynamic analysis (DAST). Test the running application:
- Inject payloads into every input field
- Test authentication bypass scenarios
- Attempt privilege escalation (horizontal and vertical)
- Check for CORS misconfigurations
- Test rate limiting and brute force protections
- Verify security headers (CSP, HSTS, X-Frame-Options)
Classify findings by severity.
| Severity |
Criteria |
Response |
| CRITICAL |
Active exploitation possible, data breach risk |
Fix immediately, block release |
| HIGH |
Exploitable with moderate effort |
Fix before release |
| MEDIUM |
Requires specific conditions to exploit |
Fix within current sprint |
| LOW |
Minimal impact, defense-in-depth |
Schedule for next cycle |
| INFO |
Best practice recommendation |
Track and address opportunistically |
Produce the audit report.
Output Format
# Security Audit Report: {Application Name}
**Date:** {YYYY-MM-DD}
**Auditor:** Claude (automated) + {human reviewer if applicable}
**Scope:** {what was audited}
**Classification:** {Internal / Confidential}
## Executive Summary
{2-3 sentences: overall security posture, critical findings count, recommendation}
## Risk Summary
| Severity | Count |
|----------|-------|
| CRITICAL | {n} |
| HIGH | {n} |
| MEDIUM | {n} |
| LOW | {n} |
| INFO | {n} |
## Findings
### [CRITICAL] {Finding Title}
- **Location:** {file:line or endpoint}
- **Description:** {what the vulnerability is}
- **Impact:** {what an attacker could do}
- **Reproduction:** {steps to reproduce}
- **Remediation:** {how to fix, with code example}
### [HIGH] {Finding Title}
...
## Positive Findings
{Security controls that are working well — important for morale and to prevent regression}
## Recommendations
1. {Prioritized recommendation}
2. {Prioritized recommendation}
## Methodology
{Tools used, areas reviewed, time spent}
Tips
- Start with the threat model — it tells you where to focus manual review
- The most critical bugs are usually in authentication, authorization, and input validation
- Check for the "easy wins" first: hardcoded secrets, SQL injection, XSS — they're common and high-impact
- Don't just find bugs — provide working remediation code
- Document positive findings too — teams need to know what they're doing right
- If the application handles payments, review PCI DSS requirements specifically
- After the audit, recommend setting up automated scanning (see
codeql-integration skill)
1---2name: security-audit3description: Comprehensive security audit combining SAST, DAST, manual code review, and threat modeling for applications.4---56# Security Audit78## What This Does910Performs a comprehensive security audit of an application — combining static analysis (SAST), dynamic analysis (DAST), manual code review, and threat modeling. Produces a prioritized findings report with remediation guidance. Designed for pre-launch reviews, periodic assessments, or after significant codebase changes.1112## Instructions13141. **Define the audit scope.** Clarify:15 - What's being audited? (full app, specific module, API, auth system)16 - Tech stack and frameworks17 - Authentication and authorization mechanisms18 - External integrations and data flows19 - Previous audit findings (if any)20 - Compliance requirements (SOC2, HIPAA, PCI, GDPR)21222. **Threat modeling.** Before reviewing code, understand the attack surface:23 - **Assets:** What data and systems need protection?24 - **Threats:** Who would attack and why? (STRIDE model)25 - **Entry points:** Where does untrusted input enter?26 - **Trust boundaries:** Where do privilege levels change?27 - Draw the data flow diagram and mark trust boundaries28293. **Static analysis (SAST).** Review code for vulnerabilities:30 - **Injection:** SQL, NoSQL, command, LDAP injection points31 - **Authentication:** Password handling, session management, MFA32 - **Authorization:** Access control checks, IDOR vulnerabilities33 - **Cryptography:** Weak algorithms, hardcoded keys, improper randomness34 - **Data exposure:** PII in logs, verbose errors, insecure storage35 - **Configuration:** Debug modes, default credentials, unnecessary features36374. **Manual code review focus areas:**38 ```39 Priority 1 (always review):40 - Authentication flows (login, register, password reset, MFA)41 - Authorization checks (every endpoint, every data access)42 - Input validation (every user-facing input)43 - Data serialization/deserialization44 - File upload handling45 - Payment/financial logic4647 Priority 2 (review if time permits):48 - Error handling (information leakage)49 - Logging (sensitive data exposure)50 - Third-party integrations (trust boundaries)51 - Admin functionality52 - API rate limiting53 ```54555. **Dynamic analysis (DAST).** Test the running application:56 - Inject payloads into every input field57 - Test authentication bypass scenarios58 - Attempt privilege escalation (horizontal and vertical)59 - Check for CORS misconfigurations60 - Test rate limiting and brute force protections61 - Verify security headers (CSP, HSTS, X-Frame-Options)62636. **Classify findings by severity.**6465 | Severity | Criteria | Response |66 |----------|----------|----------|67 | CRITICAL | Active exploitation possible, data breach risk | Fix immediately, block release |68 | HIGH | Exploitable with moderate effort | Fix before release |69 | MEDIUM | Requires specific conditions to exploit | Fix within current sprint |70 | LOW | Minimal impact, defense-in-depth | Schedule for next cycle |71 | INFO | Best practice recommendation | Track and address opportunistically |72737. **Produce the audit report.**7475## Output Format7677```markdown78# Security Audit Report: {Application Name}79**Date:** {YYYY-MM-DD}80**Auditor:** Claude (automated) + {human reviewer if applicable}81**Scope:** {what was audited}82**Classification:** {Internal / Confidential}8384## Executive Summary85{2-3 sentences: overall security posture, critical findings count, recommendation}8687## Risk Summary88| Severity | Count |89|----------|-------|90| CRITICAL | {n} |91| HIGH | {n} |92| MEDIUM | {n} |93| LOW | {n} |94| INFO | {n} |9596## Findings9798### [CRITICAL] {Finding Title}99- **Location:** {file:line or endpoint}100- **Description:** {what the vulnerability is}101- **Impact:** {what an attacker could do}102- **Reproduction:** {steps to reproduce}103- **Remediation:** {how to fix, with code example}104105### [HIGH] {Finding Title}106...107108## Positive Findings109{Security controls that are working well — important for morale and to prevent regression}110111## Recommendations1121. {Prioritized recommendation}1132. {Prioritized recommendation}114115## Methodology116{Tools used, areas reviewed, time spent}117```118119## Tips120121- Start with the threat model — it tells you where to focus manual review122- The most critical bugs are usually in authentication, authorization, and input validation123- Check for the "easy wins" first: hardcoded secrets, SQL injection, XSS — they're common and high-impact124- Don't just find bugs — provide working remediation code125- Document positive findings too — teams need to know what they're doing right126- If the application handles payments, review PCI DSS requirements specifically127- After the audit, recommend setting up automated scanning (see `codeql-integration` skill)