coverme-security-scanner 3.7.0 → 3.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -226,6 +226,6 @@ if (args.length < 1) {
226
226
  }
227
227
 
228
228
  const inputDir = args[0];
229
- const outputFile = args[1] || 'scan.json';
229
+ const outputFile = args[1] || join(inputDir, 'scan.json');
230
230
 
231
231
  mergeReports(inputDir, outputFile);
@@ -1,223 +1,36 @@
1
- # Security Assessment Generator v3
1
+ # Security Assessment
2
2
 
3
- Run a comprehensive security assessment on this codebase and generate a professional PDF report with deep analysis.
4
-
5
- ## Instructions
6
-
7
- You are a senior security architect and penetration tester performing a pre-production security audit. Run 7 parallel security agents to analyze this codebase comprehensively.
8
-
9
- ### Step 0: Setup (Run First!)
10
-
11
- Before starting the scan, create the output directory:
3
+ You MUST follow these steps exactly. Do NOT deviate. Do NOT ask questions. Execute automatically.
12
4
 
5
+ ## Step 1: Create directory
13
6
  ```bash
14
7
  mkdir -p .coverme
15
8
  ```
16
9
 
17
- ### Step 1: Launch Parallel Agents
18
-
19
- Launch these 7 agents simultaneously using the Task tool. **IMPORTANT: Each agent must write its own partial JSON file immediately when done.**
20
-
21
- 1. **Executive Summary Agent** (subagent_type: Explore)
22
- - Understand what the system does
23
- - Identify the tech stack and architecture
24
- - Map trust boundaries and critical assets
25
- - Determine overall risk level
26
- - **When done: Write findings to `.coverme/partial-01-executive.json`**
27
-
28
- 2. **Attack Surface Agent** (subagent_type: Explore)
29
- - Map all entry points (APIs, webhooks, file uploads, CLI args)
30
- - Identify unauthenticated endpoints
31
- - Find admin/debug interfaces
32
- - Document external dependencies and their trust level
33
- - **When done: Write findings to `.coverme/partial-02-attack-surface.json`**
34
-
35
- 3. **Vulnerability Hunter Agent** (subagent_type: Explore)
36
- - OWASP Top 10 deep dive with CODE EVIDENCE
37
- - For each finding: extract the EXACT vulnerable code snippet
38
- - Authentication/authorization bypass paths
39
- - Injection vulnerabilities (SQL, command, XSS, SSTI)
40
- - Secrets in code, hardcoded credentials (show exact lines)
41
- - **When done: Write findings to `.coverme/partial-03-vulnerabilities.json`**
42
-
43
- 4. **Attack Chain Analyst Agent** (subagent_type: Explore)
44
- - Identify how vulnerabilities COMBINE for greater impact
45
- - Map realistic attack scenarios (entry -> pivot -> objective)
46
- - Calculate blast radius for each chain
47
- - **When done: Write findings to `.coverme/partial-04-attack-chains.json`**
48
-
49
- 5. **Business Logic Agent** (subagent_type: Explore)
50
- - Race conditions in critical flows (payments, credits, locks)
51
- - Workflow bypass opportunities (skip steps, replay)
52
- - Credit/billing manipulation vectors
53
- - Privilege escalation paths
54
- - **When done: Write findings to `.coverme/partial-05-business-logic.json`**
55
-
56
- 6. **Infrastructure Agent** (subagent_type: Explore)
57
- - Docker/Kubernetes security (securityContext, network policies)
58
- - CI/CD pipeline security gates (or lack thereof)
59
- - Secrets management (env vars, mounted secrets, hardcoded)
60
- - Dependency vulnerabilities (npm audit, CVEs)
61
- - **When done: Write findings to `.coverme/partial-06-infrastructure.json`**
62
-
63
- 7. **Compliance & Impact Agent** (subagent_type: Explore)
64
- - Map findings to compliance frameworks (SOC2, PCI-DSS, GDPR)
65
- - Calculate business impact for each critical finding
66
- - Estimate financial exposure ranges
67
- - **When done: Write findings to `.coverme/partial-07-compliance.json`**
68
-
69
- ### Agent Output Format
70
-
71
- Each agent should write a partial JSON with this structure (include only relevant fields):
72
-
73
- ```json
74
- {
75
- "project": "Project Name",
76
- "date": "YYYY-MM-DD",
77
- "branch": "branch-name",
78
- "scope": "X files, ~Y lines",
79
- "executiveSummary": "Summary paragraph...",
80
-
81
- "topPriorities": [
82
- { "finding": "Description", "severity": "critical", "action": "Action needed" }
83
- ],
84
-
85
- "architecture": {
86
- "overview": "System description...",
87
- "components": [
88
- { "name": "Component", "technology": "Tech", "description": "Purpose" }
89
- ],
90
- "trustBoundaries": [
91
- { "id": "TB-01", "boundary": "Name", "trustLevel": "untrusted", "description": "..." }
92
- ]
93
- },
10
+ ## Step 2: Launch 7 agents IN PARALLEL
94
11
 
95
- "network": {
96
- "diagram": "ASCII diagram...",
97
- "ports": [
98
- { "port": 443, "protocol": "HTTPS", "component": "API", "binding": "0.0.0.0", "purpose": "Public API" }
99
- ]
100
- },
12
+ You MUST use the Task tool 7 times in a SINGLE message. Each Task MUST have subagent_type="general-purpose" (NOT Explore).
101
13
 
102
- "findings": [
103
- {
104
- "id": "CRIT-01",
105
- "title": "Finding title",
106
- "severity": "critical",
107
- "file": "path/to/file.js",
108
- "line": 123,
109
- "issue": "What we found...",
110
- "why": "Why it matters...",
111
- "fix": "How to fix...",
112
- "status": "open",
113
- "dreadScore": 8.5,
114
- "cwe": "CWE-89",
115
- "codeEvidence": [{
116
- "file": "src/file.js",
117
- "startLine": 45,
118
- "endLine": 50,
119
- "code": "vulnerable code here",
120
- "annotation": "Explanation"
121
- }],
122
- "proofOfConcept": "curl command or steps",
123
- "relatedFindings": ["HIGH-02"]
124
- }
125
- ],
14
+ Task 1: description="Security Executive", subagent_type="general-purpose", prompt="Analyze codebase architecture and security posture. Then use the Write tool to create .coverme/partial-01-executive.json with this exact structure: {\"project\":\"<name>\",\"date\":\"2026-02-19\",\"executiveSummary\":\"<summary>\",\"architecture\":{\"overview\":\"<text>\",\"components\":[{\"name\":\"\",\"technology\":\"\",\"description\":\"\"}],\"trustBoundaries\":[{\"id\":\"\",\"boundary\":\"\",\"trustLevel\":\"\",\"description\":\"\"}]},\"topPriorities\":[{\"finding\":\"\",\"severity\":\"\",\"action\":\"\"}]}"
126
15
 
127
- "attackChains": [
128
- {
129
- "id": "AC-01",
130
- "name": "Chain name",
131
- "description": "How vulnerabilities combine",
132
- "likelihood": "high",
133
- "impact": "critical",
134
- "steps": [
135
- { "order": 1, "findingId": "CRIT-01", "action": "What attacker does", "outcome": "Result" }
136
- ],
137
- "mitigationStrategy": "How to break the chain"
138
- }
139
- ],
16
+ Task 2: description="Attack Surface", subagent_type="general-purpose", prompt="Map API endpoints and entry points. Then use the Write tool to create .coverme/partial-02-surface.json with: {\"network\":{\"diagram\":\"\",\"ports\":[],\"externalDeps\":[]},\"findings\":[]}"
140
17
 
141
- "riskMatrix": [
142
- { "category": "Authentication", "currentRisk": "high", "residualRisk": "low", "trend": "stable" }
143
- ],
18
+ Task 3: description="Vulnerability Scan", subagent_type="general-purpose", prompt="Find security vulnerabilities with code evidence. Then use the Write tool to create .coverme/partial-03-vulns.json with: {\"findings\":[{\"id\":\"\",\"title\":\"\",\"severity\":\"\",\"file\":\"\",\"line\":0,\"issue\":\"\",\"why\":\"\",\"fix\":\"\",\"cwe\":\"\",\"codeEvidence\":[],\"proofOfConcept\":\"\"}]}"
144
19
 
145
- "threatModel": [
146
- { "id": "T-01", "severity": "high", "dread": 6.5, "status": "open", "finding": "Description" }
147
- ],
20
+ Task 4: description="Attack Chains", subagent_type="general-purpose", prompt="Identify attack chains. Then use the Write tool to create .coverme/partial-04-chains.json with: {\"attackChains\":[{\"id\":\"\",\"name\":\"\",\"description\":\"\",\"likelihood\":\"\",\"impact\":\"\",\"steps\":[],\"mitigationStrategy\":\"\"}],\"riskMatrix\":[]}"
148
21
 
149
- "positiveObservations": [
150
- { "title": "Good Practice", "description": "What they did right..." }
151
- ],
22
+ Task 5: description="Business Logic", subagent_type="general-purpose", prompt="Find business logic flaws. Then use the Write tool to create .coverme/partial-05-business.json with: {\"findings\":[],\"threatModel\":[]}"
152
23
 
153
- "complianceMapping": [
154
- {
155
- "framework": "SOC2",
156
- "controls": [
157
- { "controlId": "CC6.1", "name": "Logical Access", "status": "partial", "relatedFindings": ["HIGH-02"] }
158
- ]
159
- }
160
- ],
24
+ Task 6: description="Infrastructure", subagent_type="general-purpose", prompt="Check Docker, CI/CD, dependencies. Then use the Write tool to create .coverme/partial-06-infra.json with: {\"findings\":[],\"qualityReview\":{}}"
161
25
 
162
- "remediation": {
163
- "p0": [{ "action": "Do this NOW", "finding": "CRIT-01", "owner": "Security" }],
164
- "p1": [{ "action": "Do this week", "finding": "HIGH-01", "owner": "Backend" }]
165
- },
26
+ Task 7: description="Compliance", subagent_type="general-purpose", prompt="Map to compliance frameworks. Then use the Write tool to create .coverme/partial-07-compliance.json with: {\"complianceMapping\":[],\"remediation\":{\"p0\":[],\"p1\":[],\"p2\":[],\"p3\":[]},\"positiveObservations\":[],\"privacyAnalysis\":[]}"
166
27
 
167
- "qualityReview": {
168
- "deadCode": [{ "type": "dead-code", "action": "DELETE", "file": "path", "description": "..." }],
169
- "dryViolations": [{ "type": "dry-violation", "action": "MERGE", "file": "path", "description": "..." }]
170
- },
171
-
172
- "privacyAnalysis": [
173
- { "category": "Linkability", "risk": "medium", "description": "...", "mitigation": "..." }
174
- ]
175
- }
176
- ```
177
-
178
- ### Step 2: Wait for All Agents and Verify
179
-
180
- After launching all agents, wait for them to complete. Then verify all partial files exist:
28
+ ## Step 3: Wait for agents
29
+ Use AgentOutputTool to wait for all 7 agents to complete.
181
30
 
