@secureport/core 2.2.0 → 2.3.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.
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/report/csv.d.ts +41 -0
- package/dist/report/csv.d.ts.map +1 -0
- package/dist/report/csv.js +158 -0
- package/dist/report/csv.js.map +1 -0
- package/dist/report/fonts.d.ts +53 -0
- package/dist/report/fonts.d.ts.map +1 -0
- package/dist/report/fonts.js +53 -0
- package/dist/report/fonts.js.map +1 -0
- package/dist/report/html.d.ts.map +1 -1
- package/dist/report/html.js +48 -13
- package/dist/report/html.js.map +1 -1
- package/dist/report/json.d.ts +15 -0
- package/dist/report/json.d.ts.map +1 -1
- package/dist/report/json.js +1 -0
- package/dist/report/json.js.map +1 -1
- package/dist/report/markdown.d.ts +33 -2
- package/dist/report/markdown.d.ts.map +1 -1
- package/dist/report/markdown.js +67 -16
- package/dist/report/markdown.js.map +1 -1
- package/dist/report/model.d.ts +108 -1
- package/dist/report/model.d.ts.map +1 -1
- package/dist/report/model.js +173 -36
- package/dist/report/model.js.map +1 -1
- package/dist/report/sarif.d.ts +60 -0
- package/dist/report/sarif.d.ts.map +1 -0
- package/dist/report/sarif.js +125 -0
- package/dist/report/sarif.js.map +1 -0
- package/dist/report/stream.d.ts +119 -0
- package/dist/report/stream.d.ts.map +1 -0
- package/dist/report/stream.js +546 -0
- package/dist/report/stream.js.map +1 -0
- package/package.json +5 -3
- package/src/index.ts +7 -1
- package/src/report/csv.ts +186 -0
- package/src/report/fonts.ts +55 -0
- package/src/report/html.ts +57 -14
- package/src/report/json.ts +17 -0
- package/src/report/markdown.ts +79 -15
- package/src/report/model.ts +242 -45
- package/src/report/sarif.ts +166 -0
- package/src/report/stream.ts +727 -0
package/dist/report/model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RunSummary } from '../run.js';
|
|
1
|
+
import type { RunKind, RunSummary } from '../run.js';
|
|
2
2
|
import type { Severity } from '../severity.js';
|
|
3
3
|
import type { Snapshot, SnapshotIssue } from '../snapshot.js';
|
|
4
4
|
/**
|
|
@@ -251,6 +251,10 @@ export interface TestingBasis {
|
|
|
251
251
|
* The issues are still open, still counted and still the target's problem;
|
|
252
252
|
* only the pages describing them are gone. That distinction is the reason this
|
|
253
253
|
* is reported at all rather than silently applied.
|
|
254
|
+
*
|
|
255
|
+
* **Never set for a `retest` report.** Its own per-issue table lists every
|
|
256
|
+
* carried issue regardless of the floor (7.9a) — a floor changes nothing a
|
|
257
|
+
* reader sees, so there is nothing to disclose.
|
|
254
258
|
*/
|
|
255
259
|
export interface OmittedIssues {
|
|
256
260
|
/** How many outstanding issues were left out. Never `0` — the field is absent instead. */
|
|
@@ -421,6 +425,108 @@ export interface RetestOutcome {
|
|
|
421
425
|
*/
|
|
422
426
|
readonly fixRate: number | null;
|
|
423
427
|
}
|
|
428
|
+
/**
|
|
429
|
+
* The verdict for one issue.
|
|
430
|
+
*
|
|
431
|
+
* Turns on whether this run produced evidence for it, not on its status alone:
|
|
432
|
+
* an issue left open because the run never covered it looks identical to one
|
|
433
|
+
* left open because the run found it again, and telling a reader those are the
|
|
434
|
+
* same thing is the failure this report exists to avoid.
|
|
435
|
+
*
|
|
436
|
+
* Exported: it is per-issue and needs nothing but the one entry, which is
|
|
437
|
+
* exactly what the streaming machine renderers can offer it a row at a time.
|
|
438
|
+
*/
|
|
439
|
+
export declare function verdictFor(entry: SnapshotIssue): RetestVerdict;
|
|
440
|
+
type TimelineEventKind = 'opened' | 'resolved' | 'returned' | 'last_seen' | 'deadline';
|
|
441
|
+
/** One moment in an issue's remediation history, worded ready to print. */
|
|
442
|
+
export interface TimelineEvent {
|
|
443
|
+
/** What kind of moment this is. */
|
|
444
|
+
readonly kind: TimelineEventKind;
|
|
445
|
+
/** When it happened, or — for `deadline` alone — when it is due. */
|
|
446
|
+
readonly at: Date;
|
|
447
|
+
/**
|
|
448
|
+
* One sentence, ready to print, so no two renderers word it differently.
|
|
449
|
+
*
|
|
450
|
+
* `deadline`'s wording follows {@link SnapshotIssue.slaStatus}, never a
|
|
451
|
+
* second comparison of `at` against `now` — `slaStatus` is already the
|
|
452
|
+
* derived answer to "is this overdue", and a fresh comparison here would be
|
|
453
|
+
* a second one free to disagree.
|
|
454
|
+
*/
|
|
455
|
+
readonly statement: string;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* An issue's remediation chronology, derived only from dates already on
|
|
459
|
+
* {@link Issue} — no `issue_events` read, no migration.
|
|
460
|
+
*
|
|
461
|
+
* Exported for the same reason {@link verdictFor} is: it is per-issue and
|
|
462
|
+
* needs nothing but the one entry, which is exactly what the streaming
|
|
463
|
+
* Markdown renderer can offer it a row at a time.
|
|
464
|
+
*
|
|
465
|
+
* **`deadline` is appended last, unconditionally — never sorted in among the
|
|
466
|
+
* other four.** Those four are things that already happened; a remediation
|
|
467
|
+
* deadline is a standing obligation, not an event, and it can be in the past
|
|
468
|
+
* (breached) or the future (within the window). Sorting it by `at` would let
|
|
469
|
+
* a breached deadline land in the middle of the chronology, worded as though
|
|
470
|
+
* it were a fact that occurred between two sightings — this function's
|
|
471
|
+
* version of the mistake `not_retested` exists to stop: reporting something
|
|
472
|
+
* that has not happened as though it had.
|
|
473
|
+
*
|
|
474
|
+
* **No `deadline` event for a resolved issue**, even one whose `slaDueAt` has
|
|
475
|
+
* passed. A deadline is a claim about outstanding remediation; printing
|
|
476
|
+
* "overdue since …" beside a `fixed` verdict would report finished work as
|
|
477
|
+
* work still owed — the same dishonesty from the other direction. None
|
|
478
|
+
* either when {@link Issue.slaDueAt} is `null` (an `advisory` under
|
|
479
|
+
* {@link DEFAULT_SLA_POLICY}), since there is no deadline to state.
|
|
480
|
+
*/
|
|
481
|
+
export declare function timelineFor(entry: SnapshotIssue): readonly TimelineEvent[];
|
|
482
|
+
/**
|
|
483
|
+
* Works out what a report cannot establish, from the run rather than a
|
|
484
|
+
* template.
|
|
485
|
+
*
|
|
486
|
+
* Takes primitives rather than a {@link Snapshot} so the streaming machine
|
|
487
|
+
* renderers can produce the same wording from a fold over a cursor, without
|
|
488
|
+
* needing the eagerly-materialised issue array this package's PDF/HTML path
|
|
489
|
+
* builds.
|
|
490
|
+
*/
|
|
491
|
+
export declare function describeLimitations(coveragePaths: readonly string[], runCreatedAt: Date, basis: TestingBasis, suppressedCount: number, omitted: OmittedIssues | undefined): string[];
|
|
492
|
+
/**
|
|
493
|
+
* Why this branding cannot be rendered, or `undefined` if it can.
|
|
494
|
+
*
|
|
495
|
+
* **Exported so the rules have one home rather than two.** {@link buildReportModel}
|
|
496
|
+
* enforces these at render time, which is the last possible moment — by then the
|
|
497
|
+
* value has been stored, and the caller who set it is long gone. A hosted
|
|
498
|
+
* service wants to refuse it at the boundary instead, with a `400` naming the
|
|
499
|
+
* field. That needs the same two rules in two places, and a colour pattern
|
|
500
|
+
* copied into an API schema is a copy free to drift from the one that actually
|
|
501
|
+
* protects the stylesheet.
|
|
502
|
+
*
|
|
503
|
+
* So both callers ask this. The messages are identical wherever the value is
|
|
504
|
+
* rejected, because there is only one place that composes them.
|
|
505
|
+
*
|
|
506
|
+
* The white-label rule is deliberately **not** here: it depends on the report
|
|
507
|
+
* kind and on `preparedBy`, so it is a property of the options rather than of
|
|
508
|
+
* the branding, and only the renderer can decide it.
|
|
509
|
+
*/
|
|
510
|
+
export declare function brandingProblem(branding: Branding | undefined): string | undefined;
|
|
511
|
+
/**
|
|
512
|
+
* Who the document says carried out the testing, resolved once so the PDF/HTML
|
|
513
|
+
* path and the streaming machine path cannot word it two different ways.
|
|
514
|
+
*
|
|
515
|
+
* @throws TypeError A white-labelled attestation naming nobody: a formal
|
|
516
|
+
* statement that testing was carried out has to say who carried it out.
|
|
517
|
+
*/
|
|
518
|
+
export declare function resolveAttestor(options: Pick<ReportOptions, 'kind' | 'preparedBy' | 'branding'>): string;
|
|
519
|
+
/** The title printed when {@link ReportOptions.title} is not given. */
|
|
520
|
+
export declare const DEFAULT_TITLES: Readonly<Record<ReportKind, string>>;
|
|
521
|
+
/**
|
|
522
|
+
* Works out how the findings were produced, from the run rather than a claim.
|
|
523
|
+
*
|
|
524
|
+
* Takes `kind`/`engines`/`includesManual` as primitives, the same reason
|
|
525
|
+
* {@link describeLimitations} does: the streaming machine renderers know
|
|
526
|
+
* `includesManual` only once a fold over the issue cursor finishes, and have
|
|
527
|
+
* no `Snapshot` to read `run.kind`/`run.engines` from.
|
|
528
|
+
*/
|
|
529
|
+
export declare function describeBasis(kind: RunKind, engines: readonly string[], includesManual: boolean): TestingBasis;
|
|
424
530
|
/**
|
|
425
531
|
* Derives everything a report shows, once, from a snapshot.
|
|
426
532
|
*
|
|
@@ -438,4 +544,5 @@ export interface RetestOutcome {
|
|
|
438
544
|
* @returns The model both renderers format.
|
|
439
545
|
*/
|
|
440
546
|
export declare function buildReportModel(snapshot: Snapshot, options: ReportOptions): ReportModel;
|
|
547
|
+
export {};
|
|
441
548
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/report/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/report/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtE,4EAA4E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AmB,CACjC,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,YAAY,EAAE,IAAI,EAClB,KAAK,EAAE,YAAY,EACnB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,aAAa,GAAG,SAAS,GACjC,MAAM,EAAE,CA0CV;AAQD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAmBlF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC,GAC/D,MAAM,CAgBR;AAED,uEAAuE;AACvE,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAM9D,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,cAAc,EAAE,OAAO,GACtB,YAAY,CA8Bd;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,GAAG,WAAW,CAkIxF"}
|
package/dist/report/model.js
CHANGED
|
@@ -60,8 +60,11 @@ function describeRetest(snapshot) {
|
|
|
60
60
|
* an issue left open because the run never covered it looks identical to one
|
|
61
61
|
* left open because the run found it again, and telling a reader those are the
|
|
62
62
|
* same thing is the failure this report exists to avoid.
|
|
63
|
+
*
|
|
64
|
+
* Exported: it is per-issue and needs nothing but the one entry, which is
|
|
65
|
+
* exactly what the streaming machine renderers can offer it a row at a time.
|
|
63
66
|
*/
|
|
64
|
-
function verdictFor(entry) {
|
|
67
|
+
export function verdictFor(entry) {
|
|
65
68
|
if (entry.change === 'resolved')
|
|
66
69
|
return 'fixed';
|
|
67
70
|
if (entry.change === 'regressed')
|
|
@@ -70,8 +73,95 @@ function verdictFor(entry) {
|
|
|
70
73
|
return 'new';
|
|
71
74
|
return entry.findings.length > 0 ? 'still_present' : 'not_retested';
|
|
72
75
|
}
|
|
73
|
-
/**
|
|
74
|
-
|
|
76
|
+
/**
|
|
77
|
+
* An issue's remediation chronology, derived only from dates already on
|
|
78
|
+
* {@link Issue} — no `issue_events` read, no migration.
|
|
79
|
+
*
|
|
80
|
+
* Exported for the same reason {@link verdictFor} is: it is per-issue and
|
|
81
|
+
* needs nothing but the one entry, which is exactly what the streaming
|
|
82
|
+
* Markdown renderer can offer it a row at a time.
|
|
83
|
+
*
|
|
84
|
+
* **`deadline` is appended last, unconditionally — never sorted in among the
|
|
85
|
+
* other four.** Those four are things that already happened; a remediation
|
|
86
|
+
* deadline is a standing obligation, not an event, and it can be in the past
|
|
87
|
+
* (breached) or the future (within the window). Sorting it by `at` would let
|
|
88
|
+
* a breached deadline land in the middle of the chronology, worded as though
|
|
89
|
+
* it were a fact that occurred between two sightings — this function's
|
|
90
|
+
* version of the mistake `not_retested` exists to stop: reporting something
|
|
91
|
+
* that has not happened as though it had.
|
|
92
|
+
*
|
|
93
|
+
* **No `deadline` event for a resolved issue**, even one whose `slaDueAt` has
|
|
94
|
+
* passed. A deadline is a claim about outstanding remediation; printing
|
|
95
|
+
* "overdue since …" beside a `fixed` verdict would report finished work as
|
|
96
|
+
* work still owed — the same dishonesty from the other direction. None
|
|
97
|
+
* either when {@link Issue.slaDueAt} is `null` (an `advisory` under
|
|
98
|
+
* {@link DEFAULT_SLA_POLICY}), since there is no deadline to state.
|
|
99
|
+
*/
|
|
100
|
+
export function timelineFor(entry) {
|
|
101
|
+
const { issue } = entry;
|
|
102
|
+
const events = [
|
|
103
|
+
{
|
|
104
|
+
kind: 'opened',
|
|
105
|
+
at: issue.firstSeen,
|
|
106
|
+
statement: `opened ${formatIsoDate(issue.firstSeen)} (${entry.daysOpen} days)`,
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
if (issue.resolvedAt !== undefined) {
|
|
110
|
+
events.push({
|
|
111
|
+
kind: 'resolved',
|
|
112
|
+
at: issue.resolvedAt,
|
|
113
|
+
statement: `resolved ${formatIsoDate(issue.resolvedAt)}`,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (issue.reopenedAt !== undefined) {
|
|
117
|
+
events.push({
|
|
118
|
+
kind: 'returned',
|
|
119
|
+
at: issue.reopenedAt,
|
|
120
|
+
statement: `returned ${formatIsoDate(issue.reopenedAt)}`,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
// Deduplicated by exact timestamp: `reconcile()` sets `firstSeen` and
|
|
124
|
+
// `lastSeen` to the same instant when it creates an issue, and an issue
|
|
125
|
+
// that regressed this run has `reopenedAt === lastSeen` — without this
|
|
126
|
+
// check the same moment would print twice under two different names.
|
|
127
|
+
if (!events.some((e) => e.at.getTime() === issue.lastSeen.getTime())) {
|
|
128
|
+
events.push({
|
|
129
|
+
kind: 'last_seen',
|
|
130
|
+
at: issue.lastSeen,
|
|
131
|
+
statement: `last seen ${formatIsoDate(issue.lastSeen)}`,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
// Sorted, not pushed in field-declaration order: `lastSeen` is the last
|
|
135
|
+
// time the issue was *detected*, which for a resolved issue predates
|
|
136
|
+
// `resolvedAt` — the date reconciliation stopped seeing it and started
|
|
137
|
+
// counting misses, not the date it stopped existing. Pushing in the order
|
|
138
|
+
// above would print "resolved … last seen …" backwards.
|
|
139
|
+
events.sort((a, b) => a.at.getTime() - b.at.getTime());
|
|
140
|
+
if (issue.slaDueAt !== null && issue.status !== 'resolved') {
|
|
141
|
+
const due = formatIsoDate(issue.slaDueAt);
|
|
142
|
+
const statement = entry.slaStatus === 'breached'
|
|
143
|
+
? `overdue since ${due}`
|
|
144
|
+
: entry.slaStatus === 'due_soon'
|
|
145
|
+
? `due ${due} (due soon)`
|
|
146
|
+
: `due ${due}`;
|
|
147
|
+
events.push({ kind: 'deadline', at: issue.slaDueAt, statement });
|
|
148
|
+
}
|
|
149
|
+
return events;
|
|
150
|
+
}
|
|
151
|
+
/** A date, printed the same way everywhere in this module. */
|
|
152
|
+
function formatIsoDate(date) {
|
|
153
|
+
return date.toISOString().slice(0, 10);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Works out what a report cannot establish, from the run rather than a
|
|
157
|
+
* template.
|
|
158
|
+
*
|
|
159
|
+
* Takes primitives rather than a {@link Snapshot} so the streaming machine
|
|
160
|
+
* renderers can produce the same wording from a fold over a cursor, without
|
|
161
|
+
* needing the eagerly-materialised issue array this package's PDF/HTML path
|
|
162
|
+
* builds.
|
|
163
|
+
*/
|
|
164
|
+
export function describeLimitations(coveragePaths, runCreatedAt, basis, suppressedCount, omitted) {
|
|
75
165
|
const limitations = [];
|
|
76
166
|
if (!basis.includesManual) {
|
|
77
167
|
limitations.push('This is evidence of automated security testing. It is not a human-led penetration ' +
|
|
@@ -79,15 +169,15 @@ function describeLimitations(snapshot, basis, omitted) {
|
|
|
79
169
|
}
|
|
80
170
|
limitations.push('Findings should be verified by a qualified technician before this document is relied ' +
|
|
81
171
|
'upon as audit evidence.');
|
|
82
|
-
limitations.push(`Testing covered only ${
|
|
172
|
+
limitations.push(`Testing covered only ${coveragePaths.join(', ')}. Anything outside that ` +
|
|
83
173
|
'was not examined, and its absence from this document is not evidence that it is sound.');
|
|
84
|
-
limitations.push(`This reflects the state of the target as of ${
|
|
174
|
+
limitations.push(`This reflects the state of the target as of ${runCreatedAt
|
|
85
175
|
.toISOString()
|
|
86
176
|
.slice(0, 10)}. It says nothing about the target before or after that date.`);
|
|
87
177
|
limitations.push('Automated testing cannot establish the absence of a vulnerability. A clean result means ' +
|
|
88
178
|
'nothing was detected, not that nothing is there.');
|
|
89
|
-
if (
|
|
90
|
-
limitations.push(`${
|
|
179
|
+
if (suppressedCount > 0) {
|
|
180
|
+
limitations.push(`${suppressedCount} finding${suppressedCount === 1 ? ' has' : 's have'} been ` +
|
|
91
181
|
'suppressed and excluded from the counts above. They are listed in full in the appendix.');
|
|
92
182
|
}
|
|
93
183
|
// Immediately after the suppression sentence and before the compliance one,
|
|
@@ -104,18 +194,75 @@ function describeLimitations(snapshot, basis, omitted) {
|
|
|
104
194
|
* refusal rather than a sanitisation.
|
|
105
195
|
*/
|
|
106
196
|
const HEX_COLOUR = /^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/iu;
|
|
107
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Why this branding cannot be rendered, or `undefined` if it can.
|
|
199
|
+
*
|
|
200
|
+
* **Exported so the rules have one home rather than two.** {@link buildReportModel}
|
|
201
|
+
* enforces these at render time, which is the last possible moment — by then the
|
|
202
|
+
* value has been stored, and the caller who set it is long gone. A hosted
|
|
203
|
+
* service wants to refuse it at the boundary instead, with a `400` naming the
|
|
204
|
+
* field. That needs the same two rules in two places, and a colour pattern
|
|
205
|
+
* copied into an API schema is a copy free to drift from the one that actually
|
|
206
|
+
* protects the stylesheet.
|
|
207
|
+
*
|
|
208
|
+
* So both callers ask this. The messages are identical wherever the value is
|
|
209
|
+
* rejected, because there is only one place that composes them.
|
|
210
|
+
*
|
|
211
|
+
* The white-label rule is deliberately **not** here: it depends on the report
|
|
212
|
+
* kind and on `preparedBy`, so it is a property of the options rather than of
|
|
213
|
+
* the branding, and only the renderer can decide it.
|
|
214
|
+
*/
|
|
215
|
+
export function brandingProblem(branding) {
|
|
216
|
+
const colour = branding?.primaryColour;
|
|
217
|
+
if (colour !== undefined && !HEX_COLOUR.test(colour)) {
|
|
218
|
+
return (`primaryColour must be a hex triplet such as #0a7 or #00aa77, not ${JSON.stringify(colour)}: ` +
|
|
219
|
+
'it is interpolated into the document stylesheet, where anything else could end the element');
|
|
220
|
+
}
|
|
221
|
+
const logo = branding?.logo;
|
|
222
|
+
if (logo !== undefined && !logo.startsWith('data:image/')) {
|
|
223
|
+
return (`logo must be a data: URI, not ${JSON.stringify(logo.slice(0, 40))}: ` +
|
|
224
|
+
'a linked image would make the report depend on a network at render time, ' +
|
|
225
|
+
'which is the guarantee that lets it be rendered to PDF reproducibly');
|
|
226
|
+
}
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Who the document says carried out the testing, resolved once so the PDF/HTML
|
|
231
|
+
* path and the streaming machine path cannot word it two different ways.
|
|
232
|
+
*
|
|
233
|
+
* @throws TypeError A white-labelled attestation naming nobody: a formal
|
|
234
|
+
* statement that testing was carried out has to say who carried it out.
|
|
235
|
+
*/
|
|
236
|
+
export function resolveAttestor(options) {
|
|
237
|
+
const attestor = options.preparedBy ?? options.branding?.companyName;
|
|
238
|
+
// An attestation is a statement that a named party carried out testing. With
|
|
239
|
+
// Secureport's name removed and nothing put in its place there is no such
|
|
240
|
+
// party, and the document would assert something on nobody's behalf.
|
|
241
|
+
if (attestor === undefined &&
|
|
242
|
+
options.branding?.whiteLabel === true &&
|
|
243
|
+
options.kind === 'attest') {
|
|
244
|
+
throw new TypeError('a white-labelled attestation must name who carried out the testing: ' +
|
|
245
|
+
'set branding.companyName or preparedBy');
|
|
246
|
+
}
|
|
247
|
+
return attestor ?? 'Secureport';
|
|
248
|
+
}
|
|
249
|
+
/** The title printed when {@link ReportOptions.title} is not given. */
|
|
250
|
+
export const DEFAULT_TITLES = Object.freeze({
|
|
108
251
|
pen: 'Penetration Test Report',
|
|
109
252
|
vap: 'Vulnerability Assessment Report',
|
|
110
253
|
exec: 'Executive Summary',
|
|
111
254
|
attest: 'Attestation of Security Testing',
|
|
112
255
|
retest: 'Retest Report',
|
|
113
256
|
});
|
|
114
|
-
/**
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
257
|
+
/**
|
|
258
|
+
* Works out how the findings were produced, from the run rather than a claim.
|
|
259
|
+
*
|
|
260
|
+
* Takes `kind`/`engines`/`includesManual` as primitives, the same reason
|
|
261
|
+
* {@link describeLimitations} does: the streaming machine renderers know
|
|
262
|
+
* `includesManual` only once a fold over the issue cursor finishes, and have
|
|
263
|
+
* no `Snapshot` to read `run.kind`/`run.engines` from.
|
|
264
|
+
*/
|
|
265
|
+
export function describeBasis(kind, engines, includesManual) {
|
|
119
266
|
const automated = kind === 'scan';
|
|
120
267
|
const uploaded = kind === 'upload';
|
|
121
268
|
const parts = [];
|
|
@@ -188,7 +335,12 @@ export function buildReportModel(snapshot, options) {
|
|
|
188
335
|
breached++;
|
|
189
336
|
}
|
|
190
337
|
if (SEVERITY_ORDER.indexOf(severity) > floorAt) {
|
|
191
|
-
|
|
338
|
+
// B208: `retest`'s own table lists every carried issue regardless of
|
|
339
|
+
// the floor (7.9a) — nothing is actually left out of the document for
|
|
340
|
+
// this kind, so counting it here would make `limitations` state an
|
|
341
|
+
// omission the very next section contradicts.
|
|
342
|
+
if (options.kind !== 'retest')
|
|
343
|
+
omittedBelowFloor++;
|
|
192
344
|
continue;
|
|
193
345
|
}
|
|
194
346
|
const group = bySeverity.get(severity);
|
|
@@ -222,7 +374,7 @@ export function buildReportModel(snapshot, options) {
|
|
|
222
374
|
`${omittedBelowFloor === 1 ? 'is' : 'are'} included in every count above.`,
|
|
223
375
|
};
|
|
224
376
|
const outstandingTotal = SEVERITY_ORDER.reduce((sum, s) => sum + outstanding[s], 0);
|
|
225
|
-
const basis = describeBasis(snapshot);
|
|
377
|
+
const basis = describeBasis(snapshot.run.kind, snapshot.run.engines, snapshot.issues.some((i) => i.issue.origin === 'manual'));
|
|
226
378
|
const retest = describeRetest(snapshot);
|
|
227
379
|
// Rendering a retest of nothing is the over-claim §7 warns about: the
|
|
228
380
|
// document's whole content is a comparison, and one run does not have one.
|
|
@@ -230,25 +382,10 @@ export function buildReportModel(snapshot, options) {
|
|
|
230
382
|
throw new TypeError('a retest report needs a baseline: build the snapshot with `previous` set to the run being retested');
|
|
231
383
|
}
|
|
232
384
|
const branding = options.branding;
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
throw new TypeError(
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
const logo = branding?.logo;
|
|
239
|
-
if (logo !== undefined && !logo.startsWith('data:image/')) {
|
|
240
|
-
throw new TypeError(`logo must be a data: URI, not ${JSON.stringify(logo.slice(0, 40))}: ` +
|
|
241
|
-
'a linked image would make the report depend on a network at render time, ' +
|
|
242
|
-
'which is the guarantee that lets it be rendered to PDF reproducibly');
|
|
243
|
-
}
|
|
244
|
-
const attestor = options.preparedBy ?? branding?.companyName;
|
|
245
|
-
// An attestation is a statement that a named party carried out testing. With
|
|
246
|
-
// Secureport's name removed and nothing put in its place there is no such
|
|
247
|
-
// party, and the document would assert something on nobody's behalf.
|
|
248
|
-
if (attestor === undefined && branding?.whiteLabel === true && options.kind === 'attest') {
|
|
249
|
-
throw new TypeError('a white-labelled attestation must name who carried out the testing: ' +
|
|
250
|
-
'set branding.companyName or preparedBy');
|
|
251
|
-
}
|
|
385
|
+
const problem = brandingProblem(branding);
|
|
386
|
+
if (problem !== undefined)
|
|
387
|
+
throw new TypeError(problem);
|
|
388
|
+
const attestor = resolveAttestor(options);
|
|
252
389
|
return {
|
|
253
390
|
kind: options.kind,
|
|
254
391
|
title: options.title ?? DEFAULT_TITLES[options.kind],
|
|
@@ -256,13 +393,13 @@ export function buildReportModel(snapshot, options) {
|
|
|
256
393
|
generatedAt: options.now,
|
|
257
394
|
...(options.preparedBy === undefined ? {} : { preparedBy: options.preparedBy }),
|
|
258
395
|
...(options.preparedFor === undefined ? {} : { preparedFor: options.preparedFor }),
|
|
259
|
-
attestor
|
|
396
|
+
attestor,
|
|
260
397
|
coverPage: options.coverPage === true,
|
|
261
398
|
tableOfContents: options.tableOfContents === true,
|
|
262
399
|
...(branding === undefined ? {} : { branding }),
|
|
263
400
|
basis,
|
|
264
401
|
evidenceVerbosity: options.evidenceVerbosity ?? 'summary',
|
|
265
|
-
limitations: describeLimitations(snapshot, basis, omitted),
|
|
402
|
+
limitations: describeLimitations(snapshot.run.coverage.paths, snapshot.run.createdAt, basis, snapshot.suppressed.length, omitted),
|
|
266
403
|
sections,
|
|
267
404
|
resolved: options.includeResolved === false ? [] : resolved,
|
|
268
405
|
...(omitted === undefined ? {} : { omitted }),
|
package/dist/report/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/report/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAgbhD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAA4C,MAAM,CAAC,MAAM,CAAC;IACnF,KAAK,EAAE,OAAO;IACd,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;IAC5B,GAAG,EAAE,WAAW;CACjB,CAAC,CAAC;AAuCH,yEAAyE;AACzE,SAAS,cAAc,CAAC,QAAkB;IACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IAC9B,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAE7C,MAAM,OAAO,GAAkB,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7D,KAAK;QACL,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;KAC3B,CAAC,CAAC,CAAC;IACJ,2EAA2E;IAC3E,0EAA0E;IAC1E,4EAA4E;IAC5E,qDAAqD;IACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACpB,MAAM,UAAU,GACd,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC;YACvD,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC1D,OAAO,UAAU,KAAK,CAAC;YACrB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CA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C;QAC/E,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;QAClF,QAAQ;QACR,SAAS,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI;QACrC,eAAe,EAAE,OAAO,CAAC,eAAe,KAAK,IAAI;QACjD,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC/C,KAAK;QACL,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,SAAS;QACzD,WAAW,EAAE,mBAAmB,CAC9B,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAC3B,QAAQ,CAAC,GAAG,CAAC,SAAS,EACtB,KAAK,EACL,QAAQ,CAAC,UAAU,CAAC,MAAM,EAC1B,OAAO,CACR;QACD,QAAQ;QACR,QAAQ,EAAE,OAAO,CAAC,eAAe,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;QAC3D,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;QAC7C,WAAW;QACX,gBAAgB;QAChB,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,aAAa;QACzC,QAAQ;QACR,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Severity } from '../severity.js';
|
|
2
|
+
import type { SnapshotIssue } from '../snapshot.js';
|
|
3
|
+
import type { ReportHeader } from './stream.js';
|
|
4
|
+
/**
|
|
5
|
+
* What a SARIF export can be asked for.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately its own type rather than {@link ReportOptions}: SARIF has no
|
|
8
|
+
* `kind` — it is always "the issues open right now", never a retest or an
|
|
9
|
+
* attestation — and no branding, cover page or evidence verbosity. Accepting
|
|
10
|
+
* `ReportOptions` and silently ignoring most of its fields would be a worse
|
|
11
|
+
* API than a type that only offers what SARIF actually uses.
|
|
12
|
+
*/
|
|
13
|
+
export interface SarifOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Keep issues below this severity out of `results`.
|
|
16
|
+
*
|
|
17
|
+
* Unlike the other formats, there is no `omitted` count to report: SARIF
|
|
18
|
+
* has no prose to carry a disclosure sentence in, and a consumer asking
|
|
19
|
+
* for `critical` only is asking to scope a code-scanning feed, not
|
|
20
|
+
* reading a document that owes it an explanation of what it left out.
|
|
21
|
+
*/
|
|
22
|
+
readonly severityFloor?: Severity;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Renders a snapshot's open issues as SARIF 2.1.0, from a header and a
|
|
26
|
+
* cursor — the machine path's format for GitHub code scanning (P8), and the
|
|
27
|
+
* streaming sibling of {@link renderJsonStream} and
|
|
28
|
+
* {@link renderMarkdownStream}. See {@link renderJsonStream} for the memory
|
|
29
|
+
* argument.
|
|
30
|
+
*
|
|
31
|
+
* **Resolved issues never appear, unconditionally — there is no
|
|
32
|
+
* `includeResolved` option.** SARIF is not a document a person reads; it is
|
|
33
|
+
* the input to GitHub's own diffing, which closes an alert when a new
|
|
34
|
+
* upload no longer contains it. Including a resolved issue would tell
|
|
35
|
+
* GitHub the finding is still open, which is the opposite of what resolving
|
|
36
|
+
* it meant.
|
|
37
|
+
*
|
|
38
|
+
* **Suppressed issues never appear either, and take no `suppressed`
|
|
39
|
+
* parameter at all.** An accepted risk is not a code-scanning alert; SARIF
|
|
40
|
+
* has no accepted-risk register to carry it in the way the appendix does
|
|
41
|
+
* for the human and other machine formats.
|
|
42
|
+
*
|
|
43
|
+
* **`ruleId` is `Issue.vulnKey`, not `Finding.sourceRuleId` or
|
|
44
|
+
* `sourceEngine`.** `vulnKey` is engine-independent by construction
|
|
45
|
+
* (`fingerprint.ts`), and naming a scanner in a customer-facing artefact is
|
|
46
|
+
* the thing this package's report options have twice had to stop doing
|
|
47
|
+
* (`ReportOptions.evidenceVerbosity`'s own TSDoc records it). `rules[]` is
|
|
48
|
+
* built from the same stream, deduplicated on `vulnKey` — bounded by the
|
|
49
|
+
* number of distinct weakness classes, not by issue count, so buffering it
|
|
50
|
+
* (unlike `results`) costs nothing worth avoiding.
|
|
51
|
+
*
|
|
52
|
+
* @param header - The run and the target. Never scales with issue count.
|
|
53
|
+
* @param issues - Every open issue, in any order — SARIF results are an
|
|
54
|
+
* unordered set, so this format is the one place in the streaming
|
|
55
|
+
* contract with no ordering requirement on its input.
|
|
56
|
+
* @param options - A severity floor, and nothing else.
|
|
57
|
+
* @returns Chunks of JSON text; concatenated, they are one SARIF document.
|
|
58
|
+
*/
|
|
59
|
+
export declare function renderSarifStream(header: ReportHeader, issues: AsyncIterable<SnapshotIssue>, options?: SarifOptions): AsyncGenerator<string>;
|
|
60
|
+
//# sourceMappingURL=sarif.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sarif.d.ts","sourceRoot":"","sources":["../../src/report/sarif.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC;CACnC;AAyCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAuB,iBAAiB,CACtC,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,EACpC,OAAO,GAAE,YAAiB,GACzB,cAAc,CAAC,MAAM,CAAC,CA8DxB"}
|