coverme-scanner 4.0.4 → 4.1.0
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.
|
@@ -1,583 +1,108 @@
|
|
|
1
|
-
# CoverMe
|
|
1
|
+
# CoverMe Security Scanner v4.1
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Fast AI-powered security scanner with template-based output.
|
|
4
4
|
|
|
5
5
|
$ARGUMENTS
|
|
6
6
|
|
|
7
|
-
## CRITICAL
|
|
8
|
-
|
|
9
|
-
1. **DO NOT ASK ANY QUESTIONS** - Run autonomously
|
|
10
|
-
2. **DO NOT STOP FOR CONFIRMATION** - Keep going
|
|
11
|
-
3. **COMPLETE EVERYTHING** - All phases without interruption
|
|
12
|
-
4. **AGENTS WRITE TO FILES** - Each agent writes results to `.coverme/agents/{ID}.json`
|
|
13
|
-
5. **AGENTS RETURN ONLY "done" or "skipped"** - Never return findings in response
|
|
7
|
+
## CRITICAL: Follow these steps exactly
|
|
14
8
|
|
|
15
9
|
---
|
|
16
10
|
|
|
17
|
-
##
|
|
11
|
+
## Step 1: Setup
|
|
18
12
|
|
|
19
13
|
```bash
|
|
20
|
-
mkdir -p .coverme
|
|
21
|
-
rm -f .coverme/agents/*.json 2>/dev/null
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Get project stats:
|
|
25
|
-
```bash
|
|
26
|
-
FILES=$(find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" \) -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/dist/*" 2>/dev/null | wc -l | tr -d ' ')
|
|
27
|
-
LINES=$(find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.py" \) -not -path "*/node_modules/*" -not -path "*/dist/*" 2>/dev/null | head -50 | xargs wc -l 2>/dev/null | tail -1 | awk '{print $1}')
|
|
28
|
-
echo "Files: $FILES, Lines: ~$LINES"
|
|
14
|
+
mkdir -p .coverme
|
|
29
15
|
```
|
|
30
16
|
|
|
31
17
|
---
|
|
32
18
|
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
**CRITICAL**: Each agent MUST:
|
|
36
|
-
1. Scan the codebase for its specific issues
|
|
37
|
-
2. Write findings to `.coverme/agents/{PREFIX}.json`
|
|
38
|
-
3. Return ONLY the word "done" or "skipped" - NOTHING ELSE
|
|
39
|
-
|
|
40
|
-
Launch ALL with `run_in_background: true`:
|
|
41
|
-
|
|
42
|
-
### Agent 1: SEC - Security Core
|
|
43
|
-
```
|
|
44
|
-
Scan for: SQL injection, XSS, command injection, SSTI, hardcoded secrets, weak crypto.
|
|
45
|
-
Write to .coverme/agents/SEC.json:
|
|
46
|
-
[{"id":"SEC-001","title":"...","severity":"critical|high|medium|low","file":"...","line":N,"description":"...","recommendation":"..."}]
|
|
47
|
-
Return ONLY: "done" or "skipped"
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Agent 2: AUTH - Authentication
|
|
51
|
-
```
|
|
52
|
-
Scan for: JWT issues, session problems, OAuth flaws, weak passwords, missing MFA.
|
|
53
|
-
Write to .coverme/agents/AUTH.json
|
|
54
|
-
Return ONLY: "done" or "skipped"
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Agent 3: API - API Security
|
|
58
|
-
```
|
|
59
|
-
Scan for: CORS issues, rate limiting, input validation, mass assignment, GraphQL issues.
|
|
60
|
-
Write to .coverme/agents/API.json
|
|
61
|
-
Return ONLY: "done" or "skipped"
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Agent 4: INFRA - Infrastructure
|
|
65
|
-
```
|
|
66
|
-
Scan for: Docker issues, K8s misconfig, CI/CD secrets, cloud misconfig.
|
|
67
|
-
Write to .coverme/agents/INFRA.json
|
|
68
|
-
Return ONLY: "done" or "skipped"
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Agent 5: DATA - Data & Privacy
|
|
72
|
-
```
|
|
73
|
-
Scan for: PII exposure, GDPR issues, unencrypted data.
|
|
74
|
-
Write to .coverme/agents/DATA.json
|
|
75
|
-
Return ONLY: "done" or "skipped"
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Agent 5b: SECRETS - Smart Credentials Analysis
|
|
79
|
-
```
|
|
80
|
-
Scan for credentials/secrets WITH CONTEXT ANALYSIS:
|
|
81
|
-
|
|
82
|
-
1. **Find all potential secrets**: API keys, tokens, passwords, connection strings
|
|
83
|
-
|
|
84
|
-
2. **For EACH secret found, analyze context**:
|
|
85
|
-
- Is it in .env file? Check if .env is in .gitignore
|
|
86
|
-
- Is it a sandbox/test/playground key? (look for prefixes: sk_test_, sandbox_, demo_, etc.)
|
|
87
|
-
- Is the domain a test domain? (localhost, *.test, staging.*, sandbox.*)
|
|
88
|
-
- Is there a .env.example suggesting this is dev setup?
|
|
89
|
-
- Is the secret expired? (look for expiry dates, old timestamps)
|
|
90
|
-
- Is it in a test file?
|
|
91
|
-
|
|
92
|
-
3. **Rate severity based on context**:
|
|
93
|
-
- CRITICAL: Production secret in code, not in .env, not gitignored
|
|
94
|
-
- HIGH: Real credentials but only in .env (still bad if committed)
|
|
95
|
-
- MEDIUM: Sandbox/test credentials (may still expire and break things)
|
|
96
|
-
- LOW: Demo/example credentials clearly marked as such
|
|
97
|
-
- INFO: Placeholder values like "your-api-key-here"
|
|
98
|
-
|
|
99
|
-
4. **Smart recommendations**:
|
|
100
|
-
- If sandbox key: "Sandbox key detected. Consider rotating if published to repo. Current risk: LOW"
|
|
101
|
-
- If .env is gitignored: "Secret properly isolated in .env. Verify .env is not committed to git history"
|
|
102
|
-
- If expired: "Key may be expired (created > 1 year ago). Test and rotate"
|
|
103
|
-
|
|
104
|
-
Write to .coverme/agents/SECRETS.json with:
|
|
105
|
-
[{"id":"SECRETS-001","title":"AWS credentials in .env","severity":"medium","file":".env","line":5,"context":{"inGitignore":true,"isPlayground":true,"hasEnvExample":true},"recommendation":"Sandbox credentials properly isolated. Consider rotation schedule."}]
|
|
106
|
-
|
|
107
|
-
Return ONLY: "done" or "skipped"
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Agent 6: AI - AI/LLM Security
|
|
111
|
-
```
|
|
112
|
-
FIRST: Check if AI code exists (openai, anthropic, langchain, etc.)
|
|
113
|
-
If no AI code: Write {"skipped":true} and return "skipped"
|
|
114
|
-
If AI code: Scan for prompt injection, data leakage, output validation.
|
|
115
|
-
Write to .coverme/agents/AI.json
|
|
116
|
-
Return ONLY: "done" or "skipped"
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Agent 7: PERF - Performance & DoS
|
|
120
|
-
```
|
|
121
|
-
Scan for: ReDoS, N+1 queries, memory leaks, unbounded operations.
|
|
122
|
-
Write to .coverme/agents/PERF.json
|
|
123
|
-
Return ONLY: "done" or "skipped"
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### Agent 8: BIZ - Business Logic
|
|
127
|
-
```
|
|
128
|
-
Scan for: Race conditions, TOCTOU, workflow bypass, financial issues.
|
|
129
|
-
Write to .coverme/agents/BIZ.json
|
|
130
|
-
Return ONLY: "done" or "skipped"
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Agent 9: QUAL - Code Quality
|
|
134
|
-
```
|
|
135
|
-
Scan for: High complexity, dead code, anti-patterns.
|
|
136
|
-
Write to .coverme/agents/QUAL.json
|
|
137
|
-
Return ONLY: "done" or "skipped"
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### Agent 9b: SILENT - Silent Failures (CRITICAL)
|
|
141
|
-
```
|
|
142
|
-
Scan SPECIFICALLY for silent error handling patterns:
|
|
143
|
-
|
|
144
|
-
1. **Empty catch blocks**: catch(e) {} or catch { }
|
|
145
|
-
2. **Swallowed errors**: catch(e) { console.log(e) } without rethrow
|
|
146
|
-
3. **Silent fallbacks**: catch(e) { return null } or catch => defaultValue
|
|
147
|
-
4. **Optional chaining abuse**: data?.field?.value without fallback handling
|
|
148
|
-
5. **Nullish coalescing hiding errors**: value ?? {} or value || []
|
|
149
|
-
6. **Promise swallowing**: .catch(() => {}) or .catch(() => null)
|
|
150
|
-
7. **Try without meaningful catch**: try { ... } catch { /* ignore */ }
|
|
151
|
-
8. **Default returns in catch**: catch(e) { return [] } hiding failures
|
|
152
|
-
9. **Logging without action**: catch(e) { logger.error(e); return default }
|
|
153
|
-
10. **Conditional silent fails**: if (!result) return; without error
|
|
154
|
-
|
|
155
|
-
For EACH finding, rate severity:
|
|
156
|
-
- CRITICAL: Payment/auth/security code with silent failure
|
|
157
|
-
- HIGH: Data operations that silently return empty/default
|
|
158
|
-
- MEDIUM: API calls that swallow errors
|
|
159
|
-
- LOW: Non-critical utility functions
|
|
160
|
-
|
|
161
|
-
Write to .coverme/agents/SILENT.json with format:
|
|
162
|
-
[{"id":"SILENT-001","title":"Silent failure in payment processing","severity":"critical","file":"src/payments/charge.ts","line":45,"code":"catch(e) { return { success: false } }","impact":"Payment failures go undetected","recommendation":"Throw PaymentError and alert on-call"}]
|
|
163
|
-
|
|
164
|
-
Return ONLY: "done" or "skipped"
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### Agent 10: TEST - Testing
|
|
168
|
-
```
|
|
169
|
-
Scan for: Missing tests on critical paths, mocked security, no E2E.
|
|
170
|
-
Write to .coverme/agents/TEST.json
|
|
171
|
-
Return ONLY: "done" or "skipped"
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Agent 11: REDIS - Cache Security
|
|
175
|
-
```
|
|
176
|
-
FIRST: Check if Redis/cache code exists.
|
|
177
|
-
If not: Write {"skipped":true} and return "skipped"
|
|
178
|
-
If yes: Scan for dangerous commands, auth issues, race conditions.
|
|
179
|
-
Write to .coverme/agents/REDIS.json
|
|
180
|
-
Return ONLY: "done" or "skipped"
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### Agent 12: RESIL - Resilience
|
|
184
|
-
```
|
|
185
|
-
Scan for: Missing circuit breakers, no timeouts, no retries.
|
|
186
|
-
NOTE: For silent fallbacks, see Agent 9b (SILENT) which handles those specifically.
|
|
187
|
-
Write to .coverme/agents/RESIL.json
|
|
188
|
-
Return ONLY: "done" or "skipped"
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### Agent 13: PII - PII Scanner
|
|
192
|
-
```
|
|
193
|
-
Scan for: PII in logs, PII in URLs, unencrypted PII, missing GDPR controls.
|
|
194
|
-
Write to .coverme/agents/PII.json
|
|
195
|
-
Return ONLY: "done" or "skipped"
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
### Agent 14: DEAD - Dead Code
|
|
199
|
-
```
|
|
200
|
-
Scan for: Unused functions, unused deps, commented code, TODO/FIXME.
|
|
201
|
-
Write to .coverme/agents/DEAD.json
|
|
202
|
-
Return ONLY: "done" or "skipped"
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Agent 15: DB - Database Security
|
|
206
|
-
```
|
|
207
|
-
Scan for: SQL injection, NoSQL injection, missing RLS, exposed connections.
|
|
208
|
-
Write to .coverme/agents/DB.json
|
|
209
|
-
Return ONLY: "done" or "skipped"
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Agent 16: ARCH - Architecture
|
|
213
|
-
```
|
|
214
|
-
Scan for: Internal endpoints exposed, missing mTLS, network issues.
|
|
215
|
-
Write to .coverme/agents/ARCH.json
|
|
216
|
-
Return ONLY: "done" or "skipped"
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Agent 17: DESIGN - Design Decisions
|
|
220
|
-
```
|
|
221
|
-
Find documented design decisions that might look like bugs (intentional patterns).
|
|
222
|
-
Write to .coverme/agents/DESIGN.json
|
|
223
|
-
Return ONLY: "done" or "skipped"
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Agent 18: CTX - Context Validator
|
|
227
|
-
```
|
|
228
|
-
For critical findings from other agents, check deployment context.
|
|
229
|
-
Write to .coverme/agents/CTX.json
|
|
230
|
-
Return ONLY: "done" or "skipped"
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Agent 19: ENC - Enclave Security
|
|
234
|
-
```
|
|
235
|
-
FIRST: Check if enclave/TEE code exists.
|
|
236
|
-
If not: Write {"skipped":true} and return "skipped"
|
|
237
|
-
If yes: Scan for attestation issues.
|
|
238
|
-
Write to .coverme/agents/ENC.json
|
|
239
|
-
Return ONLY: "done" or "skipped"
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
### Agent 20: EXEC - Executive Summary
|
|
243
|
-
```
|
|
244
|
-
After scanning, generate executive summary with top risks and positives.
|
|
245
|
-
Write to .coverme/agents/EXEC.json
|
|
246
|
-
Return ONLY: "done"
|
|
247
|
-
```
|
|
19
|
+
## Step 2: Copy Template
|
|
248
20
|
|
|
249
|
-
|
|
250
|
-
```
|
|
251
|
-
Find existing solutions in codebase that could fix other findings.
|
|
252
|
-
Write to .coverme/agents/DUP.json
|
|
253
|
-
Return ONLY: "done" or "skipped"
|
|
254
|
-
```
|
|
21
|
+
Read and copy this template to .coverme/scan.json:
|
|
255
22
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"project": "PROJECT_NAME_HERE",
|
|
26
|
+
"date": "YYYY-MM-DD",
|
|
27
|
+
"branch": "BRANCH_NAME",
|
|
28
|
+
"scope": "X files, ~Y lines",
|
|
29
|
+
"summary": { "critical": 0, "high": 0, "medium": 0, "low": 0, "total": 0 },
|
|
30
|
+
"overallRiskLevel": "critical|high|medium|low",
|
|
31
|
+
"executiveSummary": "2-3 sentence summary of security posture",
|
|
32
|
+
"topPriorities": [
|
|
33
|
+
{ "finding": "Description", "severity": "critical", "action": "What to do" }
|
|
34
|
+
],
|
|
35
|
+
"criticalFindings": [
|
|
36
|
+
{ "id": "CRIT-01", "title": "Title", "file": "path/file.ts", "line": 123, "description": "What's wrong", "recommendation": "How to fix" }
|
|
37
|
+
],
|
|
38
|
+
"highFindings": [],
|
|
39
|
+
"mediumFindings": [],
|
|
40
|
+
"lowFindings": [],
|
|
41
|
+
"positiveObservations": [
|
|
42
|
+
{ "title": "Good thing found", "description": "Why it's good" }
|
|
43
|
+
]
|
|
44
|
+
}
|
|
261
45
|
```
|
|
262
46
|
|
|
263
47
|
---
|
|
264
48
|
|
|
265
|
-
##
|
|
49
|
+
## Step 3: Scan Codebase (5-7 parallel agents)
|
|
266
50
|
|
|
267
|
-
|
|
51
|
+
Launch these agents in PARALLEL using Task tool with run_in_background:true:
|
|
268
52
|
|
|
269
|
-
### Agent
|
|
53
|
+
### Agent A: Critical Security
|
|
270
54
|
```
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
1. **Non-null assertions**: data!.field, user!.id (TypeScript !)
|
|
274
|
-
2. **Unsafe casts**: as any, as unknown, type assertions without validation
|
|
275
|
-
3. **Unvalidated JSON**: JSON.parse() without try/catch or schema validation
|
|
276
|
-
4. **Trusted input**: req.body used directly without validation (zod, joi, yup)
|
|
277
|
-
5. **Array assumptions**: arr[0] without checking length, arr.map without null check
|
|
278
|
-
6. **Object assumptions**: obj.field without checking obj exists
|
|
279
|
-
7. **Destructuring without defaults**: const {a, b} = data (what if data is null?)
|
|
280
|
-
8. **Assumed authentication**: Routes using req.user without auth middleware
|
|
281
|
-
9. **Assumed types**: parseInt(x) without NaN check, Number(x) used blindly
|
|
282
|
-
10. **Assumed existence**: await db.findOne() used without null check
|
|
283
|
-
|
|
284
|
-
Severity:
|
|
285
|
-
- CRITICAL: Auth/payment code with assumptions
|
|
286
|
-
- HIGH: Data mutation with unchecked input
|
|
287
|
-
- MEDIUM: API responses with assumptions
|
|
288
|
-
- LOW: Internal utility code
|
|
289
|
-
|
|
290
|
-
Write to .coverme/agents/ASSUME.json:
|
|
291
|
-
[{"id":"ASSUME-001","title":"Unvalidated req.body in user update","severity":"high","file":"src/api/users.ts","line":45,"code":"const { email, name } = req.body","assumption":"Input is valid object with email and name","exploit":"Send malformed JSON or missing fields","recommendation":"Add zod schema validation"}]
|
|
292
|
-
|
|
293
|
-
Return ONLY: "done" or "skipped"
|
|
55
|
+
Find CRITICAL issues: hardcoded secrets, SQL injection, command injection, auth bypass.
|
|
56
|
+
Return JSON array of findings with: id, title, file, line, description, recommendation
|
|
294
57
|
```
|
|
295
58
|
|
|
296
|
-
### Agent
|
|
59
|
+
### Agent B: High Security
|
|
297
60
|
```
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
1. **Missing auth middleware**: app.post/get/put/delete without auth check
|
|
301
|
-
2. **Admin routes unprotected**: /admin/*, /internal/* without role check
|
|
302
|
-
3. **Internal service exposure**: Internal APIs accessible from public routes
|
|
303
|
-
4. **Header trust**: Using x-user-id, x-role from headers without verification
|
|
304
|
-
5. **Forwarded input**: User input passed to internal services without sanitization
|
|
305
|
-
6. **Missing role checks**: Actions performed without checking user.role
|
|
306
|
-
7. **Tenant isolation missing**: Multi-tenant data accessed without tenant filter
|
|
307
|
-
8. **Service-to-service trust**: Internal calls without mTLS or API keys
|
|
308
|
-
9. **Webhook endpoints**: /webhook/* without signature verification
|
|
309
|
-
10. **File upload paths**: User-controlled paths without sanitization
|
|
310
|
-
|
|
311
|
-
For each finding, identify:
|
|
312
|
-
- What trust boundary is violated
|
|
313
|
-
- Who can exploit it (anonymous, authenticated, admin)
|
|
314
|
-
- What they can access/do
|
|
315
|
-
|
|
316
|
-
Write to .coverme/agents/TRUST.json:
|
|
317
|
-
[{"id":"TRUST-001","title":"Admin endpoint without role check","severity":"critical","file":"src/routes/admin.ts","line":12,"code":"app.post('/admin/delete-user', async (req,res) => { await deleteUser(req.body.id) })","boundary":"Admin actions accessible to any authenticated user","exploit":"Any logged-in user can delete other users","recommendation":"Add requireRole('admin') middleware"}]
|
|
318
|
-
|
|
319
|
-
Return ONLY: "done" or "skipped"
|
|
61
|
+
Find HIGH issues: XSS, CSRF missing, weak crypto, insecure sessions, IDOR.
|
|
62
|
+
Return JSON array of findings.
|
|
320
63
|
```
|
|
321
64
|
|
|
322
|
-
### Agent
|
|
65
|
+
### Agent C: Medium Issues
|
|
323
66
|
```
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
1. **bcrypt without proper cost**: bcrypt.hash(pwd, 1) or no salt rounds
|
|
327
|
-
2. **JWT without expiration**: jwt.sign() without expiresIn
|
|
328
|
-
3. **JWT without verification**: jwt.decode() instead of jwt.verify()
|
|
329
|
-
4. **Rate limiting without IP**: Rate limit by user but not IP (pre-auth attacks)
|
|
330
|
-
5. **CSRF token generated but not checked**: Token created but middleware missing
|
|
331
|
-
6. **CORS with wildcard**: Access-Control-Allow-Origin: * with credentials
|
|
332
|
-
7. **Helmet without CSP**: Using helmet() but no Content-Security-Policy
|
|
333
|
-
8. **HTTPS redirect missing**: No force-ssl or redirect middleware
|
|
334
|
-
9. **Cookie without flags**: Missing httpOnly, secure, sameSite
|
|
335
|
-
10. **Encryption without IV**: AES without initialization vector
|
|
336
|
-
11. **Password validation weak**: Only length check, no complexity
|
|
337
|
-
12. **Session without rotation**: No session regeneration on auth change
|
|
338
|
-
|
|
339
|
-
Write to .coverme/agents/PARTIAL.json:
|
|
340
|
-
[{"id":"PARTIAL-001","title":"JWT signed but never expires","severity":"high","file":"src/auth/token.ts","line":23,"code":"jwt.sign(payload, secret)","issue":"Token has no expiration","impact":"Stolen tokens valid forever","recommendation":"Add expiresIn: '1h' or similar"}]
|
|
341
|
-
|
|
342
|
-
Return ONLY: "done" or "skipped"
|
|
67
|
+
Find MEDIUM issues: missing input validation, verbose errors, weak passwords.
|
|
68
|
+
Return JSON array of findings.
|
|
343
69
|
```
|
|
344
70
|
|
|
345
|
-
### Agent
|
|
71
|
+
### Agent D: Infrastructure
|
|
346
72
|
```
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
1. **Generic catch-all**: catch(e) { return { error: "Something went wrong" } }
|
|
350
|
-
2. **Lost error context**: catch(e) { throw new Error("Failed") } - original e lost
|
|
351
|
-
3. **Boolean error returns**: return false instead of throwing
|
|
352
|
-
4. **Silent status codes**: return res.status(500) without logging
|
|
353
|
-
5. **Error message swallowing**: catch(e) { console.log("error") } - e not logged
|
|
354
|
-
6. **Missing error types**: All errors thrown as generic Error, not typed
|
|
355
|
-
7. **No error codes**: Errors without codes for client handling
|
|
356
|
-
8. **Audit trail gaps**: Security errors not logged differently
|
|
357
|
-
9. **User-facing stack traces**: In dev mode, stack traces leak to client
|
|
358
|
-
10. **Missing error boundaries**: React without ErrorBoundary, no global handler
|
|
359
|
-
|
|
360
|
-
Impact analysis:
|
|
361
|
-
- Security errors hidden = attacks go undetected
|
|
362
|
-
- Missing audit = compliance failure
|
|
363
|
-
- Generic errors = impossible debugging
|
|
364
|
-
|
|
365
|
-
Write to .coverme/agents/GENERR.json:
|
|
366
|
-
[{"id":"GENERR-001","title":"Auth failure returns generic error","severity":"high","file":"src/auth/login.ts","line":34,"code":"catch(e) { return { success: false, error: 'Login failed' } }","issue":"Cannot distinguish wrong password vs account locked vs brute force","recommendation":"Log detailed error server-side, return error code to client"}]
|
|
367
|
-
|
|
368
|
-
Return ONLY: "done" or "skipped"
|
|
73
|
+
Find infra issues: Docker running as root, exposed ports, missing TLS, weak configs.
|
|
74
|
+
Return JSON array of findings.
|
|
369
75
|
```
|
|
370
76
|
|
|
371
|
-
### Agent
|
|
77
|
+
### Agent E: Positive Patterns
|
|
372
78
|
```
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
1. **Near-identical functions**: Functions >80% similar in different files
|
|
376
|
-
2. **Duplicated middleware**: Same auth/validation logic repeated
|
|
377
|
-
3. **Copy-pasted API handlers**: Similar CRUD operations with slight changes
|
|
378
|
-
4. **Repeated validation**: Same validation rules in multiple places
|
|
379
|
-
5. **Duplicated error handling**: Same try/catch pattern everywhere
|
|
380
|
-
6. **Config duplication**: Same config values hardcoded in multiple files
|
|
381
|
-
7. **SQL query duplication**: Same queries in different files
|
|
382
|
-
8. **Duplicated security checks**: Same role check logic repeated
|
|
383
|
-
|
|
384
|
-
Why this matters:
|
|
385
|
-
- Fix in one place, bug remains in copies
|
|
386
|
-
- Inconsistent behavior across duplicates
|
|
387
|
-
- Maintenance nightmare
|
|
388
|
-
|
|
389
|
-
Write to .coverme/agents/CLONE.json:
|
|
390
|
-
[{"id":"CLONE-001","title":"Auth check duplicated in 5 files","severity":"medium","files":["src/api/users.ts:12","src/api/orders.ts:8","src/api/products.ts:15"],"pattern":"if (!req.user) return res.status(401)","issue":"Auth logic duplicated, inconsistent in orders.ts","recommendation":"Extract to requireAuth middleware"}]
|
|
391
|
-
|
|
392
|
-
Return ONLY: "done" or "skipped"
|
|
79
|
+
Find GOOD security practices: encryption, auth checks, input validation, rate limiting.
|
|
80
|
+
Return array of positive observations.
|
|
393
81
|
```
|
|
394
82
|
|
|
395
|
-
### Agent 28: HARDCODE - Hardcoded Logic Vulnerabilities
|
|
396
|
-
```
|
|
397
|
-
AI hardcodes values that should be configurable/validated. Scan for:
|
|
398
|
-
|
|
399
|
-
1. **Role checks with strings**: if (user.role === "admin") - role from where?
|
|
400
|
-
2. **Hardcoded IDs**: if (userId === "123") or specific UUIDs
|
|
401
|
-
3. **Magic numbers**: if (amount > 10000) without named constant
|
|
402
|
-
4. **Hardcoded URLs**: fetch("https://api.example.com") in code
|
|
403
|
-
5. **Hardcoded credentials**: Even in dev, password = "admin123"
|
|
404
|
-
6. **Hardcoded feature flags**: if (process.env.NODE_ENV === "production")
|
|
405
|
-
7. **Hardcoded timeouts**: setTimeout(fn, 5000) without config
|
|
406
|
-
8. **Hardcoded limits**: if (items.length > 100) without constant
|
|
407
|
-
9. **Hardcoded paths**: fs.readFile("/var/app/config.json")
|
|
408
|
-
10. **Hardcoded emails/domains**: admin@company.com in code
|
|
409
|
-
|
|
410
|
-
Security impact:
|
|
411
|
-
- Role checks bypassable if role source is tainted
|
|
412
|
-
- IDs expose internal structure
|
|
413
|
-
- Can't rotate credentials without code change
|
|
414
|
-
|
|
415
|
-
Write to .coverme/agents/HARDCODE.json:
|
|
416
|
-
[{"id":"HARDCODE-001","title":"Admin role check trusts user-provided role","severity":"critical","file":"src/middleware/admin.ts","line":5,"code":"if (req.user.role === 'admin')","issue":"role comes from JWT claims which user might control","recommendation":"Verify role from database, not token"}]
|
|
417
|
-
|
|
418
|
-
Return ONLY: "done" or "skipped"
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
### Agent 29: AISTYLE - AI Code Style Heuristics
|
|
422
|
-
```
|
|
423
|
-
Identify code that shows signs of AI generation, then audit harder. Scan for:
|
|
424
|
-
|
|
425
|
-
DETECTION PATTERNS (AI-generated code often has):
|
|
426
|
-
1. **Excessive comments**: // This function does X, // Check if Y
|
|
427
|
-
2. **Over-engineering**: Simple task with complex abstraction
|
|
428
|
-
3. **Inconsistent style**: Mixed patterns in same file
|
|
429
|
-
4. **TODO/FIXME clusters**: Multiple incomplete items
|
|
430
|
-
5. **Heavy use of any**: TypeScript with lots of any/unknown
|
|
431
|
-
6. **console.log in production**: Debug statements left in
|
|
432
|
-
7. **Default values everywhere**: value ?? defaultValue pattern
|
|
433
|
-
8. **Try-catch wrapping everything**: Even simple operations
|
|
434
|
-
9. **Unused imports/variables**: Dead code not cleaned up
|
|
435
|
-
10. **Generic function names**: handleClick, processData, doSomething
|
|
436
|
-
|
|
437
|
-
For detected AI-style code, perform DEEPER AUDIT:
|
|
438
|
-
- Check all assumptions
|
|
439
|
-
- Verify error handling
|
|
440
|
-
- Look for edge cases
|
|
441
|
-
- Check security controls
|
|
442
|
-
|
|
443
|
-
Write to .coverme/agents/AISTYLE.json:
|
|
444
|
-
[{"id":"AISTYLE-001","title":"AI-generated payment handler needs audit","severity":"high","file":"src/payments/process.ts","indicators":["excessive comments","try-catch everything","multiple TODO"],"concerns":["Error handling hides failures","No idempotency key","Missing amount validation"],"recommendation":"Manual security review required"}]
|
|
445
|
-
|
|
446
|
-
Return ONLY: "done" or "skipped"
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
### Agent 30: DEPMIS - Dependency Misuse
|
|
450
|
-
```
|
|
451
|
-
AI imports libraries but uses them incorrectly. Scan for:
|
|
452
|
-
|
|
453
|
-
1. **crypto misuse**: createHash without proper algorithm, no HMAC for auth
|
|
454
|
-
2. **JWT misuse**: jwt.decode() for auth (should be verify), algorithm confusion
|
|
455
|
-
3. **bcrypt misuse**: compareSync in async code, low rounds
|
|
456
|
-
4. **axios misuse**: No timeout, no abort controller, no retry
|
|
457
|
-
5. **fetch misuse**: No error handling for non-2xx, no timeout
|
|
458
|
-
6. **SQL client misuse**: String concatenation instead of parameterized
|
|
459
|
-
7. **Redis misuse**: No auth, KEYS in production, no TTL
|
|
460
|
-
8. **fs misuse**: Sync operations blocking event loop, no path sanitization
|
|
461
|
-
9. **child_process misuse**: exec with user input (command injection)
|
|
462
|
-
10. **path misuse**: path.join with user input without sanitization
|
|
463
|
-
|
|
464
|
-
Write to .coverme/agents/DEPMIS.json:
|
|
465
|
-
[{"id":"DEPMIS-001","title":"JWT decoded but not verified","severity":"critical","file":"src/auth/middleware.ts","line":18,"code":"const user = jwt.decode(token)","issue":"decode() doesn't verify signature, attacker can forge tokens","recommendation":"Use jwt.verify(token, secret) instead"}]
|
|
466
|
-
|
|
467
|
-
Return ONLY: "done" or "skipped"
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
### Agent 31: LOGICGAP - Logic Gaps (CRITICAL)
|
|
471
|
-
```
|
|
472
|
-
AI creates early returns without proper handling. Scan for:
|
|
473
|
-
|
|
474
|
-
1. **Silent returns**: if (!user) return; - no log, no error, no audit
|
|
475
|
-
2. **Missing else**: if (condition) { action } with no else handling
|
|
476
|
-
3. **Incomplete state machines**: Enum/status with unhandled cases
|
|
477
|
-
4. **Missing default**: switch without default case
|
|
478
|
-
5. **Null returns**: return null without caller handling
|
|
479
|
-
6. **Incomplete cleanup**: Resource opened but not closed on error path
|
|
480
|
-
7. **Transaction gaps**: DB operations without proper rollback
|
|
481
|
-
8. **Missing finally**: try/catch without finally for cleanup
|
|
482
|
-
9. **Event handler gaps**: addEventListener without removeEventListener
|
|
483
|
-
10. **Incomplete validation**: Some fields validated, others not
|
|
484
|
-
|
|
485
|
-
For each gap, analyze:
|
|
486
|
-
- What happens when the gap is hit
|
|
487
|
-
- Can attacker trigger the gap
|
|
488
|
-
- What's the impact
|
|
489
|
-
|
|
490
|
-
Write to .coverme/agents/LOGICGAP.json:
|
|
491
|
-
[{"id":"LOGICGAP-001","title":"Silent return on missing user","severity":"high","file":"src/api/profile.ts","line":23,"code":"if (!user) return","issue":"No logging, no 404 response, client hangs","exploit":"Probe for valid user IDs by timing differences","recommendation":"return res.status(404).json({error: 'Not found'}) and log attempt"}]
|
|
492
|
-
|
|
493
|
-
Return ONLY: "done" or "skipped"
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
---
|
|
497
|
-
|
|
498
|
-
## Phase 2: Wait for Agents
|
|
499
|
-
|
|
500
|
-
Wait for ALL background agents using `AgentOutputTool`.
|
|
501
|
-
Each should return only "done" or "skipped".
|
|
502
|
-
|
|
503
83
|
---
|
|
504
84
|
|
|
505
|
-
##
|
|
506
|
-
|
|
507
|
-
After all agents complete, run ONE final agent with this mindset:
|
|
508
|
-
|
|
509
|
-
### Agent 32: ADVERSARIAL - Systemic Weakness Review
|
|
510
|
-
```
|
|
511
|
-
IMPORTANT: This agent runs AFTER reading all other agent findings.
|
|
512
|
-
|
|
513
|
-
ASSUME: This entire codebase was written by a junior developer
|
|
514
|
-
under deadline pressure using AI autocomplete.
|
|
515
|
-
|
|
516
|
-
Your mission: Find SYSTEMIC weaknesses, not just individual bugs.
|
|
517
|
-
|
|
518
|
-
1. **Pattern Analysis**:
|
|
519
|
-
- What security controls are MISSING across the codebase?
|
|
520
|
-
- What patterns suggest "happy path only" thinking?
|
|
521
|
-
- Where is defensive programming absent?
|
|
522
|
-
|
|
523
|
-
2. **Attack Surface Summary**:
|
|
524
|
-
- List all entry points (APIs, webhooks, file uploads, etc.)
|
|
525
|
-
- Which have weakest protection?
|
|
526
|
-
- What can an attacker do without authentication?
|
|
527
|
-
|
|
528
|
-
3. **Business Logic Abuse**:
|
|
529
|
-
- Can users get free money/credits/access?
|
|
530
|
-
- Can users manipulate pricing/quantities?
|
|
531
|
-
- Can users access other users' data?
|
|
532
|
-
- Can users escalate privileges?
|
|
85
|
+
## Step 4: Fill Template
|
|
533
86
|
|
|
534
|
-
|
|
535
|
-
- Resource exhaustion (create unlimited X)
|
|
536
|
-
- Referral abuse
|
|
537
|
-
- Trial abuse
|
|
538
|
-
- Rate limit bypass for profit
|
|
87
|
+
After agents complete, use the Edit tool to fill in the template at .coverme/scan.json:
|
|
539
88
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
89
|
+
1. Replace PROJECT_NAME_HERE with actual project name
|
|
90
|
+
2. Replace date with today's date
|
|
91
|
+
3. Fill summary counts from agent findings
|
|
92
|
+
4. Add criticalFindings from Agent A
|
|
93
|
+
5. Add highFindings from Agent B
|
|
94
|
+
6. Add mediumFindings from Agent C
|
|
95
|
+
7. Add positiveObservations from Agent E
|
|
96
|
+
8. Write executiveSummary (2-3 sentences)
|
|
543
97
|
|
|
544
|
-
|
|
545
|
-
[ ] Input validation on all endpoints
|
|
546
|
-
[ ] Output encoding for all user data
|
|
547
|
-
[ ] Authentication on all non-public routes
|
|
548
|
-
[ ] Authorization checks for all resources
|
|
549
|
-
[ ] Rate limiting on all endpoints
|
|
550
|
-
[ ] Audit logging for security events
|
|
551
|
-
[ ] Error handling that doesn't leak info
|
|
552
|
-
[ ] CSRF protection on state-changing operations
|
|
553
|
-
|
|
554
|
-
Write to .coverme/agents/ADVERSARIAL.json:
|
|
555
|
-
{
|
|
556
|
-
"systemicWeaknesses": ["..."],
|
|
557
|
-
"missingControls": ["..."],
|
|
558
|
-
"attackSurface": {"unauthenticated": [...], "authenticated": [...]},
|
|
559
|
-
"worstCaseScenario": "...",
|
|
560
|
-
"chainAttacks": [{"chain": [...], "impact": "..."}],
|
|
561
|
-
"prioritizedRisks": ["..."]
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
Return ONLY: "done"
|
|
565
|
-
```
|
|
98
|
+
**IMPORTANT**: Use Edit tool to modify individual fields. Do NOT rewrite the entire file.
|
|
566
99
|
|
|
567
100
|
---
|
|
568
101
|
|
|
569
|
-
##
|
|
570
|
-
|
|
571
|
-
**Run this single command - it handles everything:**
|
|
572
|
-
|
|
573
|
-
```bash
|
|
574
|
-
coverme --scan . --output security-report-$(date +%Y-%m-%d).pdf && open security-report-$(date +%Y-%m-%d).pdf
|
|
575
|
-
```
|
|
102
|
+
## Step 5: Generate PDF
|
|
576
103
|
|
|
577
|
-
If that doesn't work, use the legacy method:
|
|
578
104
|
```bash
|
|
579
|
-
coverme .coverme/scan.json security-report.pdf
|
|
580
|
-
open security-report.pdf
|
|
105
|
+
coverme .coverme/scan.json security-report-$(date +%Y-%m-%d).pdf && open security-report-$(date +%Y-%m-%d).pdf
|
|
581
106
|
```
|
|
582
107
|
|
|
583
108
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/report/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE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BAAmB,GAAG,MAAM,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAuNpF,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,GAAE,MAAM,GAAG,KAAc,GAC9B,OAAO,CAAC,IAAI,CAAC,CAwDf"}
|
package/dist/report/index.js
CHANGED
|
@@ -47,10 +47,147 @@ Object.defineProperty(exports, "PDFGenerator", { enumerable: true, get: function
|
|
|
47
47
|
* Normalize different JSON structures into a consistent format.
|
|
48
48
|
* Supports:
|
|
49
49
|
* - Flat structure: { projectName, findings, ... }
|
|
50
|
+
* - Alternative flat: { project, date, topPriorities, ... } (from Claude agents)
|
|
50
51
|
* - Metadata wrapper: { scanMetadata: { projectName, ... }, findings, ... }
|
|
51
52
|
* - Statistics wrapper: { projectStatistics: { ... }, findings, ... }
|
|
52
53
|
*/
|
|
53
54
|
function normalizeReportData(rawData) {
|
|
55
|
+
// Handle Claude agent output format: { project, date, topPriorities, attackChains, etc }
|
|
56
|
+
if (rawData.project && !rawData.projectName) {
|
|
57
|
+
const findings = [];
|
|
58
|
+
// Convert topPriorities to findings
|
|
59
|
+
if (rawData.topPriorities) {
|
|
60
|
+
rawData.topPriorities.forEach((p, i) => {
|
|
61
|
+
findings.push({
|
|
62
|
+
id: `CRIT-${String(i + 1).padStart(2, '0')}`,
|
|
63
|
+
title: p.finding,
|
|
64
|
+
severity: p.severity || 'critical',
|
|
65
|
+
category: 'security',
|
|
66
|
+
description: p.finding,
|
|
67
|
+
recommendation: p.action,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// Convert criticalFindings
|
|
72
|
+
if (rawData.criticalFindings) {
|
|
73
|
+
rawData.criticalFindings.forEach((f) => {
|
|
74
|
+
findings.push({
|
|
75
|
+
id: f.id || `CRIT-${findings.length + 1}`,
|
|
76
|
+
title: f.title || f.finding,
|
|
77
|
+
severity: 'critical',
|
|
78
|
+
category: f.category || 'security',
|
|
79
|
+
file: f.file || f.location,
|
|
80
|
+
line: f.line,
|
|
81
|
+
description: f.description || f.finding,
|
|
82
|
+
code: f.evidence || f.code,
|
|
83
|
+
recommendation: f.recommendation || f.remediation,
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
// Convert highFindings
|
|
88
|
+
if (rawData.highFindings) {
|
|
89
|
+
rawData.highFindings.forEach((f) => {
|
|
90
|
+
findings.push({
|
|
91
|
+
id: f.id || `HIGH-${findings.length + 1}`,
|
|
92
|
+
title: f.title || f.finding,
|
|
93
|
+
severity: 'high',
|
|
94
|
+
category: f.category || 'security',
|
|
95
|
+
file: f.file || f.location,
|
|
96
|
+
line: f.line,
|
|
97
|
+
description: f.description || f.finding,
|
|
98
|
+
code: f.evidence || f.code,
|
|
99
|
+
recommendation: f.recommendation || f.remediation,
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
// Convert mediumFindings
|
|
104
|
+
if (rawData.mediumFindings) {
|
|
105
|
+
rawData.mediumFindings.forEach((f) => {
|
|
106
|
+
findings.push({
|
|
107
|
+
id: f.id || `MED-${findings.length + 1}`,
|
|
108
|
+
title: f.title || f.finding,
|
|
109
|
+
severity: 'medium',
|
|
110
|
+
category: f.category || 'security',
|
|
111
|
+
file: f.file || f.location,
|
|
112
|
+
line: f.line,
|
|
113
|
+
description: f.description || f.finding,
|
|
114
|
+
code: f.evidence || f.code,
|
|
115
|
+
recommendation: f.recommendation || f.remediation,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
// Convert lowFindings
|
|
120
|
+
if (rawData.lowFindings) {
|
|
121
|
+
rawData.lowFindings.forEach((f) => {
|
|
122
|
+
findings.push({
|
|
123
|
+
id: f.id || `LOW-${findings.length + 1}`,
|
|
124
|
+
title: f.title || f.finding,
|
|
125
|
+
severity: 'low',
|
|
126
|
+
category: f.category || 'security',
|
|
127
|
+
file: f.file || f.location,
|
|
128
|
+
line: f.line,
|
|
129
|
+
description: f.description || f.finding,
|
|
130
|
+
code: f.evidence || f.code,
|
|
131
|
+
recommendation: f.recommendation || f.remediation,
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// Parse scope for file/line counts
|
|
136
|
+
let filesScanned = 0;
|
|
137
|
+
let linesOfCode = 0;
|
|
138
|
+
if (rawData.scope) {
|
|
139
|
+
const scopeMatch = rawData.scope.match(/(\d[\d,]*)\s*files.*?([\d.]+[KM]?)\s*lines/i);
|
|
140
|
+
if (scopeMatch) {
|
|
141
|
+
filesScanned = parseInt(scopeMatch[1].replace(/,/g, ''));
|
|
142
|
+
const linesStr = scopeMatch[2];
|
|
143
|
+
if (linesStr.endsWith('M')) {
|
|
144
|
+
linesOfCode = parseFloat(linesStr) * 1000000;
|
|
145
|
+
}
|
|
146
|
+
else if (linesStr.endsWith('K')) {
|
|
147
|
+
linesOfCode = parseFloat(linesStr) * 1000;
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
linesOfCode = parseInt(linesStr);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
projectName: rawData.project,
|
|
156
|
+
scanDate: rawData.date || new Date().toISOString(),
|
|
157
|
+
branch: rawData.branch,
|
|
158
|
+
filesScanned,
|
|
159
|
+
linesOfCode,
|
|
160
|
+
summary: rawData.summary || {
|
|
161
|
+
total: findings.length,
|
|
162
|
+
critical: findings.filter(f => f.severity === 'critical').length,
|
|
163
|
+
high: findings.filter(f => f.severity === 'high').length,
|
|
164
|
+
medium: findings.filter(f => f.severity === 'medium').length,
|
|
165
|
+
low: findings.filter(f => f.severity === 'low').length,
|
|
166
|
+
info: 0,
|
|
167
|
+
},
|
|
168
|
+
findings,
|
|
169
|
+
positiveObservations: rawData.positiveObservations || rawData.goodPractices || [],
|
|
170
|
+
executiveSummary: {
|
|
171
|
+
headline: rawData.executiveSummary?.substring(0, 200) || `${rawData.summary?.critical || 0} Critical + ${rawData.summary?.high || 0} High findings`,
|
|
172
|
+
riskLevel: rawData.overallRiskLevel?.toUpperCase() || 'HIGH',
|
|
173
|
+
summary: rawData.executiveSummary,
|
|
174
|
+
topRisks: rawData.topPriorities || [],
|
|
175
|
+
},
|
|
176
|
+
architectureOverview: rawData.architecture,
|
|
177
|
+
threatModel: rawData.attackChains ? {
|
|
178
|
+
threats: rawData.attackChains.map((ac, i) => ({
|
|
179
|
+
id: ac.id || `T-${i + 1}`,
|
|
180
|
+
title: ac.name,
|
|
181
|
+
severity: ac.impact || 'high',
|
|
182
|
+
dreadScore: ac.likelihood === 'high' ? 8 : ac.likelihood === 'medium' ? 5 : 3,
|
|
183
|
+
status: 'open',
|
|
184
|
+
description: ac.description,
|
|
185
|
+
mitigation: ac.mitigationStrategy,
|
|
186
|
+
})),
|
|
187
|
+
} : undefined,
|
|
188
|
+
actionItems: rawData.remediationRoadmap,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
54
191
|
// If it has scanMetadata, extract from there
|
|
55
192
|
if (rawData.scanMetadata) {
|
|
56
193
|
const meta = rawData.scanMetadata;
|
package/dist/report/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/report/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwHA,wCA4DC;AApLD,u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
+
"overallRiskLevel": "",
|
|
14
|
+
"executiveSummary": "",
|
|
15
|
+
"topPriorities": [],
|
|
16
|
+
"criticalFindings": [],
|
|
17
|
+
"highFindings": [],
|
|
18
|
+
"mediumFindings": [],
|
|
19
|
+
"lowFindings": [],
|
|
20
|
+
"attackChains": [],
|
|
21
|
+
"positiveObservations": [],
|
|
22
|
+
"remediationRoadmap": {
|
|
23
|
+
"immediate": [],
|
|
24
|
+
"shortTerm": [],
|
|
25
|
+
"longTerm": []
|
|
26
|
+
}
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coverme-scanner",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "AI-powered security scanner with 33 agents including AI-generated code detection. STRIDE/DREAD scoring, adversarial review, professional PDF reports.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|