@cclabsnz/sf-audit 1.24.1 → 1.25.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/CHANGELOG.md +46 -0
- package/README.md +38 -21
- package/lib/checks/domains.d.ts +11 -0
- package/lib/checks/domains.js +155 -0
- package/lib/renderers/ClientReportRenderer.js +3 -27
- package/lib/renderers/HtmlRenderer.d.ts +6 -0
- package/lib/renderers/HtmlRenderer.js +670 -382
- package/lib/report/ActionPlan.d.ts +23 -0
- package/lib/report/ActionPlan.js +37 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,52 @@ published note and carries the signed provenance attestation and CycloneDX SBOM
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [v1.25.1](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.25.1) — 2026-11-11
|
|
13
|
+
|
|
14
|
+
Documentation only. No change to checks, scores or reports.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **The README shows the report on its first screen**: a screenshot of a sample technical report,
|
|
19
|
+
linked to the full [technical](https://www.softwareinsights.dev/samples/sf-audit/sample-report.html)
|
|
20
|
+
and [executive](https://www.softwareinsights.dev/samples/sf-audit/sample-executive-report.html)
|
|
21
|
+
samples, and the install and run commands. The npm page shows the README as it was at publish,
|
|
22
|
+
so this release carries it there. (#206)
|
|
23
|
+
- The incident evidence-bundle spec is agreed, with resume and the staging sweep deferred. (#210)
|
|
24
|
+
|
|
25
|
+
## [v1.25.0](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.25.0) — 2026-11-10
|
|
26
|
+
|
|
27
|
+
The technical HTML report is redesigned. It now uses the executive report's white consulting look
|
|
28
|
+
and reads in the order an admin works: what to fix first, how an attacker would get in, where each
|
|
29
|
+
area of the org stands, and every result in one table.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- **`--format html` is on white**, in the executive report's palette and fonts. The dark theme is
|
|
34
|
+
gone. Severity is shown by tag style and text as well as colour, so the report works printed or
|
|
35
|
+
in greyscale.
|
|
36
|
+
- **One verdict band at the top**: the grade, score, why it got that grade and evidence coverage,
|
|
37
|
+
next to the open-finding total with one severity bar and four counts. This replaces the score
|
|
38
|
+
ring, donut and KPI strip, which repeated the same numbers.
|
|
39
|
+
- **Fix first**: the report opens on the executive report's action plan and headline. Each action
|
|
40
|
+
lists the findings it closes and the attack chains it breaks or is part of.
|
|
41
|
+
- **Attack paths** collapse to one line each (severity, C1/P1 label as in the executive report,
|
|
42
|
+
title, where to break it). Steps, the diagram and the fix open on demand.
|
|
43
|
+
- **By domain**: a scorecard row for each of the ten domains in docs/CHECKS.md, worst first, then
|
|
44
|
+
each domain's findings by severity with passed checks folded away. A domain with checks that could
|
|
45
|
+
not be assessed is marked "partly unseen", never "clear".
|
|
46
|
+
- **All results**: one table that can be regrouped by severity, domain, attack chain or framework,
|
|
47
|
+
and searched. Passed checks are hidden until asked for.
|
|
48
|
+
- Each finding is drawn once, with a stable link (`#f-<id>`) for tickets; the plan, attack paths
|
|
49
|
+
and table link to it.
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- `domainOf` / `DOMAINS` (src/checks/domains.ts): the domain each check belongs to, kept in step
|
|
54
|
+
with docs/CHECKS.md by a test.
|
|
55
|
+
- `planHeadline` and the plan's effort and wave labels are shared by the executive and HTML reports,
|
|
56
|
+
so both state the same answer.
|
|
57
|
+
|
|
12
58
|
## [v1.24.1](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.24.1) — 2026-11-01
|
|
13
59
|
|
|
14
60
|
The threat model reads as the threats it found. Inventory lines no longer sit in the STRIDE view as
|
package/README.md
CHANGED
|
@@ -5,26 +5,35 @@
|
|
|
5
5
|
# @cclabsnz/sf-audit
|
|
6
6
|
|
|
7
7
|
[](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/ci.yml)
|
|
8
|
-
[](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/codeql.yml)
|
|
9
|
-
[](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/semgrep.yml)
|
|
10
|
-
[](https://securityscorecards.dev/viewer/?uri=github.com/cclabsnz/sf-audit-plugin)
|
|
11
|
-
[](https://www.bestpractices.dev/projects/14149)
|
|
12
8
|
[](https://www.npmjs.com/package/@cclabsnz/sf-audit)
|
|
13
|
-
[](https://securityscorecards.dev/viewer/?uri=github.com/cclabsnz/sf-audit-plugin)
|
|
14
10
|
[](LICENSE)
|
|
15
11
|
|
|
16
|
-
A
|
|
12
|
+
A read-only security audit for any Salesforce org, run from the Salesforce CLI (`sf`): 109 checks, an
|
|
13
|
+
A–F grade, and a report your security team (or your client's) can act on.
|
|
14
|
+
|
|
15
|
+
<a href="https://www.softwareinsights.dev/samples/sf-audit/sample-report.html"><img src="https://www.softwareinsights.dev/samples/sf-audit/sample-report.png" width="720" alt="sf-audit HTML report for a fictional org: grade F at 77 out of 100 and why, 42 open findings by severity, and user, code, integration and governance metrics" /></a>
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
*A sample report from a fictional org, produced by the real checks against synthetic data. Open the
|
|
18
|
+
full [technical report](https://www.softwareinsights.dev/samples/sf-audit/sample-report.html) or the
|
|
19
|
+
[executive report](https://www.softwareinsights.dev/samples/sf-audit/sample-executive-report.html).*
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
sf plugins install @cclabsnz/sf-audit # warns that it is unsigned: answer y (see Installation)
|
|
23
|
+
sf audit security --target-org <orgAlias>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
That writes an HTML report to the current directory. **Safe to run against production:** it only
|
|
27
|
+
uses SOQL, Tooling/REST GETs and Metadata API reads, and a test fails the build if a write call
|
|
28
|
+
appears in the source ([PERMISSIONS.md](PERMISSIONS.md), [Trust & verification](#trust--verification)).
|
|
29
|
+
|
|
30
|
+
- **Checks:** identity, access, data, guest exposure, integrations, code, monitoring and Agentforce. See [What It Checks](#what-it-checks)
|
|
31
|
+
- **Attack chains:** findings linked into multi-step attack scenarios: nineteen named chains, plus a pass for combinations nobody has named yet
|
|
32
|
+
- **Compliance:** every finding mapped to 10 frameworks, including SOC 2, ISO/IEC 27001, OWASP, NZISM, HIPAA and GDPR
|
|
33
|
+
- **CI:** `--format sarif` for GitHub code scanning, `--fail-on` to gate a pipeline, and expiring [risk waivers](#accepting-a-risk)
|
|
34
|
+
|
|
35
|
+
The plugin also has commands to capture the free daily event logs, check connected apps for least
|
|
36
|
+
privilege, and investigate guest-user anomalies. See [Other commands](#other-commands).
|
|
28
37
|
|
|
29
38
|
## Installation
|
|
30
39
|
|
|
@@ -133,7 +142,9 @@ Every flag, more examples, and what the executive report contains:
|
|
|
133
142
|
## What It Checks
|
|
134
143
|
|
|
135
144
|
**109 read-only checks** across ten domains. Every finding is risk-rated CRITICAL → INFO, mapped to
|
|
136
|
-
compliance controls, and correlated into [attack chains](#attack-chains).
|
|
145
|
+
compliance controls, and correlated into [attack chains](#attack-chains). Coverage includes Data
|
|
146
|
+
Cloud and Shield, inbound email handlers and package install handlers, and Apex findings say which
|
|
147
|
+
control a class bypasses: record sharing, or CRUD/FLS.
|
|
137
148
|
|
|
138
149
|
| Domain | Checks |
|
|
139
150
|
|--------|-------:|
|
|
@@ -194,7 +205,7 @@ All nineteen with severities and trigger conditions: **[docs/ATTACK-CHAINS.md](d
|
|
|
194
205
|
|
|
195
206
|
## Scope & Liability
|
|
196
207
|
|
|
197
|
-
**What this tool is.** A read-only, point-in-time configuration review. Every check uses standard Salesforce SOQL, Tooling, and REST **GET** queries only: the tool performs no DML, no metadata deployments, and never modifies the target org or its data. It runs under the permissions of the authenticated `sf` user; checks that the user cannot access are reported as *inconclusive* rather than passing silently.
|
|
208
|
+
**What this tool is.** A read-only, point-in-time configuration review. Every check uses standard Salesforce SOQL, Tooling, and REST **GET** queries and Metadata API reads only: the tool performs no DML, no metadata deployments, and never modifies the target org or its data. It runs under the permissions of the authenticated `sf` user; checks that the user cannot access are reported as *inconclusive* rather than passing silently.
|
|
198
209
|
|
|
199
210
|
**What this tool is not.** It is **not** a penetration test, a dynamic/runtime security test, or a source-code audit of managed-package internals. It does not exploit vulnerabilities, attempt privilege escalation, or guarantee detection of every misconfiguration. The Health Score and A–F grade are **prioritisation aids**, not certifications, and do not represent compliance with, or accreditation under, any standard (OWASP, SOC 2, ISO 27001, HIPAA, GDPR, or otherwise). Compliance-framework tags indicate *relevance* to a control area only.
|
|
200
211
|
|
|
@@ -210,6 +221,11 @@ All nineteen with severities and trigger conditions: **[docs/ATTACK-CHAINS.md](d
|
|
|
210
221
|
Because this tool authenticates against production orgs, "is it safe to run?" deserves a verifiable
|
|
211
222
|
answer rather than a claim. Every guarantee below is something you can check yourself:
|
|
212
223
|
|
|
224
|
+
[](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/codeql.yml)
|
|
225
|
+
[](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/semgrep.yml)
|
|
226
|
+
[](https://www.bestpractices.dev/projects/14149)
|
|
227
|
+
[](https://www.npmjs.com/package/@cclabsnz/sf-audit#provenance)
|
|
228
|
+
|
|
213
229
|
- **Read-only, enforced in CI** — a test statically fails the build if any write path appears in the source
|
|
214
230
|
- **No network egress** — enforced the same way; reports are fully self-contained (fonts and Chart.js inlined)
|
|
215
231
|
- **Signed provenance** — released from CI via npm trusted publishing (OIDC); `npm audit signatures` verifies the tarball against the public commit
|
|
@@ -287,7 +303,7 @@ Beyond the audit itself, the plugin ships five commands. Each is documented in
|
|
|
287
303
|
| `sf audit events pull` | Capture the org's **free** daily `EventLogFile` logs to local disk before the ~1-day retention window drops them — no Event Monitoring / Shield add-on needed. Idempotent, safe to cron |
|
|
288
304
|
| `sf audit timeline` | Reconstruct one actor's activity across every captured event type, entirely offline. Refuses to expand a shared identity or join on a blank field, and always reports capture coverage first |
|
|
289
305
|
| `sf audit preflight` | Read the running user's effective permissions in one query and report which checks will produce a verdict and which will return inconclusive — **before** an audit is run |
|
|
290
|
-
| `sf audit apps` | Read the
|
|
306
|
+
| `sf audit apps` | Read the `RestApi`, `BulkApi2`, `GraphQlQueryExecution` and `AuraRequest` event logs to compare what each connected app actually *uses* against what its run-as user is *granted*, per object and read/write, and suggest a least-privilege permission set. `--emit-permset <dir>` writes it as local `.permissionset-meta.xml` files for review; nothing is deployed |
|
|
291
307
|
|
|
292
308
|
To triage captured logs for abuse patterns, pair `events pull` with the companion CLI
|
|
293
309
|
**[sfelf-triage](https://github.com/cclabsnz/sfelf-triage)**, which reads this plugin's
|
|
@@ -297,11 +313,12 @@ To triage captured logs for abuse patterns, pair `events pull` with the companio
|
|
|
297
313
|
|
|
298
314
|
`sf audit incident collect --target-org <alias>` finds Guest User Anomaly waves and saves a
|
|
299
315
|
guest-filtered evidence bundle to `~/.sf/incidents/`. `sf audit incident report --bundle <dir>`
|
|
300
|
-
analyses it offline
|
|
316
|
+
analyses it offline into a cited verdict (who it was, whether content came back, and whether anyone
|
|
317
|
+
logged in) as an HTML/Markdown/JSON report with evidence CSVs. Pass
|
|
301
318
|
`--ip-ranges` with provider range files you have downloaded to classify hosting; the plugin
|
|
302
319
|
never fetches them. Use `--redact` before sharing beyond the client's security team. Bundles in
|
|
303
320
|
`~/.sf/incidents` hold guest-traffic rows and linked-user details unencrypted, so handle them as
|
|
304
|
-
sensitive data.
|
|
321
|
+
sensitive data. A worked example: [investigating a Guest User Anomaly with sf-audit](https://www.softwareinsights.dev/posts/salesforce-guest-user-anomaly-investigation-sf-audit-incident/).
|
|
305
322
|
|
|
306
323
|
## Requirements
|
|
307
324
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ten domains docs/CHECKS.md groups the checks into, and which domain each check belongs to.
|
|
3
|
+
* A finding's own `category` is finer and inconsistent across checks (29 labels for 10 domains), so
|
|
4
|
+
* reports that group by area use this instead. test/unit/checks/domains.test.ts keeps it in step with
|
|
5
|
+
* the registry and with docs/CHECKS.md.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DOMAINS: readonly ['Org Health & Configuration', 'Identity & Authentication', 'Users, Permissions & Privilege', 'Data Access & Sharing', 'Guest & External-Facing Access', 'Apex & Code Security', 'Integrations, Connected Apps & Deployments', 'Secrets & Credential Storage', 'Monitoring & Threat Detection', 'AI & Agents (Agentforce / GenAI)'];
|
|
8
|
+
export type Domain = (typeof DOMAINS)[number];
|
|
9
|
+
/** The domain a check belongs to, or undefined for an id no registered check has. */
|
|
10
|
+
export declare function domainOf(checkId: string | undefined): Domain | undefined;
|
|
11
|
+
//# sourceMappingURL=domains.d.ts.map
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ten domains docs/CHECKS.md groups the checks into, and which domain each check belongs to.
|
|
3
|
+
* A finding's own `category` is finer and inconsistent across checks (29 labels for 10 domains), so
|
|
4
|
+
* reports that group by area use this instead. test/unit/checks/domains.test.ts keeps it in step with
|
|
5
|
+
* the registry and with docs/CHECKS.md.
|
|
6
|
+
*/
|
|
7
|
+
export const DOMAINS = [
|
|
8
|
+
'Org Health & Configuration',
|
|
9
|
+
'Identity & Authentication',
|
|
10
|
+
'Users, Permissions & Privilege',
|
|
11
|
+
'Data Access & Sharing',
|
|
12
|
+
'Guest & External-Facing Access',
|
|
13
|
+
'Apex & Code Security',
|
|
14
|
+
'Integrations, Connected Apps & Deployments',
|
|
15
|
+
'Secrets & Credential Storage',
|
|
16
|
+
'Monitoring & Threat Detection',
|
|
17
|
+
'AI & Agents (Agentforce / GenAI)',
|
|
18
|
+
];
|
|
19
|
+
const BY_DOMAIN = {
|
|
20
|
+
'Org Health & Configuration': [
|
|
21
|
+
'health-check',
|
|
22
|
+
'api-limits',
|
|
23
|
+
'enhanced-domains',
|
|
24
|
+
'release-updates',
|
|
25
|
+
'legacy-api-version',
|
|
26
|
+
],
|
|
27
|
+
'Identity & Authentication': [
|
|
28
|
+
'password-session-policy',
|
|
29
|
+
'ip-restrictions',
|
|
30
|
+
'sso-enforcement',
|
|
31
|
+
'mfa-enforcement',
|
|
32
|
+
'certificate-expiry',
|
|
33
|
+
'trusted-ip-ranges',
|
|
34
|
+
'my-domain-login-policy',
|
|
35
|
+
'high-assurance-session',
|
|
36
|
+
'internal-user-mfa',
|
|
37
|
+
'auth-providers',
|
|
38
|
+
'session-hardening',
|
|
39
|
+
'oauth-device-and-asset-token-flows',
|
|
40
|
+
'delegated-authentication-exposure',
|
|
41
|
+
'auth-provider-registration-handler',
|
|
42
|
+
'mfa-registration',
|
|
43
|
+
'mfa-method-strength',
|
|
44
|
+
],
|
|
45
|
+
'Users, Permissions & Privilege': [
|
|
46
|
+
'users-and-admins',
|
|
47
|
+
'permissions',
|
|
48
|
+
'inactive-users',
|
|
49
|
+
'standard-profiles',
|
|
50
|
+
'api-client-permission',
|
|
51
|
+
'soap-login-api-auth',
|
|
52
|
+
'integration-users',
|
|
53
|
+
'integration-least-privilege',
|
|
54
|
+
'escalation-perms',
|
|
55
|
+
'login-access-policy',
|
|
56
|
+
'data-export-access',
|
|
57
|
+
'privileged-access',
|
|
58
|
+
'delegated-administration-groups',
|
|
59
|
+
'separation-of-duties',
|
|
60
|
+
],
|
|
61
|
+
'Data Access & Sharing': [
|
|
62
|
+
'sharing-model',
|
|
63
|
+
'flows-without-sharing',
|
|
64
|
+
'public-group-sharing',
|
|
65
|
+
'field-level-security',
|
|
66
|
+
'content-links',
|
|
67
|
+
'field-history-tracking',
|
|
68
|
+
'data-classification',
|
|
69
|
+
'report-folder-access',
|
|
70
|
+
'public-content-exposure',
|
|
71
|
+
'encryption-coverage',
|
|
72
|
+
'sandbox-data-masking',
|
|
73
|
+
'data-cloud-data-space-isolation',
|
|
74
|
+
'restriction-rules-integrity',
|
|
75
|
+
'shield-tenant-secret-lifecycle',
|
|
76
|
+
],
|
|
77
|
+
'Guest & External-Facing Access': [
|
|
78
|
+
'guest-user-access',
|
|
79
|
+
'csp-trusted-sites',
|
|
80
|
+
'experience-cloud-site',
|
|
81
|
+
'cors-allowlist',
|
|
82
|
+
'guest-object-exposure',
|
|
83
|
+
'guest-site-options',
|
|
84
|
+
'guest-record-access-policy',
|
|
85
|
+
'classic-sites',
|
|
86
|
+
'guest-api-access',
|
|
87
|
+
'guest-user-visibility',
|
|
88
|
+
'experience-csp',
|
|
89
|
+
'external-account-hierarchy-exposure',
|
|
90
|
+
'guest-executable-apex',
|
|
91
|
+
],
|
|
92
|
+
'Apex & Code Security': [
|
|
93
|
+
'hardcoded-credentials',
|
|
94
|
+
'apex-sharing',
|
|
95
|
+
'scheduled-apex',
|
|
96
|
+
'code-security',
|
|
97
|
+
'anonymous-apex-audit',
|
|
98
|
+
'platform-event-subscriber-context',
|
|
99
|
+
'flow-http-callout-credential-bypass',
|
|
100
|
+
'apex-logging',
|
|
101
|
+
'apex-crud-fls',
|
|
102
|
+
'apex-rest-endpoint',
|
|
103
|
+
'visualforce-xss',
|
|
104
|
+
'lightning-message-channel',
|
|
105
|
+
],
|
|
106
|
+
'Integrations, Connected Apps & Deployments': [
|
|
107
|
+
'connected-apps',
|
|
108
|
+
'remote-sites',
|
|
109
|
+
'named-credentials',
|
|
110
|
+
'installed-packages',
|
|
111
|
+
'connected-app-scope',
|
|
112
|
+
'email-security',
|
|
113
|
+
'outbound-messages',
|
|
114
|
+
'external-credentials',
|
|
115
|
+
'inbound-email-handler-exposure',
|
|
116
|
+
'org-wide-email-spoofing',
|
|
117
|
+
'package-post-install-supply-chain',
|
|
118
|
+
'deployment-identity',
|
|
119
|
+
'connected-app-inactivity',
|
|
120
|
+
'oauth-token-inventory',
|
|
121
|
+
],
|
|
122
|
+
'Secrets & Credential Storage': [
|
|
123
|
+
'custom-settings',
|
|
124
|
+
'custom-labels-credential',
|
|
125
|
+
],
|
|
126
|
+
'Monitoring & Threat Detection': [
|
|
127
|
+
'login-session',
|
|
128
|
+
'audit-trail',
|
|
129
|
+
'debug-log-access',
|
|
130
|
+
'transaction-security-policy',
|
|
131
|
+
'failed-login-detection',
|
|
132
|
+
'threat-detection',
|
|
133
|
+
'login-anomaly',
|
|
134
|
+
'event-monitoring',
|
|
135
|
+
'guest-traffic-anomaly',
|
|
136
|
+
'siem-integration',
|
|
137
|
+
],
|
|
138
|
+
'AI & Agents (Agentforce / GenAI)': [
|
|
139
|
+
'genai-prompt-template-grounding',
|
|
140
|
+
'agent-inventory',
|
|
141
|
+
'agent-user-privilege',
|
|
142
|
+
'agent-action-surface',
|
|
143
|
+
'agent-channel-exposure',
|
|
144
|
+
'agent-monitoring-coverage',
|
|
145
|
+
'agent-query-reach',
|
|
146
|
+
'agent-outbound-actions',
|
|
147
|
+
'trusted-url-hygiene',
|
|
148
|
+
],
|
|
149
|
+
};
|
|
150
|
+
const DOMAIN_OF = new Map(Object.entries(BY_DOMAIN).flatMap(([d, ids]) => ids.map((id) => [id, d])));
|
|
151
|
+
/** The domain a check belongs to, or undefined for an id no registered check has. */
|
|
152
|
+
export function domainOf(checkId) {
|
|
153
|
+
return checkId === undefined ? undefined : DOMAIN_OF.get(checkId);
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=domains.js.map
|
|
@@ -5,7 +5,7 @@ import { buildComplianceMatrix } from '../report/ComplianceMatrix.js';
|
|
|
5
5
|
import { coverageSummary, coverageAdvice } from '../findings/coverage.js';
|
|
6
6
|
import { techniqueLabel, ATTACK_TACTIC_ORDER } from '../threats/attack.js';
|
|
7
7
|
import { buildThreatView, threatRowStatusText } from '../threats/view.js';
|
|
8
|
-
import { buildActionPlan } from '../report/ActionPlan.js';
|
|
8
|
+
import { buildActionPlan, planHeadline, EFFORT_LABEL, WAVE_LABEL, WAVE_WHY } from '../report/ActionPlan.js';
|
|
9
9
|
import { buildAttackJourney } from '../report/AttackJourney.js';
|
|
10
10
|
import { deckFontFaceCss } from './deckFonts.js';
|
|
11
11
|
// The executive report is a consulting-style deck: every slide's title states its conclusion, the
|
|
@@ -20,13 +20,6 @@ const SEV_RANK = { CRITICAL: 0, HIGH: 1, MEDIUM: 2, LOW: 3, INFO: 4 };
|
|
|
20
20
|
const SEVERITIES = ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW', 'INFO'];
|
|
21
21
|
// The threat view holds no INFO results, so the heatmap has no Info column.
|
|
22
22
|
const THREAT_LEVELS = SEVERITIES.filter((l) => l !== 'INFO');
|
|
23
|
-
const EFFORT_LABEL = { quick: 'Under a day', moderate: 'Days', project: 'Weeks' };
|
|
24
|
-
const WAVE_LABEL = { 1: 'Start now', 2: 'Next 30 days', 3: 'This quarter' };
|
|
25
|
-
const WAVE_WHY = {
|
|
26
|
-
1: 'breaks a critical chain or closes a critical finding, whatever the effort',
|
|
27
|
-
2: 'high severity, days of work or less',
|
|
28
|
-
3: 'high severity, weeks of work',
|
|
29
|
-
};
|
|
30
23
|
const PLAN_ROWS_PER_SLIDE = 6;
|
|
31
24
|
const MATRIX_MAX = 10;
|
|
32
25
|
const TACTIC_SHORT = {
|
|
@@ -405,25 +398,8 @@ ${head}<div class="content">${s.body}</div>
|
|
|
405
398
|
const passed = r.findings.filter((f) => f.passed).length;
|
|
406
399
|
const named = chains.filter((c) => c.abuseCase);
|
|
407
400
|
const critChains = chains.map((c, i) => ({ c, i })).filter((x) => x.c.severity === 'CRITICAL' && x.c.abuseCase);
|
|
408
|
-
|
|
409
|
-
const
|
|
410
|
-
const wave1 = plan.filter((a) => a.wave === 1);
|
|
411
|
-
const brokenByWave1 = new Set(wave1.flatMap((a) => a.breaks));
|
|
412
|
-
const allCritBroken = allCrit.length > 0 && allCrit.every((x) => brokenByWave1.has(x.i));
|
|
413
|
-
const rest = plan.length - wave1.length;
|
|
414
|
-
const restText = rest ? `; ${rest} more action${verb(rest, ' completes', 's complete')} the plan` : '';
|
|
415
|
-
const n1 = wave1.length;
|
|
416
|
-
let headline;
|
|
417
|
-
if (plan.length === 0)
|
|
418
|
-
headline = 'No critical or high-severity issues are open; the remaining fixes are routine hardening';
|
|
419
|
-
else if (allCritBroken)
|
|
420
|
-
headline = `${actions(n1)} to start now ${verb(n1, 'closes', 'close')} every critical attack path${restText}`;
|
|
421
|
-
else if (n1)
|
|
422
|
-
headline = `${actions(n1)} to start now ${verb(n1, 'addresses', 'address')} the critical exposure${restText}`;
|
|
423
|
-
else if (high)
|
|
424
|
-
headline = `${actions(plan.length)} ${verb(plan.length, 'addresses', 'address')} every open high-severity issue; none is critical`;
|
|
425
|
-
else
|
|
426
|
-
headline = `${actions(plan.length)} ${verb(plan.length, 'addresses', 'address')} the remaining exposure; none is critical or high`;
|
|
401
|
+
const n1 = plan.filter((a) => a.wave === 1).length;
|
|
402
|
+
const headline = planHeadline(plan, chains, high);
|
|
427
403
|
const c = r.coverage;
|
|
428
404
|
const incon = r.findings.filter(unassessed).length;
|
|
429
405
|
const waivedN = r.findings.filter(isWaived).length;
|
|
@@ -4,6 +4,12 @@ export declare class HtmlRenderer implements AuditRenderer {
|
|
|
4
4
|
readonly format = "html";
|
|
5
5
|
readonly fileExtension = ".html";
|
|
6
6
|
private renderAttackPaths;
|
|
7
|
+
/** Option A: the fixes, in the order to do them, each with the findings it closes. */
|
|
8
|
+
private renderPlan;
|
|
9
|
+
/** Option C: one scorecard row per domain, then each domain's findings, with passed checks folded away. */
|
|
10
|
+
private renderDomains;
|
|
11
|
+
/** Option D: every result in one table that can be regrouped and searched; links to the full finding. */
|
|
12
|
+
private renderTable;
|
|
7
13
|
render(result: AuditResult): string;
|
|
8
14
|
}
|
|
9
15
|
//# sourceMappingURL=HtmlRenderer.d.ts.map
|