@cclabsnz/sf-audit 1.24.0 → 1.25.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/CHANGELOG.md +56 -0
- package/lib/chains/Capability.d.ts +1 -1
- package/lib/chains/Capability.js +1 -1
- package/lib/chains/CapabilityRegistry.js +5 -0
- package/lib/chains/namedChains.js +32 -6
- package/lib/checks/domains.d.ts +11 -0
- package/lib/checks/domains.js +155 -0
- package/lib/renderers/ClientReportRenderer.js +11 -33
- 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/lib/threats/attack.js +1 -0
- package/lib/threats/view.d.ts +1 -1
- package/lib/threats/view.js +2 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,62 @@ published note and carries the signed provenance attestation and CycloneDX SBOM
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [v1.25.0](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.25.0) — 2026-11-10
|
|
13
|
+
|
|
14
|
+
The technical HTML report is redesigned. It now uses the executive report's white consulting look
|
|
15
|
+
and reads in the order an admin works: what to fix first, how an attacker would get in, where each
|
|
16
|
+
area of the org stands, and every result in one table.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **`--format html` is on white**, in the executive report's palette and fonts. The dark theme is
|
|
21
|
+
gone. Severity is shown by tag style and text as well as colour, so the report works printed or
|
|
22
|
+
in greyscale.
|
|
23
|
+
- **One verdict band at the top**: the grade, score, why it got that grade and evidence coverage,
|
|
24
|
+
next to the open-finding total with one severity bar and four counts. This replaces the score
|
|
25
|
+
ring, donut and KPI strip, which repeated the same numbers.
|
|
26
|
+
- **Fix first**: the report opens on the executive report's action plan and headline. Each action
|
|
27
|
+
lists the findings it closes and the attack chains it breaks or is part of.
|
|
28
|
+
- **Attack paths** collapse to one line each (severity, C1/P1 label as in the executive report,
|
|
29
|
+
title, where to break it). Steps, the diagram and the fix open on demand.
|
|
30
|
+
- **By domain**: a scorecard row for each of the ten domains in docs/CHECKS.md, worst first, then
|
|
31
|
+
each domain's findings by severity with passed checks folded away. A domain with checks that could
|
|
32
|
+
not be assessed is marked "partly unseen", never "clear".
|
|
33
|
+
- **All results**: one table that can be regrouped by severity, domain, attack chain or framework,
|
|
34
|
+
and searched. Passed checks are hidden until asked for.
|
|
35
|
+
- Each finding is drawn once, with a stable link (`#f-<id>`) for tickets; the plan, attack paths
|
|
36
|
+
and table link to it.
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- `domainOf` / `DOMAINS` (src/checks/domains.ts): the domain each check belongs to, kept in step
|
|
41
|
+
with docs/CHECKS.md by a test.
|
|
42
|
+
- `planHeadline` and the plan's effort and wave labels are shared by the executive and HTML reports,
|
|
43
|
+
so both state the same answer.
|
|
44
|
+
|
|
45
|
+
## [v1.24.1](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.24.1) — 2026-11-01
|
|
46
|
+
|
|
47
|
+
The threat model reads as the threats it found. Inventory lines no longer sit in the STRIDE view as
|
|
48
|
+
open findings, and the MFA bypass chain fires only when a privileged user can actually sign in
|
|
49
|
+
without a second factor, starting at initial access on the ATT&CK slide.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- The threat view (Markdown Threat View, executive STRIDE heatmap and LINDDUN bars) no longer
|
|
54
|
+
counts INFO results as open findings. An inventory line such as "0 scheduled jobs
|
|
55
|
+
found" or "No certificates found" sat under a STRIDE category as if it were a threat. The heatmap
|
|
56
|
+
loses its Info column; the check still counts as coverage for its category (RULE-104).
|
|
57
|
+
- The insider bulk-export chain narrative reads without an em dash.
|
|
58
|
+
- **MFA bypass to privileged compromise** fires only when the MFA weakness reaches a privileged user:
|
|
59
|
+
a trusted IP range (which exempts everyone), or users without MFA that include an admin-level
|
|
60
|
+
holder (a full 50-user list counts, since the list stops there). Portal users without MFA no
|
|
61
|
+
longer fire it on their own, since a portal user is not an admin. Some grades rise where that
|
|
62
|
+
was the only path.
|
|
63
|
+
- The same chain now starts at **Initial access** on the ATT&CK slide. Weak MFA grants a new
|
|
64
|
+
`valid-account` capability, mapped to T1078.004 Valid Accounts: Cloud Accounts, so the three MFA
|
|
65
|
+
findings now carry T1078.004 in every output (Markdown, HTML, JSON, SARIF). It is not an entry
|
|
66
|
+
point of a potential chain, so no other chain changes.
|
|
67
|
+
|
|
12
68
|
## [v1.24.0](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.24.0) — 2026-10-30
|
|
13
69
|
|
|
14
70
|
Several checks were filtering on values the platform never writes, so they found nothing; they now
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Capability = 'unauth-foothold' | 'low-trust-authenticated' | 'data-read' | 'data-read-bulk' | 'data-write' | 'code-exec' | 'credential-theft' | 'priv-esc' | 'org-takeover' | 'external-egress';
|
|
1
|
+
export type Capability = 'unauth-foothold' | 'low-trust-authenticated' | 'data-read' | 'data-read-bulk' | 'data-write' | 'code-exec' | 'credential-theft' | 'priv-esc' | 'org-takeover' | 'external-egress' | 'valid-account';
|
|
2
2
|
export declare const ALL_CAPABILITIES: readonly Capability[];
|
|
3
3
|
/** Capabilities that represent an attacker entry point. */
|
|
4
4
|
export declare const SOURCE_CAPS: readonly Capability[];
|
package/lib/chains/Capability.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const ALL_CAPABILITIES = [
|
|
2
2
|
'unauth-foothold', 'low-trust-authenticated', 'data-read', 'data-read-bulk',
|
|
3
|
-
'data-write', 'code-exec', 'credential-theft', 'priv-esc', 'org-takeover', 'external-egress',
|
|
3
|
+
'data-write', 'code-exec', 'credential-theft', 'priv-esc', 'org-takeover', 'external-egress', 'valid-account',
|
|
4
4
|
];
|
|
5
5
|
/** Capabilities that represent an attacker entry point. */
|
|
6
6
|
export const SOURCE_CAPS = ['unauth-foothold', 'low-trust-authenticated'];
|
|
@@ -80,6 +80,11 @@ export const CAPABILITY_REGISTRY = {
|
|
|
80
80
|
'login-access-policy-login-as-enabled': { grants: ['priv-esc', 'data-read-bulk'], techniques: { 'priv-esc': ['T1078.004'] } },
|
|
81
81
|
// External federation an attacker could ride in on
|
|
82
82
|
'auth-providers-social': { grants: ['low-trust-authenticated'] },
|
|
83
|
+
// Weak MFA: a stolen or guessed password is enough to sign in as the user. The capability is not an
|
|
84
|
+
// entry point of a potential path; the MFA chain pairs it with the privileged users it reaches.
|
|
85
|
+
'trusted-ip-broad-ranges': { grants: ['valid-account'] },
|
|
86
|
+
'internal-user-mfa-gaps': { grants: ['valid-account'] },
|
|
87
|
+
'mfa-portal-users-without-enforcement': { grants: ['valid-account'] },
|
|
83
88
|
// Toxic permission combinations held by one user. Capabilities follow each combo's own stated
|
|
84
89
|
// outcome — see COMBOS in SeparationOfDutiesCheck, where the ids are defined.
|
|
85
90
|
'separation-of-duties-self-escalation': { grants: ['priv-esc', 'org-takeover'] },
|
|
@@ -167,6 +167,30 @@ export const DETECTION_BLIND_SPOTS = [
|
|
|
167
167
|
];
|
|
168
168
|
export const EXPLOITABLE_ACCESS = ['unauth-foothold', 'priv-esc', 'org-takeover'];
|
|
169
169
|
export const MFA_WEAKNESS = ['trusted-ip-broad-ranges', 'internal-user-mfa-gaps', 'mfa-portal-users-without-enforcement'];
|
|
170
|
+
// Org-wide: a trusted range exempts every user signing in from it, admins included.
|
|
171
|
+
const MFA_WEAKNESS_ORG_WIDE = ['trusted-ip-broad-ranges'];
|
|
172
|
+
// The internal-user MFA finding lists at most this many users, so a full list may leave a privileged
|
|
173
|
+
// user out. Portal users never qualify this way: a portal user is not one of the admins.
|
|
174
|
+
const MFA_USER_LIST_CAP = 50;
|
|
175
|
+
const MFA_CAPPED_INTERNAL = 'internal-user-mfa-gaps';
|
|
176
|
+
/** The user Ids (from a record link) and usernames a finding's affected items name. */
|
|
177
|
+
function userKeys(f) {
|
|
178
|
+
const keys = new Set();
|
|
179
|
+
for (const item of f.affectedItems ?? []) {
|
|
180
|
+
const id = /\/(005[A-Za-z0-9]{12}(?:[A-Za-z0-9]{3})?)$/.exec(item.url ?? '')?.[1];
|
|
181
|
+
if (id)
|
|
182
|
+
keys.add(id.slice(0, 15));
|
|
183
|
+
keys.add(item.label.replace(/ \(.*\)$/, ''));
|
|
184
|
+
}
|
|
185
|
+
return keys;
|
|
186
|
+
}
|
|
187
|
+
/** The MFA weaknesses that reach a privileged user: org-wide, or naming one of those users. */
|
|
188
|
+
function weaknessReachingPrivileged(weakness, targets) {
|
|
189
|
+
const privileged = new Set(targets.flatMap((t) => [...userKeys(t)]));
|
|
190
|
+
return weakness.filter((w) => MFA_WEAKNESS_ORG_WIDE.includes(w.id)
|
|
191
|
+
|| (w.id === MFA_CAPPED_INTERNAL && (w.affectedItems?.length ?? 0) >= MFA_USER_LIST_CAP)
|
|
192
|
+
|| [...userKeys(w)].some((k) => privileged.has(k)));
|
|
193
|
+
}
|
|
170
194
|
export const PRIVILEGED_ACCOUNTS = [
|
|
171
195
|
'users-modify-all-data', 'users-view-all-data', 'users-super-admin-combo',
|
|
172
196
|
'privileged-access-shadow-admins', 'separation-of-duties-self-escalation',
|
|
@@ -533,7 +557,7 @@ export const NAMED_CHAINS = [
|
|
|
533
557
|
'permission set can export it en masse (Weekly Data Export, or API access combined with ' +
|
|
534
558
|
'View/Modify All Data), and there is no monitoring that would record the export happening. ' +
|
|
535
559
|
'Broad read plus bulk egress plus no audit trail is the insider-threat and post-credential-' +
|
|
536
|
-
'compromise path
|
|
560
|
+
'compromise path. The missing audit trail is what makes it impossible to reconstruct afterwards.',
|
|
537
561
|
remediation: 'Narrow the broad internal sharing, restrict Weekly Data Export and Bulk API access to a named ' +
|
|
538
562
|
'few, and enable Event Monitoring (plus forwarding to a SIEM) so bulk reads are recorded and ' +
|
|
539
563
|
'alertable.',
|
|
@@ -590,20 +614,22 @@ export const NAMED_CHAINS = [
|
|
|
590
614
|
id: 'mfa-bypass-admin',
|
|
591
615
|
title: 'MFA bypass to privileged compromise',
|
|
592
616
|
severity: 'HIGH',
|
|
593
|
-
narrative: '
|
|
594
|
-
'
|
|
617
|
+
narrative: 'A privileged account signs in without a second factor: a trusted IP range exempts it from MFA, or ' +
|
|
618
|
+
'the account itself lacks MFA enforcement. A credential-stuffing or phishing attacker who has the ' +
|
|
619
|
+
'password can take over an admin.',
|
|
595
620
|
remediation: 'Enforce MFA for all internal users, remove trusted-IP MFA bypass ranges, and minimise privileged accounts.',
|
|
596
621
|
abuseCase: {
|
|
597
622
|
actor: 'a credential-stuffing or phishing attacker',
|
|
598
623
|
goal: 'take over a privileged account without a second factor',
|
|
599
|
-
preconditions: [{ ids: MFA_WEAKNESS }, { ids: PRIVILEGED_ACCOUNTS }],
|
|
624
|
+
preconditions: [{ ids: MFA_WEAKNESS, role: 'valid-account' }, { ids: PRIVILEGED_ACCOUNTS }],
|
|
600
625
|
breakPoint: 0,
|
|
601
|
-
tactics: { goal: 'privilege-escalation' },
|
|
626
|
+
tactics: { entry: 'initial-access', goal: 'privilege-escalation' },
|
|
602
627
|
breakPointText: 'Enforce MFA for every user and remove trusted-IP ranges that bypass it.',
|
|
603
628
|
},
|
|
604
629
|
match(_present, active) {
|
|
605
|
-
|
|
630
|
+
// A portal user without MFA is not an admin: the weakness must reach a privileged user.
|
|
606
631
|
const targets = byIds(active, PRIVILEGED_ACCOUNTS);
|
|
632
|
+
const weakness = weaknessReachingPrivileged(byIds(active, MFA_WEAKNESS), targets);
|
|
607
633
|
return weakness.length > 0 && targets.length > 0 ? [...weakness, ...targets] : null;
|
|
608
634
|
},
|
|
609
635
|
},
|
|
@@ -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
|
|
@@ -18,13 +18,8 @@ const SEV_COLOR = {
|
|
|
18
18
|
};
|
|
19
19
|
const SEV_RANK = { CRITICAL: 0, HIGH: 1, MEDIUM: 2, LOW: 3, INFO: 4 };
|
|
20
20
|
const SEVERITIES = ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW', 'INFO'];
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const WAVE_WHY = {
|
|
24
|
-
1: 'breaks a critical chain or closes a critical finding, whatever the effort',
|
|
25
|
-
2: 'high severity, days of work or less',
|
|
26
|
-
3: 'high severity, weeks of work',
|
|
27
|
-
};
|
|
21
|
+
// The threat view holds no INFO results, so the heatmap has no Info column.
|
|
22
|
+
const THREAT_LEVELS = SEVERITIES.filter((l) => l !== 'INFO');
|
|
28
23
|
const PLAN_ROWS_PER_SLIDE = 6;
|
|
29
24
|
const MATRIX_MAX = 10;
|
|
30
25
|
const TACTIC_SHORT = {
|
|
@@ -244,13 +239,13 @@ h3{font-size:19px;font-weight:650;line-height:1.3;margin:0}
|
|
|
244
239
|
.jr .cc.pot .ln{border-top-style:dashed}
|
|
245
240
|
.jr .cc .dt{position:relative;width:13px;height:13px;border-radius:50%;background:var(--c)}
|
|
246
241
|
.tm{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:52px}
|
|
247
|
-
.hm{display:grid;grid-template-columns:200px repeat(
|
|
242
|
+
.hm{display:grid;grid-template-columns:200px repeat(4,minmax(0,1fr)) 52px;gap:4px;align-items:center}
|
|
248
243
|
.hm .h{font-size:11.5px;font-weight:700;color:var(--muted);text-align:center;padding-bottom:4px}
|
|
249
244
|
.hm .h.t{text-align:right}
|
|
250
245
|
.hm .n{font-size:14px;line-height:1.25}
|
|
251
246
|
.hm .n b{display:inline-block;width:20px}
|
|
252
247
|
.hm .c{height:46px;display:grid;place-items:center;font-size:14.5px;font-weight:700;background:#f6f7f8}
|
|
253
|
-
.hm .none{grid-column:span
|
|
248
|
+
.hm .none{grid-column:span 4;height:46px;display:flex;align-items:center;padding:0 12px;font-size:13px;color:var(--muted);background:#f6f7f8}
|
|
254
249
|
.hm .tt{text-align:right;font-weight:700}
|
|
255
250
|
.lb{display:grid;grid-template-columns:190px minmax(0,1fr) 30px;gap:12px;align-items:center;min-height:38px;border-bottom:1px solid #eef0f2;font-size:14px}
|
|
256
251
|
.lb .segs{display:flex;gap:2px;height:12px}
|
|
@@ -342,7 +337,7 @@ h2.title{font-size:22px}
|
|
|
342
337
|
.plan td[data-l]::before{content:attr(data-l);flex:none;width:58px;font-size:11px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:var(--muted)}
|
|
343
338
|
.content{min-width:0}
|
|
344
339
|
.jr{overflow-x:auto;grid-template-columns:150px repeat(15,48px)}
|
|
345
|
-
.hm{grid-template-columns:120px repeat(
|
|
340
|
+
.hm{grid-template-columns:120px repeat(4,minmax(0,1fr)) 34px}
|
|
346
341
|
.lb{grid-template-columns:120px minmax(0,1fr) 24px}
|
|
347
342
|
.passed{grid-template-columns:minmax(0,1fr)}
|
|
348
343
|
.sched:not(.approve),.sched:not(.approve) tbody,.sched:not(.approve) tr,.sched:not(.approve) td{display:block;width:100%}
|
|
@@ -403,25 +398,8 @@ ${head}<div class="content">${s.body}</div>
|
|
|
403
398
|
const passed = r.findings.filter((f) => f.passed).length;
|
|
404
399
|
const named = chains.filter((c) => c.abuseCase);
|
|
405
400
|
const critChains = chains.map((c, i) => ({ c, i })).filter((x) => x.c.severity === 'CRITICAL' && x.c.abuseCase);
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
const wave1 = plan.filter((a) => a.wave === 1);
|
|
409
|
-
const brokenByWave1 = new Set(wave1.flatMap((a) => a.breaks));
|
|
410
|
-
const allCritBroken = allCrit.length > 0 && allCrit.every((x) => brokenByWave1.has(x.i));
|
|
411
|
-
const rest = plan.length - wave1.length;
|
|
412
|
-
const restText = rest ? `; ${rest} more action${verb(rest, ' completes', 's complete')} the plan` : '';
|
|
413
|
-
const n1 = wave1.length;
|
|
414
|
-
let headline;
|
|
415
|
-
if (plan.length === 0)
|
|
416
|
-
headline = 'No critical or high-severity issues are open; the remaining fixes are routine hardening';
|
|
417
|
-
else if (allCritBroken)
|
|
418
|
-
headline = `${actions(n1)} to start now ${verb(n1, 'closes', 'close')} every critical attack path${restText}`;
|
|
419
|
-
else if (n1)
|
|
420
|
-
headline = `${actions(n1)} to start now ${verb(n1, 'addresses', 'address')} the critical exposure${restText}`;
|
|
421
|
-
else if (high)
|
|
422
|
-
headline = `${actions(plan.length)} ${verb(plan.length, 'addresses', 'address')} every open high-severity issue; none is critical`;
|
|
423
|
-
else
|
|
424
|
-
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);
|
|
425
403
|
const c = r.coverage;
|
|
426
404
|
const incon = r.findings.filter(unassessed).length;
|
|
427
405
|
const waivedN = r.findings.filter(isWaived).length;
|
|
@@ -570,7 +548,7 @@ ${pts}<div class="yl"><span>Risk removed →</span></div><div class="xl"><span>U
|
|
|
570
548
|
});
|
|
571
549
|
}
|
|
572
550
|
const view = buildThreatView(r.findings);
|
|
573
|
-
const sevCount = (row) =>
|
|
551
|
+
const sevCount = (row) => THREAT_LEVELS.map((l) => row.findings.filter((f) => f.riskLevel === l).length);
|
|
574
552
|
const shade = (n, crit) => (!n ? '' : crit ? 'background:var(--crit);color:#fff'
|
|
575
553
|
: `background:color-mix(in srgb,var(--accent) ${Math.round(16 + Math.min(n, 10) * 7)}%,var(--paper));${n >= 6 ? 'color:#fff' : ''}`);
|
|
576
554
|
const stride = view.stride.map((row) => {
|
|
@@ -591,7 +569,7 @@ ${pts}<div class="yl"><span>Risk removed →</span></div><div class="xl"><span>U
|
|
|
591
569
|
let privacy = '';
|
|
592
570
|
if (view.linddun) {
|
|
593
571
|
const bars = view.linddun.map((row) => {
|
|
594
|
-
const v = sevCount(row)
|
|
572
|
+
const v = sevCount(row);
|
|
595
573
|
const segs = row.findings.length
|
|
596
574
|
? `<span class="segs">${v.map((n, i) => (n ? `<i style="width:${n * 22}px;background:${segColors[i]}"></i>` : '')).join('')}</span>`
|
|
597
575
|
: `<span class="st">${esc(threatRowStatusText(row))}</span>`;
|
|
@@ -606,7 +584,7 @@ ${pts}<div class="yl"><span>Risk removed →</span></div><div class="xl"><span>U
|
|
|
606
584
|
out.push({
|
|
607
585
|
kicker: 'Threat model · STRIDE and LINDDUN', title: esc(headline),
|
|
608
586
|
body: `<div class="tm"><div><h3 style="font-size:15px;margin-bottom:10px">Security threats (STRIDE) · open findings by severity <span class="muted" style="font-weight:400">(a finding counts in each category it touches)</span></h3>
|
|
609
|
-
<div class="hm"><div class="h"></div>${
|
|
587
|
+
<div class="hm"><div class="h"></div>${THREAT_LEVELS.map((l) => `<div class="h">${cap(l.toLowerCase())}</div>`).join('')}<div class="h t">Total</div>${stride}</div></div>${privacy}</div>`,
|
|
610
588
|
source: `Each check is mapped to the STRIDE categories it guards and, where personal data is involved, to LINDDUN.${[...view.stride, ...(view.linddun ?? [])].some((row) => !row.findings.length) ? ' A row without findings is not assurance: it says how many checks covered it.' : ''}`,
|
|
611
589
|
});
|
|
612
590
|
return out;
|
|
@@ -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
|