بنقرة واحدة
security-audit
Comprehensive security audit with findings classification, epic generation, and PDF report
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Comprehensive security audit with findings classification, epic generation, and PDF report
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | security-audit |
| description | Comprehensive security audit with findings classification, epic generation, and PDF report |
| disable-model-invocation | true |
You perform a comprehensive security audit of the current codebase. The audit consists of three phases: Analysis, Epic creation, and PDF report generation.
Scope: $ARGUMENTS (default: full – all categories). Possible restrictions: docker, api, auth, dependencies, config, network.
Language: Parse $ARGUMENTS for a lang=XX parameter (e.g. lang=de, lang=fr). Default language is English. If a lang parameter is found, produce ALL output (epics, PDF report content, section headings, findings, summary) in the specified language. The lang parameter can be combined with a scope, e.g. /security-audit docker lang=de.
Examine the codebase systematically across these categories:
| Category | What to check |
|---|---|
| Source Code | Injection vulnerabilities (SQL, Command, SSRF, XSS), insecure deserialization, missing input validation, hardcoded secrets, insecure crypto |
| Authentication & Authorization | Token handling, session management, missing auth checks, token leakage (logs, errors), credential storage |
| Docker & Containers | Root user, unnecessary packages, missing security options (read_only, no-new-privileges, cap_drop), secret handling, base image currency |
| CI/CD Pipeline | Secret exposure in logs, missing image scans, insecure registry configuration, missing SAST/DAST |
| Dependencies | Known CVEs (check package.json/requirements.txt/go.mod etc.), outdated packages, unnecessary dependencies |
| Configuration | Missing TLS enforcement, open CORS, missing rate limits, insecure defaults, missing security headers |
| Network & Transport | Cleartext transmission, missing timeouts, unlimited body sizes, DNS rebinding |
CLAUDE.md, README.md, package.json (or equivalent) for project overviewsrc/ (or main source directory) recursivelyDockerfile, docker-compose*.yml, .gitlab-ci.yml, .github/workflows/.env*, config.*, etc.)package-lock.json/yarn.lock/go.sum for known vulnerable versionsClassify each finding by severity:
| Severity | Criteria | Prefix |
|---|---|---|
| CRITICAL | Directly exploitable, Remote Code Execution, credential theft, full compromise | C1, C2, ... |
| HIGH | Exploitable with preconditions, significant impact, data loss possible | H1, H2, ... |
| MEDIUM | Defense-in-depth gap, best-practice violation with concrete risk | M1, M2, ... |
| LOW | Hardening measure, minimal direct impact, improvement suggestion | L1, L2, ... |
For each finding document:
Also document what is already well implemented. Examples:
Create or update one epic per severity level with concrete tickets in docs/epics/:
Before creating or modifying epics, check if docs/epics/epic-security-*.md files already exist. If they do:
✓ RESOLVED. Add a **Resolution:** section describing what was done. Check off the acceptance criteria. NEVER delete the ticket.**Re-evaluation ([Date]):** note explaining what changed. If severity changed, move the ticket to the appropriate epic file (and leave a cross-reference in the old location)closed when all tickets within it are resolvedFor each severity level (where findings exist) create a file:
docs/epics/epic-security-critical.md – Critical findingsdocs/epics/epic-security-high.md – High findingsdocs/epics/epic-security-medium.md – Medium findingsdocs/epics/epic-security-low.md – Low findings# Epic: Security Hardening – [Severity] Findings
**Status:** open | closed
**Priority:** [CRITICAL/HIGH/MEDIUM/LOW]
**Source:** Security Audit, [Date]
## Description
[1-2 sentence summary]
---
## Tickets
### [Epic-Nr].[Ticket-Nr] – [Title]
**File:** `[Path]`
**Finding:** [ID] – [Short description]
**Current Code ([File]:[Lines]):**
\`\`\`[language]
[code]
\`\`\`
**Required Changes:**
1. [Concrete instruction with code example]
2. [...]
---
### [Epic-Nr].[Ticket-Nr] – [Title] ✓ RESOLVED
**File:** `[Path]`
**Finding:** [ID] – [Short description]
**Resolution:** [What was done to fix the issue]
---
## Acceptance Criteria
- [ ] [Testable criterion 1]
- [x] [Resolved criterion]
Generate a professional security audit report as PDF.
Read the HTML template from this skill directory: report-template.html
Read the references from this skill directory: references.md
Populate the template with the audit results (replace the placeholder comments). Set the <html lang="..."> attribute to the active language code (e.g. en, de, fr)
Create the output directory docs/security-audit/ if it does not exist
Determine the output filename. Use the timestamp format YYYY-MM-DD-HHmmSS (current date and time):
docs/security-audit/): [projectname]-security-audit-YYYY-MM-DD.pdf[projectname]-security-review-YYYY-MM-DD-HHmmSS.pdfThis keeps the original audit as baseline and creates timestamped reviews alongside it for traceability.
Write the populated HTML file to docs/security-audit/[filename].html
Detect the platform and resolve the Chrome binary path:
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"google-chrome-stable or google-chrome (whichever is found in PATH)"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe" or "C:\Program Files\Google\Chrome\Application\chrome.exe"If Chrome is not found, inform the user and skip PDF generation (epics and summary are still produced).
Convert via Chrome headless to PDF:
<resolved-chrome-path> \
--headless --disable-gpu --no-sandbox \
--print-to-pdf="docs/security-audit/[filename].pdf" \
--print-to-pdf-no-header \
"docs/security-audit/[filename].html"
Delete the temporary HTML file
The report must contain:
Calculate the score as percentage:
Score = 100 - (Critical * 20) - (High * 10) - (Medium * 4) - (Low * 1)
Score = max(0, min(100, Score))
Mapping:
At the end of the audit show a summary:
Security Audit completed.
Result: [Rating] ([Score]/100)
- Critical: [n] findings
- High: [n] findings
- Medium: [n] findings
- Low: [n] findings
- Positive: [n] findings
Generated files:
- docs/epics/epic-security-critical.md (if findings exist)
- docs/epics/epic-security-high.md (if findings exist)
- docs/epics/epic-security-medium.md (if findings exist)
- docs/epics/epic-security-low.md (if findings exist)
- docs/security-audit/[projectname]-security-audit-YYYY-MM-DD.pdf (first audit)
- docs/security-audit/[projectname]-security-review-YYYY-MM-DD-HHmmSS.pdf (subsequent reviews)