coverme-security-scanner 3.0.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 +349 -0
- package/README.md +97 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +124 -0
- package/dist/index.js.map +1 -0
- package/dist/pdf-generator.d.ts +32 -0
- package/dist/pdf-generator.d.ts.map +1 -0
- package/dist/pdf-generator.js +564 -0
- package/dist/pdf-generator.js.map +1 -0
- package/dist/types.d.ts +141 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +43 -0
- package/src/index.ts +137 -0
- package/src/pdf-generator.ts +684 -0
- package/src/types.ts +204 -0
- package/tsconfig.json +20 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CoverMe Scanner v3 - Type Definitions
|
|
3
|
+
* Clean, minimal types for security assessment reports
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// =============================================================================
|
|
7
|
+
// CORE TYPES
|
|
8
|
+
// =============================================================================
|
|
9
|
+
|
|
10
|
+
export type Severity = 'critical' | 'high' | 'medium' | 'low' | 'info';
|
|
11
|
+
export type ThreatStatus = 'open' | 'partial' | 'mitigated' | 'accepted';
|
|
12
|
+
export type FixOwner = 'developer' | 'devops' | 'architect';
|
|
13
|
+
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// DREAD SCORING
|
|
16
|
+
// =============================================================================
|
|
17
|
+
|
|
18
|
+
export interface DreadScore {
|
|
19
|
+
damage: number; // 1-10: How severe is the impact?
|
|
20
|
+
reproducibility: number; // 1-10: How easy to reproduce?
|
|
21
|
+
exploitability: number; // 1-10: How easy to exploit?
|
|
22
|
+
affectedUsers: number; // 1-10: How many users impacted?
|
|
23
|
+
discoverability: number; // 1-10: How easy to find?
|
|
24
|
+
total: number; // Average of above
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// =============================================================================
|
|
28
|
+
// FINDINGS
|
|
29
|
+
// =============================================================================
|
|
30
|
+
|
|
31
|
+
export interface Finding {
|
|
32
|
+
id: string; // e.g., "T-FE-1", "CR-03"
|
|
33
|
+
title: string; // Specific, descriptive title
|
|
34
|
+
severity: Severity;
|
|
35
|
+
category: string; // security, quality, performance
|
|
36
|
+
|
|
37
|
+
// Location
|
|
38
|
+
file: string;
|
|
39
|
+
line: number | string; // Can be "51-91" for range
|
|
40
|
+
endLine?: number;
|
|
41
|
+
code?: string; // The vulnerable code snippet
|
|
42
|
+
|
|
43
|
+
// Description (must include DREAD-D inline for HIGH/CRITICAL)
|
|
44
|
+
description: string;
|
|
45
|
+
recommendation: string;
|
|
46
|
+
|
|
47
|
+
// Metadata
|
|
48
|
+
cwe?: string; // e.g., "CWE-89"
|
|
49
|
+
owasp?: string; // e.g., "A03:2021"
|
|
50
|
+
dread?: DreadScore;
|
|
51
|
+
confidence?: number; // 0-100
|
|
52
|
+
dpiPriority?: 'Today' | 'This Sprint' | 'Next Sprint' | 'Backlog';
|
|
53
|
+
|
|
54
|
+
// Cross-references
|
|
55
|
+
crossReferences?: string[]; // Related finding IDs
|
|
56
|
+
fixOwner?: FixOwner;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// =============================================================================
|
|
60
|
+
// THREAT MODEL
|
|
61
|
+
// =============================================================================
|
|
62
|
+
|
|
63
|
+
export interface ThreatModelEntry {
|
|
64
|
+
id: string;
|
|
65
|
+
threat: string;
|
|
66
|
+
category: 'STRIDE' | 'LINDDUN';
|
|
67
|
+
strideType?: 'S' | 'T' | 'R' | 'I' | 'D' | 'E'; // Spoofing, Tampering, etc.
|
|
68
|
+
status: ThreatStatus;
|
|
69
|
+
relatedFindings: string[];
|
|
70
|
+
mitigation?: string;
|
|
71
|
+
dreadScore?: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// QUALITY REVIEW
|
|
76
|
+
// =============================================================================
|
|
77
|
+
|
|
78
|
+
export interface QualityItem {
|
|
79
|
+
type: 'delete' | 'merge' | 'simplify';
|
|
80
|
+
file: string;
|
|
81
|
+
lines?: number;
|
|
82
|
+
title: string;
|
|
83
|
+
description: string;
|
|
84
|
+
reason: string;
|
|
85
|
+
roi: string; // e.g., "~250 lines"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface QualityReview {
|
|
89
|
+
deleteItems: QualityItem[];
|
|
90
|
+
mergeItems: QualityItem[];
|
|
91
|
+
simplifyItems: QualityItem[];
|
|
92
|
+
totalLinesRemovable: number;
|
|
93
|
+
percentageOfCodebase: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// =============================================================================
|
|
97
|
+
// EXECUTIVE SUMMARY
|
|
98
|
+
// =============================================================================
|
|
99
|
+
|
|
100
|
+
export interface ExecutiveSummary {
|
|
101
|
+
headline: string; // e.g., "0 Critical + 7 High findings"
|
|
102
|
+
riskLevel: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW';
|
|
103
|
+
overview: string; // 2-3 sentences: architecture + posture
|
|
104
|
+
topRisks: string[]; // Specific risk descriptions
|
|
105
|
+
positives: string[]; // Specific strengths with evidence
|
|
106
|
+
recommendedActions?: RecommendedAction[];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface RecommendedAction {
|
|
110
|
+
priority: number;
|
|
111
|
+
action: string;
|
|
112
|
+
owner: FixOwner;
|
|
113
|
+
effort?: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// =============================================================================
|
|
117
|
+
// ARCHITECTURE
|
|
118
|
+
// =============================================================================
|
|
119
|
+
|
|
120
|
+
export interface ArchitectureComponent {
|
|
121
|
+
name: string;
|
|
122
|
+
type: 'service' | 'database' | 'cache' | 'external' | 'frontend';
|
|
123
|
+
description: string;
|
|
124
|
+
trustLevel: 'untrusted' | 'semi-trusted' | 'trusted';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface TrustBoundary {
|
|
128
|
+
name: string;
|
|
129
|
+
from: string;
|
|
130
|
+
to: string;
|
|
131
|
+
protocol: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface ArchitectureOverview {
|
|
135
|
+
components: ArchitectureComponent[];
|
|
136
|
+
trustBoundaries: TrustBoundary[];
|
|
137
|
+
criticalAssets: { name: string; type: string; location: string; protection: string }[];
|
|
138
|
+
dataFlows: string[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// =============================================================================
|
|
142
|
+
// POSITIVE OBSERVATIONS
|
|
143
|
+
// =============================================================================
|
|
144
|
+
|
|
145
|
+
export interface PositiveObservation {
|
|
146
|
+
title: string; // e.g., "Zero-Knowledge Architecture"
|
|
147
|
+
description: string; // Specific technical evidence
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// =============================================================================
|
|
151
|
+
// PREVIOUSLY RESOLVED
|
|
152
|
+
// =============================================================================
|
|
153
|
+
|
|
154
|
+
export interface ResolvedIssue {
|
|
155
|
+
id: string;
|
|
156
|
+
title: string;
|
|
157
|
+
originalSeverity: Severity;
|
|
158
|
+
resolution: string;
|
|
159
|
+
resolvedDate: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// =============================================================================
|
|
163
|
+
// MAIN SCAN RESULT
|
|
164
|
+
// =============================================================================
|
|
165
|
+
|
|
166
|
+
export interface ScanResult {
|
|
167
|
+
// Project Info
|
|
168
|
+
projectName: string;
|
|
169
|
+
scanDate: string;
|
|
170
|
+
branch?: string;
|
|
171
|
+
commit?: string;
|
|
172
|
+
filesScanned: number;
|
|
173
|
+
linesOfCode: number;
|
|
174
|
+
projectTree?: string;
|
|
175
|
+
|
|
176
|
+
// Project Overview
|
|
177
|
+
projectOverview?: {
|
|
178
|
+
name: string;
|
|
179
|
+
type: string;
|
|
180
|
+
stack: string[];
|
|
181
|
+
purpose: string;
|
|
182
|
+
architecture: string;
|
|
183
|
+
keyComponents: string[];
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// Main Content
|
|
187
|
+
executiveSummary?: ExecutiveSummary;
|
|
188
|
+
architectureOverview?: ArchitectureOverview;
|
|
189
|
+
findings: Finding[];
|
|
190
|
+
threatModel?: ThreatModelEntry[];
|
|
191
|
+
qualityReview?: QualityReview;
|
|
192
|
+
positiveObservations?: PositiveObservation[];
|
|
193
|
+
previouslyResolved?: ResolvedIssue[];
|
|
194
|
+
|
|
195
|
+
// Summary counts
|
|
196
|
+
summary: {
|
|
197
|
+
total: number;
|
|
198
|
+
critical: number;
|
|
199
|
+
high: number;
|
|
200
|
+
medium: number;
|
|
201
|
+
low: number;
|
|
202
|
+
info: number;
|
|
203
|
+
};
|
|
204
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"outDir": "dist",
|
|
8
|
+
"rootDir": "src",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"declarationMap": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"resolveJsonModule": true
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/**/*"],
|
|
19
|
+
"exclude": ["node_modules", "dist"]
|
|
20
|
+
}
|