@anhcodo13/lattice 0.3.0 → 0.5.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/README.md +23 -29
- package/dist/cli.js +1278 -93
- package/dist/index.d.ts +177 -0
- package/dist/index.js +767 -193
- package/governance/policy.json +52 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -30,11 +30,45 @@ interface AssessmentPolicy {
|
|
|
30
30
|
blockedRuleIds: string[];
|
|
31
31
|
analysis: AnalysisConfig;
|
|
32
32
|
};
|
|
33
|
+
evidence?: {
|
|
34
|
+
maximumAgeHours: number;
|
|
35
|
+
dependencySecurity: {
|
|
36
|
+
maximumHigh: number;
|
|
37
|
+
maximumCritical: number;
|
|
38
|
+
};
|
|
39
|
+
codeQuality: {
|
|
40
|
+
maximumLintErrors: number;
|
|
41
|
+
minimumLineCoverage: number;
|
|
42
|
+
requireTypecheck: boolean;
|
|
43
|
+
requireTests: boolean;
|
|
44
|
+
};
|
|
45
|
+
codeSecurity: {
|
|
46
|
+
maximumHigh: number;
|
|
47
|
+
maximumCritical: number;
|
|
48
|
+
maximumSecrets: number;
|
|
49
|
+
};
|
|
50
|
+
compatibility: {
|
|
51
|
+
requiredProjects: string[];
|
|
52
|
+
minimumTestsPerProject: number;
|
|
53
|
+
minimumTestedBrowserVersions?: Record<string, string>;
|
|
54
|
+
minimumEmulatedOsVersions?: Record<string, string>;
|
|
55
|
+
};
|
|
56
|
+
accessibility?: {
|
|
57
|
+
requiredProjects: string[];
|
|
58
|
+
minimumScansPerProject: number;
|
|
59
|
+
minimumChecksPerScan: number;
|
|
60
|
+
minimumAxeVersion: string;
|
|
61
|
+
maximumViolations: number;
|
|
62
|
+
maximumNeedsReview: number;
|
|
63
|
+
requiredTags: string[];
|
|
64
|
+
};
|
|
65
|
+
};
|
|
33
66
|
}
|
|
34
67
|
interface VersionPolicy {
|
|
35
68
|
schemaVersion: 2;
|
|
36
69
|
policyVersion: string;
|
|
37
70
|
profiles: Record<string, Record<string, string>>;
|
|
71
|
+
managedPackages?: Record<string, string>;
|
|
38
72
|
assessment?: AssessmentPolicy;
|
|
39
73
|
source: string;
|
|
40
74
|
sha256: string;
|
|
@@ -90,6 +124,136 @@ interface ScoreBreakdown {
|
|
|
90
124
|
}>;
|
|
91
125
|
}
|
|
92
126
|
|
|
127
|
+
type EvidenceStatus = "pass" | "fail" | "incomplete";
|
|
128
|
+
interface CompatibilityProject {
|
|
129
|
+
name: string;
|
|
130
|
+
passed: number;
|
|
131
|
+
failed: number;
|
|
132
|
+
skipped: number;
|
|
133
|
+
engine?: string;
|
|
134
|
+
mobile?: boolean;
|
|
135
|
+
browserVersion?: string;
|
|
136
|
+
device?: string;
|
|
137
|
+
emulatedOs?: string;
|
|
138
|
+
emulatedOsVersion?: string;
|
|
139
|
+
viewportWidths?: number[];
|
|
140
|
+
minimumTestedBrowserVersion?: string;
|
|
141
|
+
minimumEmulatedOsVersion?: string;
|
|
142
|
+
}
|
|
143
|
+
interface EvidenceDomain {
|
|
144
|
+
status: EvidenceStatus;
|
|
145
|
+
issues: string[];
|
|
146
|
+
tool?: string;
|
|
147
|
+
version?: string;
|
|
148
|
+
scanned?: number;
|
|
149
|
+
findings?: EvidenceFinding[];
|
|
150
|
+
metrics?: Record<string, string | number | boolean>;
|
|
151
|
+
matrix?: CompatibilityProject[];
|
|
152
|
+
routes?: Array<Pick<AccessibilityScan, "project" | "route" | "axeVersion" | "checks" | "needsReview">>;
|
|
153
|
+
}
|
|
154
|
+
interface EvidenceFinding {
|
|
155
|
+
id: string;
|
|
156
|
+
severity: string;
|
|
157
|
+
subject: string;
|
|
158
|
+
message: string;
|
|
159
|
+
remediation?: string;
|
|
160
|
+
}
|
|
161
|
+
interface AccessibilityScan {
|
|
162
|
+
project: string;
|
|
163
|
+
route: string;
|
|
164
|
+
axeVersion: string;
|
|
165
|
+
tags: string[];
|
|
166
|
+
checks: number;
|
|
167
|
+
violations: EvidenceFinding[];
|
|
168
|
+
needsReview: number;
|
|
169
|
+
}
|
|
170
|
+
interface AppScanEvidence {
|
|
171
|
+
path: string;
|
|
172
|
+
profile: string;
|
|
173
|
+
dependencySecurity: {
|
|
174
|
+
tool: string;
|
|
175
|
+
version: string;
|
|
176
|
+
complete: boolean;
|
|
177
|
+
packagesScanned: number;
|
|
178
|
+
advisories: EvidenceFinding[];
|
|
179
|
+
errors: string[];
|
|
180
|
+
};
|
|
181
|
+
codeQuality: {
|
|
182
|
+
lint: {
|
|
183
|
+
tool: string;
|
|
184
|
+
version: string;
|
|
185
|
+
complete: boolean;
|
|
186
|
+
filesScanned: number;
|
|
187
|
+
errorCount: number;
|
|
188
|
+
warnings: number;
|
|
189
|
+
errorsDetail: string[];
|
|
190
|
+
};
|
|
191
|
+
typecheck: {
|
|
192
|
+
tool: string;
|
|
193
|
+
version: string;
|
|
194
|
+
applicable?: boolean;
|
|
195
|
+
complete: boolean;
|
|
196
|
+
passed: boolean;
|
|
197
|
+
errors: string[];
|
|
198
|
+
};
|
|
199
|
+
tests: {
|
|
200
|
+
tool: string;
|
|
201
|
+
version: string;
|
|
202
|
+
complete: boolean;
|
|
203
|
+
passed: number;
|
|
204
|
+
failed: number;
|
|
205
|
+
errors: string[];
|
|
206
|
+
};
|
|
207
|
+
coverage: {
|
|
208
|
+
tool: string;
|
|
209
|
+
version: string;
|
|
210
|
+
complete: boolean;
|
|
211
|
+
linesPercent: number;
|
|
212
|
+
errors: string[];
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
codeSecurity: {
|
|
216
|
+
sast: {
|
|
217
|
+
tool: string;
|
|
218
|
+
version: string;
|
|
219
|
+
complete: boolean;
|
|
220
|
+
filesScanned: number;
|
|
221
|
+
findings: EvidenceFinding[];
|
|
222
|
+
errors: string[];
|
|
223
|
+
};
|
|
224
|
+
secrets: {
|
|
225
|
+
tool: string;
|
|
226
|
+
version: string;
|
|
227
|
+
complete: boolean;
|
|
228
|
+
filesScanned: number;
|
|
229
|
+
findings: EvidenceFinding[];
|
|
230
|
+
errors: string[];
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
compatibility: {
|
|
234
|
+
tool: string;
|
|
235
|
+
version: string;
|
|
236
|
+
complete: boolean;
|
|
237
|
+
projects: CompatibilityProject[];
|
|
238
|
+
errors: string[];
|
|
239
|
+
};
|
|
240
|
+
accessibility?: {
|
|
241
|
+
tool: string;
|
|
242
|
+
version: string;
|
|
243
|
+
complete: boolean;
|
|
244
|
+
scans: AccessibilityScan[];
|
|
245
|
+
errors: string[];
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
interface ScanEvidence {
|
|
249
|
+
schemaVersion: 1;
|
|
250
|
+
generatedAt: string;
|
|
251
|
+
policySha256: string;
|
|
252
|
+
inputSha256: string;
|
|
253
|
+
commit: string;
|
|
254
|
+
apps: AppScanEvidence[];
|
|
255
|
+
}
|
|
256
|
+
|
|
93
257
|
type Status = "pass" | "fail" | "incomplete";
|
|
94
258
|
interface Domain {
|
|
95
259
|
status: Status;
|
|
@@ -104,6 +268,12 @@ interface AssessmentReport {
|
|
|
104
268
|
source: string;
|
|
105
269
|
sha256: string;
|
|
106
270
|
};
|
|
271
|
+
evidence?: {
|
|
272
|
+
source: string;
|
|
273
|
+
generatedAt: string;
|
|
274
|
+
commit: string;
|
|
275
|
+
inputSha256: string;
|
|
276
|
+
};
|
|
107
277
|
inventory: {
|
|
108
278
|
source: string;
|
|
109
279
|
sha256?: string;
|
|
@@ -134,6 +304,11 @@ interface AssessmentReport {
|
|
|
134
304
|
findings: Finding[];
|
|
135
305
|
diagnostics: string[];
|
|
136
306
|
};
|
|
307
|
+
dependencySecurity?: EvidenceDomain;
|
|
308
|
+
codeQuality?: EvidenceDomain;
|
|
309
|
+
codeSecurity?: EvidenceDomain;
|
|
310
|
+
compatibility?: EvidenceDomain;
|
|
311
|
+
accessibility?: EvidenceDomain;
|
|
137
312
|
};
|
|
138
313
|
}>;
|
|
139
314
|
}
|
|
@@ -143,6 +318,8 @@ interface AssessOptions {
|
|
|
143
318
|
inventory?: string;
|
|
144
319
|
expectedApps?: number;
|
|
145
320
|
outputDirectory?: string;
|
|
321
|
+
evidence?: string;
|
|
322
|
+
trustedEvidence?: ScanEvidence;
|
|
146
323
|
policy: VersionPolicy;
|
|
147
324
|
}
|
|
148
325
|
declare function renderAssessmentHtml(report: AssessmentReport): string;
|