@cclabsnz/sf-audit 1.24.0 → 1.24.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 +23 -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/renderers/ClientReportRenderer.js +8 -6
- 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 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,29 @@ published note and carries the signed provenance attestation and CycloneDX SBOM
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [v1.24.1](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.24.1) — 2026-11-01
|
|
13
|
+
|
|
14
|
+
The threat model reads as the threats it found. Inventory lines no longer sit in the STRIDE view as
|
|
15
|
+
open findings, and the MFA bypass chain fires only when a privileged user can actually sign in
|
|
16
|
+
without a second factor, starting at initial access on the ATT&CK slide.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- The threat view (Markdown Threat View, executive STRIDE heatmap and LINDDUN bars) no longer
|
|
21
|
+
counts INFO results as open findings. An inventory line such as "0 scheduled jobs
|
|
22
|
+
found" or "No certificates found" sat under a STRIDE category as if it were a threat. The heatmap
|
|
23
|
+
loses its Info column; the check still counts as coverage for its category (RULE-104).
|
|
24
|
+
- The insider bulk-export chain narrative reads without an em dash.
|
|
25
|
+
- **MFA bypass to privileged compromise** fires only when the MFA weakness reaches a privileged user:
|
|
26
|
+
a trusted IP range (which exempts everyone), or users without MFA that include an admin-level
|
|
27
|
+
holder (a full 50-user list counts, since the list stops there). Portal users without MFA no
|
|
28
|
+
longer fire it on their own, since a portal user is not an admin. Some grades rise where that
|
|
29
|
+
was the only path.
|
|
30
|
+
- The same chain now starts at **Initial access** on the ATT&CK slide. Weak MFA grants a new
|
|
31
|
+
`valid-account` capability, mapped to T1078.004 Valid Accounts: Cloud Accounts, so the three MFA
|
|
32
|
+
findings now carry T1078.004 in every output (Markdown, HTML, JSON, SARIF). It is not an entry
|
|
33
|
+
point of a potential chain, so no other chain changes.
|
|
34
|
+
|
|
12
35
|
## [v1.24.0](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.24.0) — 2026-10-30
|
|
13
36
|
|
|
14
37
|
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
|
},
|
|
@@ -18,6 +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
|
+
// The threat view holds no INFO results, so the heatmap has no Info column.
|
|
22
|
+
const THREAT_LEVELS = SEVERITIES.filter((l) => l !== 'INFO');
|
|
21
23
|
const EFFORT_LABEL = { quick: 'Under a day', moderate: 'Days', project: 'Weeks' };
|
|
22
24
|
const WAVE_LABEL = { 1: 'Start now', 2: 'Next 30 days', 3: 'This quarter' };
|
|
23
25
|
const WAVE_WHY = {
|
|
@@ -244,13 +246,13 @@ h3{font-size:19px;font-weight:650;line-height:1.3;margin:0}
|
|
|
244
246
|
.jr .cc.pot .ln{border-top-style:dashed}
|
|
245
247
|
.jr .cc .dt{position:relative;width:13px;height:13px;border-radius:50%;background:var(--c)}
|
|
246
248
|
.tm{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:52px}
|
|
247
|
-
.hm{display:grid;grid-template-columns:200px repeat(
|
|
249
|
+
.hm{display:grid;grid-template-columns:200px repeat(4,minmax(0,1fr)) 52px;gap:4px;align-items:center}
|
|
248
250
|
.hm .h{font-size:11.5px;font-weight:700;color:var(--muted);text-align:center;padding-bottom:4px}
|
|
249
251
|
.hm .h.t{text-align:right}
|
|
250
252
|
.hm .n{font-size:14px;line-height:1.25}
|
|
251
253
|
.hm .n b{display:inline-block;width:20px}
|
|
252
254
|
.hm .c{height:46px;display:grid;place-items:center;font-size:14.5px;font-weight:700;background:#f6f7f8}
|
|
253
|
-
.hm .none{grid-column:span
|
|
255
|
+
.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
256
|
.hm .tt{text-align:right;font-weight:700}
|
|
255
257
|
.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
258
|
.lb .segs{display:flex;gap:2px;height:12px}
|
|
@@ -342,7 +344,7 @@ h2.title{font-size:22px}
|
|
|
342
344
|
.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
345
|
.content{min-width:0}
|
|
344
346
|
.jr{overflow-x:auto;grid-template-columns:150px repeat(15,48px)}
|
|
345
|
-
.hm{grid-template-columns:120px repeat(
|
|
347
|
+
.hm{grid-template-columns:120px repeat(4,minmax(0,1fr)) 34px}
|
|
346
348
|
.lb{grid-template-columns:120px minmax(0,1fr) 24px}
|
|
347
349
|
.passed{grid-template-columns:minmax(0,1fr)}
|
|
348
350
|
.sched:not(.approve),.sched:not(.approve) tbody,.sched:not(.approve) tr,.sched:not(.approve) td{display:block;width:100%}
|
|
@@ -570,7 +572,7 @@ ${pts}<div class="yl"><span>Risk removed →</span></div><div class="xl"><span>U
|
|
|
570
572
|
});
|
|
571
573
|
}
|
|
572
574
|
const view = buildThreatView(r.findings);
|
|
573
|
-
const sevCount = (row) =>
|
|
575
|
+
const sevCount = (row) => THREAT_LEVELS.map((l) => row.findings.filter((f) => f.riskLevel === l).length);
|
|
574
576
|
const shade = (n, crit) => (!n ? '' : crit ? 'background:var(--crit);color:#fff'
|
|
575
577
|
: `background:color-mix(in srgb,var(--accent) ${Math.round(16 + Math.min(n, 10) * 7)}%,var(--paper));${n >= 6 ? 'color:#fff' : ''}`);
|
|
576
578
|
const stride = view.stride.map((row) => {
|
|
@@ -591,7 +593,7 @@ ${pts}<div class="yl"><span>Risk removed →</span></div><div class="xl"><span>U
|
|
|
591
593
|
let privacy = '';
|
|
592
594
|
if (view.linddun) {
|
|
593
595
|
const bars = view.linddun.map((row) => {
|
|
594
|
-
const v = sevCount(row)
|
|
596
|
+
const v = sevCount(row);
|
|
595
597
|
const segs = row.findings.length
|
|
596
598
|
? `<span class="segs">${v.map((n, i) => (n ? `<i style="width:${n * 22}px;background:${segColors[i]}"></i>` : '')).join('')}</span>`
|
|
597
599
|
: `<span class="st">${esc(threatRowStatusText(row))}</span>`;
|
|
@@ -606,7 +608,7 @@ ${pts}<div class="yl"><span>Risk removed →</span></div><div class="xl"><span>U
|
|
|
606
608
|
out.push({
|
|
607
609
|
kicker: 'Threat model · STRIDE and LINDDUN', title: esc(headline),
|
|
608
610
|
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>${
|
|
611
|
+
<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
612
|
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
613
|
});
|
|
612
614
|
return out;
|
package/lib/threats/attack.js
CHANGED
|
@@ -54,6 +54,7 @@ export const CAPABILITY_TECHNIQUES = {
|
|
|
54
54
|
'priv-esc': ['T1098.003'],
|
|
55
55
|
'org-takeover': ['T1098'],
|
|
56
56
|
'external-egress': ['T1567'],
|
|
57
|
+
'valid-account': ['T1078.004'],
|
|
57
58
|
};
|
|
58
59
|
/**
|
|
59
60
|
* Detection gaps: the technique a finding leaves unobserved (RULE-108). Never a technique the
|
package/lib/threats/view.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type ThreatRowStatus = 'findings' | 'no-findings' | 'not-assessed-in-run'
|
|
|
4
4
|
export interface ThreatRow<C extends string> {
|
|
5
5
|
category: C;
|
|
6
6
|
name: string;
|
|
7
|
-
/** Active findings in this category: not passed, inconclusive, not assessed or
|
|
7
|
+
/** Active findings in this category: not passed, inconclusive, not assessed, waived or INFO. */
|
|
8
8
|
findings: Finding[];
|
|
9
9
|
/** Checks in this run whose map entry names the category. */
|
|
10
10
|
coveringChecks: number;
|
package/lib/threats/view.js
CHANGED
|
@@ -2,7 +2,8 @@ import { CHECK_STRIDE_MAP } from './stride.js';
|
|
|
2
2
|
import { CHECK_LINDDUN_MAP } from './linddun.js';
|
|
3
3
|
import { LINDDUN_CATEGORIES, LINDDUN_NAMES, STRIDE_CATEGORIES, STRIDE_NAMES, } from './types.js';
|
|
4
4
|
export const PRIVACY_COST_OF_LOGGING = 'The logging this fix adds records personal data: decide what it captures, how long it is kept and who can read it.';
|
|
5
|
-
|
|
5
|
+
// INFO is an inventory line or a note, never an open threat (RULE-104).
|
|
6
|
+
const isActive = (f) => !f.passed && !f.inconclusive && !f.notAssessed && !f.waived && f.riskLevel !== 'INFO';
|
|
6
7
|
/** The threat view (RULE-104): coverage per category, never a pass. */
|
|
7
8
|
export function buildThreatView(findings) {
|
|
8
9
|
const assessed = new Map();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cclabsnz/sf-audit",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.1",
|
|
4
4
|
"description": "Read-only Salesforce security audit for the sf CLI: 109 checks, attack-chain correlation, A-F risk grading, compliance mapping, free EventLogFile capture, and Guest User Anomaly investigation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"salesforce",
|