coverme-security-scanner 3.7.0 → 3.7.1

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,48 @@
1
- # Security Assessment Generator v3
1
+ # Security Assessment - Automated Scan
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
+ Run a comprehensive security assessment on this codebase. Execute ALL steps automatically without asking for confirmation.
12
4
 
5
+ ## Step 1: Setup
6
+ Run this command using Bash:
13
7
  ```bash
14
8
  mkdir -p .coverme
15
9
  ```
16
10
 
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
- },
94
-
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
- },
11
+ ## Step 2: Launch 7 Security Agents in Parallel
12
+ Launch ALL 7 agents simultaneously using the Task tool with subagent_type="general-purpose". Do NOT wait between launches - send all 7 in a single response.
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
+ **Agent 1 - Executive Summary:**
15
+ Analyze this codebase architecture and security posture. Identify tech stack, components, trust boundaries. Write findings to .coverme/partial-01-executive.json as valid JSON with fields: project (string), date (YYYY-MM-DD), executiveSummary (string), architecture (object with overview string, components array of {name, technology, description}, trustBoundaries array of {id, boundary, trustLevel, description}), topPriorities array of {finding, severity, action}.
126
16
 
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
- ],
17
+ **Agent 2 - Attack Surface:**
18
+ Map all API endpoints, entry points, unauthenticated routes, admin interfaces. Write to .coverme/partial-02-surface.json as valid JSON with: network (object with diagram string, ports array, externalDeps array of {service, endpoint, auth, risk}), findings array.
140
19
 
141
- "riskMatrix": [
142
- { "category": "Authentication", "currentRisk": "high", "residualRisk": "low", "trend": "stable" }
143
- ],
20
+ **Agent 3 - Vulnerability Hunter:**
21
+ Hunt for security vulnerabilities: hardcoded secrets, SQL injection, XSS, command injection, auth bypass. Include actual code snippets. Write to .coverme/partial-03-vulns.json as valid JSON with findings array containing: id, title, severity (critical/high/medium/low/info), file, line, issue, why, fix, cwe, codeEvidence array of {file, startLine, endLine, code, annotation}, proofOfConcept.
144
22
 
145
- "threatModel": [
146
- { "id": "T-01", "severity": "high", "dread": 6.5, "status": "open", "finding": "Description" }
147
- ],
23
+ **Agent 4 - Attack Chains:**
24
+ Identify how vulnerabilities combine for greater impact. Map attack scenarios. Write to .coverme/partial-04-chains.json as valid JSON with: attackChains array of {id, name, description, likelihood, impact, steps array of {order, findingId, action, outcome}, mitigationStrategy}, riskMatrix array of {category, currentRisk, residualRisk, trend}.
148
25
 
149
- "positiveObservations": [
150
- { "title": "Good Practice", "description": "What they did right..." }
151
- ],
26
+ **Agent 5 - Business Logic:**
27
+ Find business logic flaws: race conditions, workflow bypass, privilege escalation. Write to .coverme/partial-05-business.json as valid JSON with: findings array, threatModel array of {id, severity, dread, status, finding}.
152
28
 
153
- "complianceMapping": [
154
- {
155
- "framework": "SOC2",
156
- "controls": [
157
- { "controlId": "CC6.1", "name": "Logical Access", "status": "partial", "relatedFindings": ["HIGH-02"] }
158
- ]
159
- }
160
- ],
29
+ **Agent 6 - Infrastructure:**
30
+ Check Docker, K8s, CI/CD, secrets management, dependencies. Write to .coverme/partial-06-infra.json as valid JSON with: findings array, qualityReview object with deadCode/dryViolations/deprecated arrays.
161
31
 
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
- },
32
+ **Agent 7 - Compliance:**
33
+ Map findings to SOC2, PCI-DSS, GDPR. Identify positive practices. Write to .coverme/partial-07-compliance.json as valid JSON with: complianceMapping array of {framework, controls array}, remediation object with p0/p1/p2/p3 arrays of {action, finding, owner}, positiveObservations array of {title, description}, privacyAnalysis array.
166
34
 
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:
35
+ ## Step 3: Wait for All Agents
36
+ After launching all 7 agents, wait for them to complete using AgentOutputTool.
181
37
 
38
+ ## Step 4: Generate Report
39
+ After all agents complete, run this command using Bash:
182
40
  ```bash
183
- ls -la .coverme/partial-*.json
41
+ coverme-merge .coverme && coverme .coverme/scan.json security-report.pdf && open security-report.pdf
184
42
  ```
185
43
 
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
44
+ ## IMPORTANT INSTRUCTIONS
45
+ - Execute ALL steps automatically - do not ask for confirmation
46
+ - Launch all 7 agents in PARALLEL (single message with 7 Task tool calls)
47
+ - Wait for ALL agents to complete before running the final command
48
+ - The PDF will open automatically when done
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.1",
4
4
  "description": "AI-powered security assessment reports with beautiful PDF output",
5
5
  "type": "module",
6
6
  "bin": {