31
+ ## Step 4: Generate PDF
182
32
  ```bash
183
- ls -la .coverme/partial-*.json
33
+ coverme-merge .coverme && coverme .coverme/scan.json security-report.pdf && open security-report.pdf
184
34
  ```
185
35
 
186
- You should see 7 files (partial-01 through partial-07).
187
-
188
- ### Step 3: Merge and Generate PDF
189
-
190
- Once all 7 partial files are written, merge them and generate the PDF:
191
-
192
- ```bash
193
- coverme-merge .coverme && coverme .coverme/scan.json security-assessment-$(date +%Y-%m-%d).pdf && open security-assessment-$(date +%Y-%m-%d).pdf
194
- ```
195
-
196
- This command:
197
- 1. Merges all partial-*.json files into scan.json
198
- 2. Generates the PDF report
199
- 3. Opens it automatically
200
-
201
- ### Quality Checklist
202
-
203
- Before generating the PDF, verify:
204
- - [ ] All 7 partial JSON files exist in .coverme/
205
- - [ ] Every CRITICAL/HIGH finding has codeEvidence with actual code
206
- - [ ] At least 2 attack chains are documented
207
- - [ ] CWE IDs are accurate for vulnerability types
208
-
209
- ### Output
210
-
211
- The final deliverables are:
212
- 1. `.coverme/partial-*.json` - Individual agent reports
213
- 2. `.coverme/scan.json` - Merged comprehensive report
214
- 3. `security-assessment-YYYY-MM-DD.pdf` - Professional PDF report
215
-
216
- ---
217
-
218
- Now begin the security assessment:
219
-
220
- 1. Run `mkdir -p .coverme`
221
- 2. Launch all 7 agents in parallel
222
- 3. Each agent writes its own partial JSON when done
223
- 4. After all complete, run the merge and PDF generation command
36
+ CRITICAL: Use subagent_type="general-purpose" for ALL agents. They MUST write JSON files using the Write tool.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coverme-security-scanner",
3
- "version": "3.7.0",
3
+ "version": "3.7.2",
4
4
  "description": "AI-powered security assessment reports with beautiful PDF output",
5
5
  "type": "module",
6
6
  "bin": {