coverme-scanner 1.0.25 → 1.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.
- package/.claude/commands/coverme.md +22 -4
- package/dist/prompts/orchestration.md +328 -11
- package/dist/report/generator.d.ts +29 -0
- package/dist/report/generator.d.ts.map +1 -1
- package/dist/report/generator.js +42 -0
- package/dist/report/generator.js.map +1 -1
- package/dist/templates/report.html +406 -0
- package/package.json +1 -1
- package/src/prompts/orchestration.md +328 -11
- package/src/report/generator.ts +74 -0
- package/src/templates/report.html +406 -0
- package/test-fixed.html +0 -2090
- package/test-handlebars.html +0 -1666
- package/test-mixed.html +0 -2281
- package/test-new.html +0 -1582
- package/test-real-scan.html +0 -2731
- package/test-report.html +0 -1325
- package/test-saas-light.html +0 -2087
- package/test-saas.html +0 -2083
- package/test-scan.json +0 -147
- package/test-type-groups.html +0 -3168
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CoverMe - Ultimate AI Security Scanner
|
|
2
2
|
|
|
3
|
-
The most comprehensive AI-powered code scanner.
|
|
3
|
+
The most comprehensive AI-powered code scanner. 15 specialized agents + 3 validators + deep analysis.
|
|
4
4
|
|
|
5
5
|
$ARGUMENTS
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ $ARGUMENTS
|
|
|
10
10
|
2. **DO NOT STOP FOR CONFIRMATION** - Just keep going through all phases
|
|
11
11
|
3. **DO NOT ASK ABOUT FILE CHANGES** - Automatically update/overwrite scan.json
|
|
12
12
|
4. **DO NOT ASK TO OPEN REPORT** - Just open it automatically at the end
|
|
13
|
-
5. **COMPLETE EVERYTHING IN ONE GO** - All
|
|
13
|
+
5. **COMPLETE EVERYTHING IN ONE GO** - All 6 phases without interruption
|
|
14
14
|
6. **RUN AGENTS IN BACKGROUND** - Use `run_in_background: true` for all Task tool calls
|
|
15
15
|
7. **RUN BASH IN BACKGROUND** - Use `run_in_background: true` for long Bash commands
|
|
16
16
|
|
|
@@ -18,9 +18,27 @@ Execute ALL phases automatically. Do NOT stop until the HTML report is open.
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
## Phase 0: Load Custom Agents
|
|
21
|
+
## Phase 0: Project Discovery & Load Custom Agents
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
### Step 1: Understand the Project
|
|
24
|
+
Before scanning, understand what you're scanning. Run these commands:
|
|
25
|
+
```bash
|
|
26
|
+
# Get project info
|
|
27
|
+
cat package.json 2>/dev/null | head -20
|
|
28
|
+
cat README.md 2>/dev/null | head -50
|
|
29
|
+
ls -la
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Create a mental model of:
|
|
33
|
+
- **Project type**: Backend API, Frontend SPA, Full-stack, CLI tool, Library, etc.
|
|
34
|
+
- **Tech stack**: Node.js, Python, React, Next.js, etc.
|
|
35
|
+
- **Main purpose**: What does this project do? (1-2 sentences)
|
|
36
|
+
- **Architecture**: Monolith, microservices, serverless, etc.
|
|
37
|
+
|
|
38
|
+
This context will be included in the final report.
|
|
39
|
+
|
|
40
|
+
### Step 2: Load Custom Agents (if exists)
|
|
41
|
+
Check if `.coverme/agents.json` exists:
|
|
24
42
|
```bash
|
|
25
43
|
cat .coverme/agents.json 2>/dev/null || echo "NO_CUSTOM_AGENTS"
|
|
26
44
|
```
|
|
@@ -2,7 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
**Ultrathink** - Analyze deeply, consider edge cases, trace data flows completely.
|
|
4
4
|
|
|
5
|
-
Execute this
|
|
5
|
+
Execute this 15-agent security scan with cross-validation.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## PHASE 0: PROJECT DISCOVERY
|
|
10
|
+
|
|
11
|
+
Before scanning, understand what you're scanning:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cat package.json 2>/dev/null | head -30
|
|
15
|
+
cat README.md 2>/dev/null | head -100
|
|
16
|
+
ls -la
|
|
17
|
+
ls src/ 2>/dev/null || ls app/ 2>/dev/null || ls lib/ 2>/dev/null
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Create a **Project Overview** to include in the report:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"projectOverview": {
|
|
25
|
+
"name": "project-name",
|
|
26
|
+
"type": "Backend API | Frontend SPA | Full-stack | CLI | Library | Microservice",
|
|
27
|
+
"stack": ["Node.js", "TypeScript", "React", "PostgreSQL", "Redis"],
|
|
28
|
+
"purpose": "1-2 sentence description of what this project does",
|
|
29
|
+
"architecture": "Monolith | Microservices | Serverless | Hybrid",
|
|
30
|
+
"keyComponents": ["auth service", "payment processing", "AI chat", "etc"]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This context helps readers understand the security findings in context.
|
|
36
|
+
|
|
37
|
+
---
|
|
6
38
|
|
|
7
39
|
## CRITICAL OUTPUT FORMAT
|
|
8
40
|
|
|
@@ -23,7 +55,9 @@ Every finding MUST include ALL these fields for the report to work:
|
|
|
23
55
|
"recommendation": "Exact steps to fix this issue with code example if applicable",
|
|
24
56
|
"cwe": "CWE-XXX (if applicable)",
|
|
25
57
|
"confidence": 85,
|
|
26
|
-
"
|
|
58
|
+
"fixOwner": "developer|devops|architect",
|
|
59
|
+
"fixType": "code|config|infrastructure|design",
|
|
60
|
+
"dread": {
|
|
27
61
|
"damage": 8,
|
|
28
62
|
"reproducibility": 9,
|
|
29
63
|
"exploitability": 7,
|
|
@@ -34,6 +68,19 @@ Every finding MUST include ALL these fields for the report to work:
|
|
|
34
68
|
}
|
|
35
69
|
```
|
|
36
70
|
|
|
71
|
+
### fixOwner & fixType Guidelines
|
|
72
|
+
|
|
73
|
+
**fixOwner** - Who should fix this:
|
|
74
|
+
- `developer` - Code change required (validation, sanitization, logic fix)
|
|
75
|
+
- `devops` - Infrastructure/config change (NetworkPolicy, firewall, K8s config, CI/CD)
|
|
76
|
+
- `architect` - Design decision needed (authentication strategy, data flow, service boundaries)
|
|
77
|
+
|
|
78
|
+
**fixType** - What kind of fix:
|
|
79
|
+
- `code` - Change application code
|
|
80
|
+
- `config` - Change configuration files (env, yaml, json)
|
|
81
|
+
- `infrastructure` - Change deployment/infra (K8s, Docker, cloud)
|
|
82
|
+
- `design` - Requires architectural redesign
|
|
83
|
+
|
|
37
84
|
## DREAD SCORING (for HIGH and CRITICAL findings)
|
|
38
85
|
|
|
39
86
|
Calculate DREAD score (1-10 for each, average for final score):
|
|
@@ -444,9 +491,226 @@ For EACH finding, output the FULL JSON format.
|
|
|
444
491
|
|
|
445
492
|
---
|
|
446
493
|
|
|
494
|
+
### AGENT 11: Network & Architecture Scanner (ID prefix: ARCH)
|
|
495
|
+
|
|
496
|
+
Scan {{PROJECT_PATH}} for network architecture and service boundary issues.
|
|
497
|
+
|
|
498
|
+
**CRITICAL DISTINCTION - Code vs Infrastructure fixes:**
|
|
499
|
+
|
|
500
|
+
For EACH finding, determine:
|
|
501
|
+
- Is this fixable by changing CODE? → fixOwner: "developer"
|
|
502
|
+
- Is this fixable by NetworkPolicy/firewall/K8s config? → fixOwner: "devops"
|
|
503
|
+
- Does this need architecture redesign? → fixOwner: "architect"
|
|
504
|
+
|
|
505
|
+
CHECK FOR:
|
|
506
|
+
|
|
507
|
+
**SERVICE BOUNDARIES:**
|
|
508
|
+
- Internal endpoints exposed externally (should be internal-only)
|
|
509
|
+
- Missing network segmentation between services
|
|
510
|
+
- Service-to-service communication without mTLS
|
|
511
|
+
- Internal IPs hardcoded instead of service discovery
|
|
512
|
+
- Admin/debug ports accessible from outside
|
|
513
|
+
|
|
514
|
+
**TRUST BOUNDARIES:**
|
|
515
|
+
- Which endpoints are meant to be internal-only?
|
|
516
|
+
- Are internal endpoints protected by network policy OR code auth?
|
|
517
|
+
- Document the INTENDED architecture, not just what's missing
|
|
518
|
+
|
|
519
|
+
**KUBERNETES/INFRASTRUCTURE:**
|
|
520
|
+
- Missing NetworkPolicies for namespace isolation
|
|
521
|
+
- Services using ClusterIP that should be internal
|
|
522
|
+
- LoadBalancer exposing internal services
|
|
523
|
+
- Missing Ingress rules for path-based routing
|
|
524
|
+
- Pod-to-pod communication without restrictions
|
|
525
|
+
|
|
526
|
+
**FOR EACH FINDING, specify:**
|
|
527
|
+
```json
|
|
528
|
+
{
|
|
529
|
+
"fixOwner": "devops",
|
|
530
|
+
"fixType": "infrastructure",
|
|
531
|
+
"recommendation": "Add NetworkPolicy to restrict /api/v1/internal/* to enclave namespace only",
|
|
532
|
+
"notCodeFix": true
|
|
533
|
+
}
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
If you find an endpoint that lacks authentication but is INTENDED to be protected by network policy:
|
|
537
|
+
- Mark as fixOwner: "devops", NOT "developer"
|
|
538
|
+
- Recommendation should be NetworkPolicy, NOT code auth
|
|
539
|
+
- Add note: "Protected by network segmentation - verify NetworkPolicy exists"
|
|
540
|
+
|
|
541
|
+
For EACH finding, output the FULL JSON format.
|
|
542
|
+
|
|
543
|
+
---
|
|
544
|
+
|
|
545
|
+
### AGENT 12: Design Decision Detector (ID prefix: DESIGN)
|
|
546
|
+
|
|
547
|
+
Scan {{PROJECT_PATH}} for intentional design decisions that might look like bugs.
|
|
548
|
+
|
|
549
|
+
**GOAL: Prevent false positives by identifying documented/intentional patterns**
|
|
550
|
+
|
|
551
|
+
CHECK FOR:
|
|
552
|
+
|
|
553
|
+
**DOCUMENTED DECISIONS:**
|
|
554
|
+
- Comments explaining WHY something is done a certain way
|
|
555
|
+
- README/docs explaining architecture choices
|
|
556
|
+
- ADR (Architecture Decision Records) files
|
|
557
|
+
- SECURITY.md or similar documentation
|
|
558
|
+
|
|
559
|
+
**INTENTIONAL PATTERNS:**
|
|
560
|
+
- Content filtering disabled with comment "for transparency"
|
|
561
|
+
- Auth bypassed for specific endpoints with documentation
|
|
562
|
+
- Longer session timeouts with business justification
|
|
563
|
+
- Relaxed validation with explicit reason
|
|
564
|
+
|
|
565
|
+
**CODE PATTERNS THAT ARE NOT BUGS:**
|
|
566
|
+
- `// Intentional: ....` or `// Design decision: ...`
|
|
567
|
+
- `// SECURITY: This is safe because...`
|
|
568
|
+
- `// TODO: This is acceptable for now because...`
|
|
569
|
+
- Feature flags controlling security features with documentation
|
|
570
|
+
|
|
571
|
+
**FOR EACH PATTERN FOUND, output:**
|
|
572
|
+
```json
|
|
573
|
+
{
|
|
574
|
+
"id": "DESIGN-001",
|
|
575
|
+
"type": "documented_decision",
|
|
576
|
+
"title": "Content filtering disabled",
|
|
577
|
+
"file": "src/ai/chat.ts",
|
|
578
|
+
"line": 45,
|
|
579
|
+
"reason": "Documented in code comment: 'Disabled for transparency, users see raw AI output'",
|
|
580
|
+
"relatedFindings": ["AI-001"],
|
|
581
|
+
"recommendation": "Not a bug - document in security overview as accepted risk"
|
|
582
|
+
}
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
These findings will be EXCLUDED from the main report and moved to "Design Decisions" section.
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
### AGENT 13: Context-Aware Validator (ID prefix: CTX)
|
|
590
|
+
|
|
591
|
+
Scan {{PROJECT_PATH}} to understand the CONTEXT of each potential finding.
|
|
592
|
+
|
|
593
|
+
**GOAL: Reduce false positives by understanding deployment context**
|
|
594
|
+
|
|
595
|
+
FOR EACH FINDING FROM OTHER AGENTS, determine:
|
|
596
|
+
|
|
597
|
+
**DEPLOYMENT CONTEXT:**
|
|
598
|
+
- Is this code running in a container with network isolation?
|
|
599
|
+
- Is this behind an API gateway that handles auth?
|
|
600
|
+
- Is this internal-only service behind VPN?
|
|
601
|
+
- Is there a WAF/CDN in front that mitigates this?
|
|
602
|
+
|
|
603
|
+
**RUNTIME CONTEXT:**
|
|
604
|
+
- Is this code path actually reachable in production?
|
|
605
|
+
- Is this only used in development/testing?
|
|
606
|
+
- Is this dead code or deprecated?
|
|
607
|
+
- Is this protected by feature flag that's disabled?
|
|
608
|
+
|
|
609
|
+
**DATA FLOW CONTEXT:**
|
|
610
|
+
- Is the input already validated upstream?
|
|
611
|
+
- Is the output sanitized downstream?
|
|
612
|
+
- Is there middleware that applies to this route?
|
|
613
|
+
|
|
614
|
+
**OUTPUT:**
|
|
615
|
+
```json
|
|
616
|
+
{
|
|
617
|
+
"findingId": "SEC-001",
|
|
618
|
+
"contextAnalysis": {
|
|
619
|
+
"deploymentContext": "Runs in K8s with NetworkPolicy restricting access",
|
|
620
|
+
"runtimeContext": "Only reachable from internal services",
|
|
621
|
+
"dataFlowContext": "Input validated by Zod at API gateway level",
|
|
622
|
+
"verdict": "false_positive|confirmed|needs_review",
|
|
623
|
+
"reason": "Protected by network policy - not externally accessible"
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
---
|
|
629
|
+
|
|
630
|
+
### AGENT 14: Enclave & Trusted Compute Scanner (ID prefix: ENC)
|
|
631
|
+
|
|
632
|
+
Scan {{PROJECT_PATH}} for enclave/TEE/trusted compute specific patterns.
|
|
633
|
+
|
|
634
|
+
**APPLIES TO:** Projects using enclaves, TEE, SGX, Nitro Enclaves, confidential computing.
|
|
635
|
+
|
|
636
|
+
CHECK FOR:
|
|
637
|
+
|
|
638
|
+
**ENCLAVE REGISTRATION:**
|
|
639
|
+
- Enclave-to-backend registration without attestation
|
|
640
|
+
- IP-based trust without cryptographic verification
|
|
641
|
+
- Missing remote attestation flow
|
|
642
|
+
- Enclave secrets transmitted without encryption
|
|
643
|
+
|
|
644
|
+
**TRUST MODEL:**
|
|
645
|
+
- What is the trust boundary between enclave and host?
|
|
646
|
+
- Is the communication channel authenticated?
|
|
647
|
+
- Are enclave outputs verified?
|
|
648
|
+
|
|
649
|
+
**SPECIFIC PATTERNS:**
|
|
650
|
+
- /register endpoints for enclave → backend (common pattern)
|
|
651
|
+
- Heartbeat/health endpoints from enclave
|
|
652
|
+
- Configuration push to enclave
|
|
653
|
+
|
|
654
|
+
**FOR ENCLAVE ENDPOINTS, determine:**
|
|
655
|
+
- Is this MEANT to be protected by network only? → Note in finding
|
|
656
|
+
- Is attestation planned but not implemented? → Check TODOs/roadmap
|
|
657
|
+
- Is this MVP/temporary solution? → Check for documentation
|
|
658
|
+
|
|
659
|
+
Output findings with proper fixOwner:
|
|
660
|
+
- Network protection needed → fixOwner: "devops"
|
|
661
|
+
- Attestation needed → fixOwner: "architect" (design change)
|
|
662
|
+
- Code validation needed → fixOwner: "developer"
|
|
663
|
+
|
|
664
|
+
---
|
|
665
|
+
|
|
666
|
+
### AGENT 15: Executive Summary Generator (ID prefix: EXEC)
|
|
667
|
+
|
|
668
|
+
After all other agents complete, generate an executive summary.
|
|
669
|
+
|
|
670
|
+
**OUTPUT FORMAT:**
|
|
671
|
+
```json
|
|
672
|
+
{
|
|
673
|
+
"executiveSummary": {
|
|
674
|
+
"headline": "3 Critical + 5 High findings require immediate attention",
|
|
675
|
+
"riskLevel": "HIGH",
|
|
676
|
+
"topRisks": [
|
|
677
|
+
"SQL injection in user search allows database access",
|
|
678
|
+
"Missing rate limiting enables brute force attacks",
|
|
679
|
+
"Admin API exposed without IP restriction"
|
|
680
|
+
],
|
|
681
|
+
"positives": [
|
|
682
|
+
"Authentication flow is well-implemented",
|
|
683
|
+
"Input validation using Zod on most endpoints",
|
|
684
|
+
"Good use of parameterized queries in core modules"
|
|
685
|
+
],
|
|
686
|
+
"recommendedActions": [
|
|
687
|
+
{
|
|
688
|
+
"priority": 1,
|
|
689
|
+
"action": "Fix SQL injection in src/search.ts",
|
|
690
|
+
"owner": "developer",
|
|
691
|
+
"effort": "1-2 hours"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"priority": 2,
|
|
695
|
+
"action": "Add NetworkPolicy for admin endpoints",
|
|
696
|
+
"owner": "devops",
|
|
697
|
+
"effort": "30 minutes"
|
|
698
|
+
}
|
|
699
|
+
],
|
|
700
|
+
"byOwner": {
|
|
701
|
+
"developer": 5,
|
|
702
|
+
"devops": 3,
|
|
703
|
+
"architect": 1
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
---
|
|
710
|
+
|
|
447
711
|
## PHASE 2: DUPLICATE & EXISTING SOLUTIONS CHECK
|
|
448
712
|
|
|
449
|
-
### AGENT
|
|
713
|
+
### AGENT 16: Duplicate & Existing Solutions Scanner (ID prefix: DUP)
|
|
450
714
|
|
|
451
715
|
CRITICAL: Before recommending ANY fix, check if a solution ALREADY EXISTS in the codebase.
|
|
452
716
|
|
|
@@ -665,6 +929,42 @@ The final report should ONLY contain findings that are:
|
|
|
665
929
|
{
|
|
666
930
|
"projectName": "project-name",
|
|
667
931
|
"scanDate": "{{SCAN_DATE}}",
|
|
932
|
+
|
|
933
|
+
"projectOverview": {
|
|
934
|
+
"name": "project-name",
|
|
935
|
+
"type": "Backend API | Full-stack | etc",
|
|
936
|
+
"stack": ["Node.js", "TypeScript", "React", "PostgreSQL"],
|
|
937
|
+
"purpose": "Brief description of what this project does",
|
|
938
|
+
"architecture": "Monolith | Microservices | Serverless",
|
|
939
|
+
"keyComponents": ["auth service", "payment processing", "AI chat"]
|
|
940
|
+
},
|
|
941
|
+
|
|
942
|
+
"executiveSummary": {
|
|
943
|
+
"headline": "3 Critical + 5 High findings require immediate attention",
|
|
944
|
+
"riskLevel": "CRITICAL | HIGH | MEDIUM | LOW",
|
|
945
|
+
"topRisks": [
|
|
946
|
+
"SQL injection in user search allows database access",
|
|
947
|
+
"Missing rate limiting enables brute force attacks"
|
|
948
|
+
],
|
|
949
|
+
"positives": [
|
|
950
|
+
"Authentication flow is well-implemented",
|
|
951
|
+
"Good use of parameterized queries"
|
|
952
|
+
],
|
|
953
|
+
"recommendedActions": [
|
|
954
|
+
{
|
|
955
|
+
"priority": 1,
|
|
956
|
+
"action": "Fix SQL injection in src/search.ts",
|
|
957
|
+
"owner": "developer",
|
|
958
|
+
"effort": "1-2 hours"
|
|
959
|
+
}
|
|
960
|
+
],
|
|
961
|
+
"byOwner": {
|
|
962
|
+
"developer": 5,
|
|
963
|
+
"devops": 3,
|
|
964
|
+
"architect": 1
|
|
965
|
+
}
|
|
966
|
+
},
|
|
967
|
+
|
|
668
968
|
"summary": {
|
|
669
969
|
"total": 10,
|
|
670
970
|
"critical": 1,
|
|
@@ -675,9 +975,28 @@ The final report should ONLY contain findings that are:
|
|
|
675
975
|
"mitigatedCount": 5,
|
|
676
976
|
"falsePositiveCount": 3
|
|
677
977
|
},
|
|
978
|
+
|
|
678
979
|
"findings": [
|
|
679
|
-
|
|
980
|
+
{
|
|
981
|
+
"id": "SEC-001",
|
|
982
|
+
"title": "Example finding",
|
|
983
|
+
"severity": "high",
|
|
984
|
+
"fixOwner": "developer",
|
|
985
|
+
"fixType": "code",
|
|
986
|
+
"...": "other fields"
|
|
987
|
+
}
|
|
988
|
+
],
|
|
989
|
+
|
|
990
|
+
"designDecisions": [
|
|
991
|
+
{
|
|
992
|
+
"id": "DESIGN-001",
|
|
993
|
+
"title": "Content filtering disabled for transparency",
|
|
994
|
+
"file": "src/ai/chat.ts",
|
|
995
|
+
"reason": "Documented decision - users see raw AI output",
|
|
996
|
+
"acceptedRisk": "Users may see inappropriate content"
|
|
997
|
+
}
|
|
680
998
|
],
|
|
999
|
+
|
|
681
1000
|
"mitigatedFindings": [
|
|
682
1001
|
{
|
|
683
1002
|
"id": "SEC-005",
|
|
@@ -687,24 +1006,21 @@ The final report should ONLY contain findings that are:
|
|
|
687
1006
|
"mitigationType": "input_validation"
|
|
688
1007
|
}
|
|
689
1008
|
],
|
|
1009
|
+
|
|
690
1010
|
"falsePositives": [
|
|
691
1011
|
{
|
|
692
1012
|
"id": "BIZ-004",
|
|
693
1013
|
"title": "TOCTOU Race Condition",
|
|
694
1014
|
"reason": "Redis Lua script provides atomic operation - no race condition possible",
|
|
695
1015
|
"evidence": ["Lua script at src/services/rate-limit.js:95-113"]
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
"id": "AUTH-003",
|
|
699
|
-
"title": "PKCE Code Reuse",
|
|
700
|
-
"reason": "Intentional design decision documented in code comment",
|
|
701
|
-
"evidence": ["Comment: 'Allow reuse to prevent double-click race condition'"]
|
|
702
1016
|
}
|
|
703
1017
|
],
|
|
1018
|
+
|
|
704
1019
|
"positiveObservations": [
|
|
705
1020
|
"Good pattern 1",
|
|
706
1021
|
"Good pattern 2"
|
|
707
1022
|
],
|
|
1023
|
+
|
|
708
1024
|
"validationSummary": {
|
|
709
1025
|
"totalInitialFindings": 18,
|
|
710
1026
|
"mitigated": 5,
|
|
@@ -713,7 +1029,8 @@ The final report should ONLY contain findings that are:
|
|
|
713
1029
|
"partial": 2,
|
|
714
1030
|
"accuracy": "Only 56% of initial findings were actual issues"
|
|
715
1031
|
},
|
|
716
|
-
|
|
1032
|
+
|
|
1033
|
+
"agentsUsed": ["Security Core", "Auth & Session", "Mitigation Validator", "Network & Architecture", "Design Decision Detector"],
|
|
717
1034
|
"scanDuration": 0
|
|
718
1035
|
}
|
|
719
1036
|
```
|
|
@@ -29,6 +29,33 @@ interface TypeGroup {
|
|
|
29
29
|
lowCount: number;
|
|
30
30
|
findings: ConsensusFinding[];
|
|
31
31
|
}
|
|
32
|
+
interface ProjectOverview {
|
|
33
|
+
name: string;
|
|
34
|
+
type: string;
|
|
35
|
+
stack: string[];
|
|
36
|
+
purpose: string;
|
|
37
|
+
architecture: string;
|
|
38
|
+
keyComponents: string[];
|
|
39
|
+
stackText?: string;
|
|
40
|
+
componentsText?: string;
|
|
41
|
+
}
|
|
42
|
+
interface ExecutiveSummaryData {
|
|
43
|
+
headline: string;
|
|
44
|
+
riskLevel: string;
|
|
45
|
+
topRisks: string[];
|
|
46
|
+
positives: string[];
|
|
47
|
+
recommendedActions?: Array<{
|
|
48
|
+
priority: number;
|
|
49
|
+
action: string;
|
|
50
|
+
owner: string;
|
|
51
|
+
effort?: string;
|
|
52
|
+
}>;
|
|
53
|
+
byOwner?: {
|
|
54
|
+
developer?: number;
|
|
55
|
+
devops?: number;
|
|
56
|
+
architect?: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
32
59
|
interface ReportData {
|
|
33
60
|
projectName: string;
|
|
34
61
|
scanDate: string;
|
|
@@ -40,6 +67,8 @@ interface ReportData {
|
|
|
40
67
|
lowCount: number;
|
|
41
68
|
infoCount: number;
|
|
42
69
|
executiveSummary: string;
|
|
70
|
+
projectOverview?: ProjectOverview;
|
|
71
|
+
executiveSummaryData?: ExecutiveSummaryData;
|
|
43
72
|
criticalFindings: ConsensusFinding[];
|
|
44
73
|
highFindings: ConsensusFinding[];
|
|
45
74
|
mediumFindings: ConsensusFinding[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/report/generator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAY,MAAM,aAAa,CAAC;AAE1E,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAA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,UAAU,GAAG,MAAM,CAuB7E;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,EAClB,cAAc,GAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CAAM,GAChG,OAAO,CAAC,IAAI,CAAC,CAiFf;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,EAClB,cAAc,GAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CAAM,GAChG,OAAO,CAAC,IAAI,CAAC,CA8Df"}
|
package/dist/report/generator.js
CHANGED
|
@@ -119,6 +119,44 @@ function escapeHtml(text) {
|
|
|
119
119
|
.replace(/"/g, '"')
|
|
120
120
|
.replace(/'/g, ''');
|
|
121
121
|
}
|
|
122
|
+
function processProjectOverview(result) {
|
|
123
|
+
const overview = result.projectOverview;
|
|
124
|
+
if (!overview)
|
|
125
|
+
return undefined;
|
|
126
|
+
return {
|
|
127
|
+
...overview,
|
|
128
|
+
stackText: Array.isArray(overview.stack) ? overview.stack.join(', ') : overview.stack || '',
|
|
129
|
+
componentsText: Array.isArray(overview.keyComponents) ? overview.keyComponents.join(', ') : overview.keyComponents || '',
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function processExecutiveSummary(result) {
|
|
133
|
+
const execSummary = result.executiveSummary;
|
|
134
|
+
if (!execSummary || typeof execSummary === 'string')
|
|
135
|
+
return undefined;
|
|
136
|
+
// Count findings by fixOwner
|
|
137
|
+
const byOwner = {
|
|
138
|
+
developer: 0,
|
|
139
|
+
devops: 0,
|
|
140
|
+
architect: 0,
|
|
141
|
+
};
|
|
142
|
+
for (const finding of result.findings || []) {
|
|
143
|
+
const owner = finding.fixOwner || 'developer';
|
|
144
|
+
if (owner === 'developer')
|
|
145
|
+
byOwner.developer++;
|
|
146
|
+
else if (owner === 'devops')
|
|
147
|
+
byOwner.devops++;
|
|
148
|
+
else if (owner === 'architect')
|
|
149
|
+
byOwner.architect++;
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
headline: execSummary.headline || `${result.summary?.critical || 0} Critical + ${result.summary?.high || 0} High findings`,
|
|
153
|
+
riskLevel: execSummary.riskLevel || (result.summary?.critical > 0 ? 'CRITICAL' : result.summary?.high > 0 ? 'HIGH' : 'MEDIUM'),
|
|
154
|
+
topRisks: execSummary.topRisks || [],
|
|
155
|
+
positives: execSummary.positives || [],
|
|
156
|
+
recommendedActions: execSummary.recommendedActions,
|
|
157
|
+
byOwner: execSummary.byOwner || byOwner,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
122
160
|
function generateArchitectureOverviewHtml(result) {
|
|
123
161
|
if (!result.architectureOverview)
|
|
124
162
|
return '';
|
|
@@ -520,6 +558,8 @@ async function generatePdfReport(result, outputPath, falsePositives = []) {
|
|
|
520
558
|
lowCount: counts.low,
|
|
521
559
|
infoCount: counts.info,
|
|
522
560
|
executiveSummary: generateExecutiveSummary(result),
|
|
561
|
+
projectOverview: processProjectOverview(result),
|
|
562
|
+
executiveSummaryData: processExecutiveSummary(result),
|
|
523
563
|
criticalFindings,
|
|
524
564
|
highFindings,
|
|
525
565
|
mediumFindings,
|
|
@@ -589,6 +629,8 @@ async function generateHtmlReport(result, outputPath, falsePositives = []) {
|
|
|
589
629
|
lowCount: counts.low,
|
|
590
630
|
infoCount: counts.info,
|
|
591
631
|
executiveSummary: generateExecutiveSummary(result),
|
|
632
|
+
projectOverview: processProjectOverview(result),
|
|
633
|
+
executiveSummaryData: processExecutiveSummary(result),
|
|
592
634
|
criticalFindings,
|
|
593
635
|
highFindings,
|
|
594
636
|
mediumFindings,
|