@cclabsnz/sf-audit 1.10.0 → 1.12.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 CHANGED
@@ -11,6 +11,80 @@ published note and carries the signed provenance attestation and CycloneDX SBOM
11
11
 
12
12
  Merged to `main`, not yet released.
13
13
 
14
+ ## [v1.12.0](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.12.0) — 2026-09-07
15
+
16
+ A check that shipped in the source but never ran, now registered, plus tests for three more.
17
+
18
+ ### Added
19
+
20
+ - **`soap-login-api-auth`** — flags accounts that authenticate with SOAP API `login()` but do not
21
+ hold the "Use Any API Auth" permission that Winter '27 requires, and separately flags holders
22
+ that no longer need it.
23
+
24
+ The check class has been present and compiling since Winter '27 planning and **had never run**:
25
+ its registry, compliance, `CheckMeta` and test wiring were deferred behind another unfinished
26
+ check and then forgotten. An unregistered check is invisible to the whole suite, so nothing
27
+ failed. It runs now.
28
+
29
+ Worth stating because published coverage of this change routinely gets it wrong: "Use Any API
30
+ Auth" is **not** the same permission as "Use Any API Client", which the separate
31
+ `api-client-permission` check covers. Granting the wrong one leaves the breakage in place while
32
+ feeling remediated. The compliance mapping deliberately does not reuse the Use Any API Client
33
+ control, for the same reason.
34
+
35
+ Both halves matter. The missing-permission half is an availability finding: the failure lands at
36
+ authentication, server to server, with no error anywhere in the Salesforce UI. The
37
+ already-granted half is a security finding, because granting broadly at profile level is the
38
+ common response to this change and converts a breakage problem into a standing-privilege one.
39
+
40
+ ### Changed
41
+
42
+ - Check count is now **92**.
43
+
44
+ ### Internal
45
+
46
+ - Unit tests added for `connected-apps`, `connected-app-inactivity` and `api-client-permission`.
47
+ Untested checks drop from 36 to 33 of 92. The `connected-apps` tests pin the
48
+ `connectedAppNames` cache write that two other checks read, and the `api-client-permission`
49
+ tests assert on the query text so a copy-paste between the two easily-confused API permissions
50
+ fails a test.
51
+
52
+ ## [v1.11.0](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.11.0) — 2026-09-07
53
+
54
+ One new check, closing a blind spot that the SaaS token-theft campaigns of the last year
55
+ turn on: a connected app can hold a working key to your org while every existing check
56
+ reports it as dormant.
57
+
58
+ ### Added
59
+
60
+ - **`oauth-token-inventory`** — inventories standing OAuth authorisations from
61
+ `OauthToken`, so you can answer "which apps can act in this org right now, and for how
62
+ many users" without waiting for a login that will never come.
63
+
64
+ `connected-app-inactivity` reads `LoginHistory` and calls an app inactive after 90 days
65
+ with no OAuth login. That is the wrong signal for a refresh token: the app presents the
66
+ token, gets an access token back, and no `LoginType 'OAuth%'` row is written for the
67
+ exchange. So an app can be reported as dormant and low risk while still holding a
68
+ working credential. When a vendor is breached, the remediation is to revoke access and
69
+ refresh tokens rather than disable a login, and that requires an inventory nothing in
70
+ this plugin previously produced.
71
+
72
+ Emits three findings: an app holding live tokens that is absent from the connected app
73
+ inventory (MEDIUM), tokens unused for 90+ days or with no recorded last use
74
+ (MEDIUM/LOW), and the full per-app inventory (INFO), which is always emitted so the
75
+ report carries the revocation worklist even when nothing is wrong.
76
+
77
+ Token material is never selected. `OauthToken` exposes `AccessToken`, `RequestToken` and
78
+ `DeleteToken` as queryable strings, and findings are written to disk, so the exclusion is
79
+ enforced where the query is built rather than by convention, and asserted in the tests.
80
+
81
+ Degrades honestly rather than quietly: if `OauthToken` cannot be read the check goes
82
+ inconclusive instead of reporting an org with no standing tokens, and if
83
+ `ConnectedApplication` returns nothing the cross-reference is skipped rather than
84
+ flagging every app as unmatched.
85
+
86
+ Check count is now **91**.
87
+
14
88
  ## [v1.10.0](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.10.0) — 2026-09-07
15
89
 
16
90
  Two additions for callers that drive this plugin programmatically: find out what the audit
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  A Salesforce CLI (`sf`) plugin that runs a complete, **read-only** security audit against any Salesforce org, risk-scores it with an A–F grade, and turns the result into a report your security team (or your client's) can act on.
17
17
 
18
- - **90 read-only checks** across identity, access, data, code, integrations, monitoring, and Agentforce / GenAI
18
+ - **92 read-only checks** across identity, access, data, code, integrations, monitoring, and Agentforce / GenAI
19
19
  - **Attack-chain correlation:** links individual findings into named, multi-step attack scenarios — eleven modelled chains, plus an emergent pass for combinations nobody has named yet (see [Attack chains](#attack-chains))
20
20
  - **Compliance mapping:** every finding mapped to **source-verified** controls across 10 frameworks (OWASP, OWASP LLM Top 10, SOC 2, ISO/IEC 27001:2022, Security Benchmark for Salesforce, NZ Privacy Act, HISO 10029, NZISM, HIPAA Security Rule, GDPR)
21
21
  - **Outputs:** a technical `html` / `md` / `json` report, or a branded, client-ready **executive report** (print-to-PDF) with priorities, remediation roadmap, and a compliance coverage matrix
@@ -44,7 +44,7 @@ guarantees here are checkable rather than asserted — see [Trust & verification
44
44
  sf audit security --target-org <orgAlias>
45
45
  ```
46
46
 
47
- Runs all 90 checks and writes an HTML report to the current directory. `sf audit list` prints every
47
+ Runs all 92 checks and writes an HTML report to the current directory. `sf audit list` prints every
48
48
  check id.
49
49
 
50
50
  | Flag | Default | |
@@ -94,16 +94,16 @@ All twelve flags, more examples, and what the executive report contains:
94
94
 
95
95
  ## What It Checks
96
96
 
97
- **90 read-only checks** across ten domains. Every finding is risk-rated CRITICAL → INFO, mapped to
97
+ **92 read-only checks** across ten domains. Every finding is risk-rated CRITICAL → INFO, mapped to
98
98
  compliance controls, and correlated into [attack chains](#attack-chains).
99
99
 
100
100
  | Domain | Checks |
101
101
  |--------|-------:|
102
102
  | Identity & Authentication | 13 |
103
- | Users, Permissions & Privilege | 12 |
103
+ | Users, Permissions & Privilege | 13 |
104
104
  | Data Access & Sharing | 11 |
105
105
  | Guest & External-Facing Access | 12 |
106
- | Integrations, Connected Apps & Deployments | 10 |
106
+ | Integrations, Connected Apps & Deployments | 11 |
107
107
  | Monitoring & Threat Detection | 10 |
108
108
  | Apex & Code Security | 9 |
109
109
  | AI & Agents (Agentforce / GenAI) | 6 |
@@ -0,0 +1,14 @@
1
+ import type { AuditContext } from '@cclabsnz/sf-core';
2
+ import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
3
+ /** Queryable on OauthToken and permanently excluded: an audit report must not carry credentials. */
4
+ export declare const NEVER_SELECT: readonly ['AccessToken', 'RequestToken', 'DeleteToken'];
5
+ export declare class OauthTokenInventoryCheck implements SecurityCheck {
6
+ readonly id = "oauth-token-inventory";
7
+ readonly name = "Standing OAuth Token Inventory";
8
+ readonly category = "App Security";
9
+ readonly description = "Inventories live OAuth tokens per app: a standing refresh token grants API access without any new login";
10
+ readonly dependsOnCache: readonly ['connectedAppNames'];
11
+ run(ctx: AuditContext): Promise<CheckResult>;
12
+ private inconclusive;
13
+ }
14
+ //# sourceMappingURL=OauthTokenInventoryCheck.d.ts.map
@@ -0,0 +1,204 @@
1
+ import { describeFields } from '@cclabsnz/sf-core';
2
+ /**
3
+ * Priority order. `AppName` is the only one the check cannot work without.
4
+ *
5
+ * `OauthToken` also defines `AccessToken`, `RequestToken` and `DeleteToken`, all queryable
6
+ * strings. None of them appear here and none may ever be added: findings are written to an HTML
7
+ * or JSON report on disk, so selecting token material would turn an audit artefact into a
8
+ * credential file. `NEVER_SELECT` is asserted in the unit tests.
9
+ */
10
+ const PREFERRED_FIELDS = [
11
+ 'AppName',
12
+ 'UserId',
13
+ 'LastUsedDate',
14
+ 'UseCount',
15
+ 'CreatedDate',
16
+ ];
17
+ /** Queryable on OauthToken and permanently excluded: an audit report must not carry credentials. */
18
+ export const NEVER_SELECT = ['AccessToken', 'RequestToken', 'DeleteToken'];
19
+ /** Ceiling on rows pulled. Large orgs hold a token per user per app, which multiplies fast. */
20
+ const MAX_TOKEN_ROWS = 5000;
21
+ /** A token unused for this long is a standing grant nobody is exercising. */
22
+ const STALE_DAYS = 90;
23
+ /**
24
+ * Salesforce-owned clients that hold tokens in ordinary orgs and are absent from
25
+ * `ConnectedApplication` by design, so matching them against it always "fails". Lower-cased
26
+ * for comparison. A floor, not a complete list: an unrecognised first-party client is
27
+ * reported rather than hidden, which is the safe direction to be wrong in. Add names here as
28
+ * they are confirmed to be Salesforce-owned.
29
+ */
30
+ const FIRST_PARTY_APPS = new Set([
31
+ 'salesforce cli',
32
+ 'salesforce mobile dashboards',
33
+ 'salesforce for outlook',
34
+ 'salesforce dataloader',
35
+ 'dataloader partner',
36
+ 'dataloader bulk',
37
+ 'workbench',
38
+ 'sfdx cli',
39
+ 'salesforce inspector',
40
+ ]);
41
+ export class OauthTokenInventoryCheck {
42
+ id = 'oauth-token-inventory';
43
+ name = 'Standing OAuth Token Inventory';
44
+ category = 'App Security';
45
+ description = 'Inventories live OAuth tokens per app: a standing refresh token grants API access without any new login';
46
+ dependsOnCache = ['connectedAppNames'];
47
+ async run(ctx) {
48
+ const findings = [];
49
+ const setupUrl = `${ctx.orgInfo.instanceUrl}/lightning/setup/ConnectedApplication/home`;
50
+ let fields = [];
51
+ try {
52
+ const described = await describeFields(ctx.rest, 'OauthToken', PREFERRED_FIELDS);
53
+ // Enforce the exclusion here rather than trusting the preferred list to stay clean.
54
+ // describeFields returns what the org defines, and this check builds a SELECT that ends
55
+ // up in a report file on disk, so the filter belongs at the point the query is built.
56
+ fields = described.filter((f) => !NEVER_SELECT.some((n) => n.toLowerCase() === f.toLowerCase()));
57
+ }
58
+ catch {
59
+ findings.push(this.inconclusive('OauthToken could not be described'));
60
+ return { findings };
61
+ }
62
+ if (!fields.includes('AppName')) {
63
+ findings.push(this.inconclusive('OauthToken does not expose AppName in this org, so tokens cannot be attributed to an app'));
64
+ return { findings };
65
+ }
66
+ let records = [];
67
+ try {
68
+ const result = await ctx.soql.query(`SELECT ${fields.join(', ')} FROM OauthToken LIMIT ${MAX_TOKEN_ROWS}`);
69
+ records = result.records ?? [];
70
+ }
71
+ catch {
72
+ findings.push(this.inconclusive('OauthToken was not readable. Standing OAuth grants cannot be inventoried without it'));
73
+ return { findings };
74
+ }
75
+ if (records.length === 0) {
76
+ findings.push({
77
+ id: 'oauth-token-inventory-none',
78
+ category: this.category,
79
+ riskLevel: 'LOW',
80
+ passed: true,
81
+ title: 'No standing OAuth tokens found',
82
+ detail: 'No rows were returned from OauthToken, so no app currently holds a standing OAuth authorisation in this org.',
83
+ remediation: 'Re-check after authorising any new integration.',
84
+ });
85
+ return { findings };
86
+ }
87
+ // Aggregate client-side rather than with GROUP BY. Aggregate support varies across these
88
+ // system objects, and a rejected GROUP BY would surface as "no tokens" rather than an error.
89
+ const byApp = new Map();
90
+ for (const r of records) {
91
+ const app = (r.AppName ?? '').trim();
92
+ if (!app)
93
+ continue;
94
+ const key = app.toLowerCase();
95
+ let summary = byApp.get(key);
96
+ if (!summary) {
97
+ summary = { app, tokens: 0, users: new Set(), lastUsed: null };
98
+ byApp.set(key, summary);
99
+ }
100
+ summary.tokens += 1;
101
+ if (r.UserId)
102
+ summary.users.add(r.UserId);
103
+ const used = r.LastUsedDate ?? null;
104
+ if (used && (summary.lastUsed === null || used > summary.lastUsed)) {
105
+ summary.lastUsed = used;
106
+ }
107
+ }
108
+ const summaries = [...byApp.values()].sort((a, b) => b.tokens - a.tokens);
109
+ const truncated = records.length >= MAX_TOKEN_ROWS;
110
+ // The finding that matters: a live token whose app shows no recent interactive OAuth login.
111
+ // connectedAppNames is what ConnectedAppsCheck saw in ConnectedApplication; an app holding
112
+ // tokens that is absent from it is a grant with no current app definition behind it.
113
+ const knownApps = new Set((ctx.cache.connectedAppNames ?? []).map((n) => n.toLowerCase()));
114
+ // With an empty inventory every token is trivially "unmatched", which would emit a wall of
115
+ // findings for apps that may all be benign, and would break --fail-on for anyone whose
116
+ // audit user cannot read ConnectedApplication. An org whose read returned nothing has not
117
+ // been shown to have a problem, it has failed to provide the evidence, so the comparison
118
+ // is skipped rather than assumed.
119
+ const canCrossReference = knownApps.size > 0;
120
+ const unmatched = canCrossReference
121
+ ? summaries.filter((s) => !knownApps.has(s.app.toLowerCase()) && !FIRST_PARTY_APPS.has(s.app.toLowerCase()))
122
+ : [];
123
+ const cutoff = new Date(Date.now() - STALE_DAYS * 86_400_000).toISOString();
124
+ const stale = summaries.filter((s) => s.lastUsed !== null && s.lastUsed < cutoff);
125
+ const neverUsed = summaries.filter((s) => s.lastUsed === null);
126
+ if (unmatched.length > 0) {
127
+ findings.push({
128
+ id: 'oauth-token-unmatched-app',
129
+ category: this.category,
130
+ riskLevel: 'MEDIUM',
131
+ title: `${unmatched.length} app(s) hold live OAuth tokens but do not appear in the connected app inventory`,
132
+ detail: `${unmatched.length} app name(s) on live OauthToken rows were not among the ${knownApps.size} connected apps read from ConnectedApplication. ` +
133
+ 'A standing token whose app definition is missing, renamed, or installed outside the connected app list is access nobody is reviewing. ' +
134
+ 'Because a refresh token is exchanged without producing an OAuth login row, this access does not appear in LoginHistory and will not be reported by the inactivity check.',
135
+ remediation: 'Identify each app. Where it is not a recognised integration with a named owner, revoke its tokens from the user detail page or via the OAuth Connected Apps Usage page, which invalidates the refresh token. Deactivating a user does not revoke a token that a third party holds.',
136
+ affectedItems: unmatched.map((s) => ({
137
+ label: s.app,
138
+ url: setupUrl,
139
+ note: `${s.tokens} token(s), ${s.users.size} user(s), last used ${s.lastUsed ?? 'never recorded'}`,
140
+ })),
141
+ });
142
+ }
143
+ if (!canCrossReference) {
144
+ findings.push({
145
+ id: 'oauth-token-no-app-inventory',
146
+ category: this.category,
147
+ riskLevel: 'INFO',
148
+ inconclusive: true,
149
+ title: 'Standing tokens could not be cross-referenced against the connected app inventory',
150
+ detail: 'ConnectedApplication returned no rows, so tokens cannot be matched to a reviewable app definition. The inventory below is still accurate; only the comparison is missing.',
151
+ remediation: 'Grant the audit user read access to ConnectedApplication, then re-run so standing tokens can be matched against declared apps.',
152
+ });
153
+ }
154
+ if (stale.length > 0 || neverUsed.length > 0) {
155
+ const items = [...stale, ...neverUsed];
156
+ findings.push({
157
+ id: 'oauth-token-stale',
158
+ category: this.category,
159
+ riskLevel: items.length > 5 ? 'MEDIUM' : 'LOW',
160
+ title: `${items.length} app(s) hold OAuth tokens unused for ${STALE_DAYS}+ days`,
161
+ detail: `${stale.length} app(s) last used a token more than ${STALE_DAYS} days ago and ${neverUsed.length} have no recorded last-used date. ` +
162
+ 'An unused token is still a working credential. If the app or its vendor is compromised, the token is replayed against this org with no login and no user interaction.',
163
+ remediation: 'Revoke tokens for integrations that are no longer in use. Treat a vendor breach notification as a trigger to revoke every token for that publisher rather than waiting to confirm your own org was touched.',
164
+ affectedItems: items.map((s) => ({
165
+ label: s.app,
166
+ url: setupUrl,
167
+ note: `${s.tokens} token(s), ${s.users.size} user(s), last used ${s.lastUsed ?? 'never recorded'}`,
168
+ })),
169
+ });
170
+ }
171
+ findings.push({
172
+ id: 'oauth-token-inventory',
173
+ category: this.category,
174
+ riskLevel: 'INFO',
175
+ title: `${summaries.length} app(s) hold ${records.length}${truncated ? '+' : ''} standing OAuth token(s)`,
176
+ detail: `Live OAuth authorisations by app, from OauthToken. Each row is an access or refresh token that can be exchanged for API access without a new login.` +
177
+ (truncated
178
+ ? ` Row cap of ${MAX_TOKEN_ROWS} was reached, so this is a floor rather than a complete count.`
179
+ : '') +
180
+ (fields.length < PREFERRED_FIELDS.length
181
+ ? ` This org exposes ${fields.length} of ${PREFERRED_FIELDS.length} OauthToken fields, so some columns below are blank.`
182
+ : ''),
183
+ remediation: 'Keep this list to integrations with a named owner and a business justification, and re-run it after any vendor breach disclosure.',
184
+ affectedItems: summaries.map((s) => ({
185
+ label: s.app,
186
+ url: setupUrl,
187
+ note: `${s.tokens} token(s), ${s.users.size} user(s), last used ${s.lastUsed ?? 'never recorded'}`,
188
+ })),
189
+ });
190
+ return { findings };
191
+ }
192
+ inconclusive(reason) {
193
+ return {
194
+ id: 'oauth-token-inventory-inconclusive',
195
+ category: this.category,
196
+ riskLevel: 'INFO',
197
+ inconclusive: true,
198
+ title: 'Standing OAuth tokens could not be inventoried',
199
+ detail: `${reason}. Apps holding refresh tokens cannot be listed, and those grants do not appear in LoginHistory.`,
200
+ remediation: 'Grant the audit user read access to OauthToken, then re-run. Until then, review OAuth Connected Apps Usage in Setup by hand.',
201
+ };
202
+ }
203
+ }
204
+ //# sourceMappingURL=OauthTokenInventoryCheck.js.map
@@ -26,6 +26,7 @@ import { StandardProfilesCheck } from './impl/StandardProfilesCheck.js';
26
26
  import { SsoEnforcementCheck } from './impl/SsoEnforcementCheck.js';
27
27
  import { MfaEnforcementCheck } from './impl/MfaEnforcementCheck.js';
28
28
  import { ApiClientPermissionCheck } from './impl/ApiClientPermissionCheck.js';
29
+ import { SoapLoginApiAuthCheck } from './impl/SoapLoginApiAuthCheck.js';
29
30
  import { IntegrationUsersCheck } from './impl/IntegrationUsersCheck.js';
30
31
  import { IntegrationLeastPrivilegeCheck } from './impl/IntegrationLeastPrivilegeCheck.js';
31
32
  import { ContentLinksCheck } from './impl/ContentLinksCheck.js';
@@ -45,6 +46,7 @@ import { TrustedIPRangesCheck } from './impl/TrustedIPRangesCheck.js';
45
46
  import { AnonymousApexAuditCheck } from './impl/AnonymousApexAuditCheck.js';
46
47
  import { DebugLogAccessCheck } from './impl/DebugLogAccessCheck.js';
47
48
  import { ConnectedAppInactivityCheck } from './impl/ConnectedAppInactivityCheck.js';
49
+ import { OauthTokenInventoryCheck } from './impl/OauthTokenInventoryCheck.js';
48
50
  import { MyDomainLoginPolicyCheck } from './impl/MyDomainLoginPolicyCheck.js';
49
51
  import { InternalUserMfaCheck } from './impl/InternalUserMfaCheck.js';
50
52
  import { MfaRegistrationCheck } from './impl/MfaRegistrationCheck.js';
@@ -127,6 +129,7 @@ export const CHECKS = [
127
129
  new SsoEnforcementCheck(), // SBS-AUTH-001/002
128
130
  new MfaEnforcementCheck(), // SBS-AUTH-004 (portal users)
129
131
  new ApiClientPermissionCheck(), // SBS-ACS-006
132
+ new SoapLoginApiAuthCheck(), // Winter '27 SOAP login() readiness; distinct from Use Any API Client above
130
133
  new IntegrationUsersCheck(), // SBS-ACS-007/008/009
131
134
  new IntegrationLeastPrivilegeCheck(), // permissions integration accounts hold and do not use
132
135
  new ContentLinksCheck(), // SBS-FILE-001/002/003
@@ -179,6 +182,7 @@ export const CHECKS = [
179
182
  new DeploymentIdentityCheck(), // reads connectedAppNames
180
183
  new ApexLoggingCheck(), // reads apexBodies + scheduledApexClassNames
181
184
  new ConnectedAppInactivityCheck(), // reads connectedAppNames
185
+ new OauthTokenInventoryCheck(), // reads connectedAppNames; standing tokens LoginHistory cannot see
182
186
  new ApexCrudFLSCheck(), // reads apexBodies
183
187
  new GuestExecutableApexCheck(), // reads apexBodies — guest-reachable Apex sharing
184
188
  new ApexRestEndpointCheck(), // reads apexBodies
@@ -31,6 +31,7 @@ const BASE_CHECK_CONTROL_MAP = {
31
31
  'sso-enforcement': ['OWASP-A07', 'SOC2-CC6.1', 'ISO-A.8.3', 'SBS-AUTH-001', 'SBS-AUTH-002'],
32
32
  'mfa-enforcement': ['OWASP-A07', 'SOC2-CC6.1', 'ISO-A.8.3', 'SBS-AUTH-004'],
33
33
  'api-client-permission': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.8.3', 'SBS-ACS-006'],
34
+ 'soap-login-api-auth': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.18'],
34
35
  'integration-users': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.18', 'SBS-ACS-007', 'SBS-ACS-008', 'SBS-ACS-009'],
35
36
  'integration-least-privilege': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.5.18', 'SBS-ACS-008', 'SBS-ACS-009'],
36
37
  'content-links': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.14', 'SBS-FILE-001', 'SBS-FILE-002', 'SBS-FILE-003'],
@@ -49,6 +50,7 @@ const BASE_CHECK_CONTROL_MAP = {
49
50
  'anonymous-apex-audit': ['OWASP-A09', 'SOC2-CC7.2', 'ISO-A.8.15'],
50
51
  'debug-log-access': ['OWASP-A09', 'SOC2-CC7.2', 'ISO-A.8.15'],
51
52
  'connected-app-inactivity': ['OWASP-A05', 'SOC2-CC6.6', 'ISO-A.5.18'],
53
+ 'oauth-token-inventory': ['OWASP-A05', 'SOC2-CC6.6', 'ISO-A.5.18'],
52
54
  'my-domain-login-policy': ['OWASP-A07', 'SOC2-CC6.1', 'ISO-A.8.3', 'SBS-AUTH-001'],
53
55
  'high-assurance-session': ['OWASP-A07', 'SOC2-CC6.1', 'ISO-A.8.3'],
54
56
  'enhanced-domains': ['OWASP-A05', 'SOC2-CC6.1', 'ISO-A.8.26'],
@@ -113,7 +115,7 @@ const BASE_CHECK_CONTROL_MAP = {
113
115
  // so the two cannot drift apart in which checks they consider part of a domain.
114
116
  const DOMAIN = {
115
117
  accessControl: ['users-and-admins', 'permissions', 'sharing-model', 'public-group-sharing', 'guest-user-access',
116
- 'field-level-security', 'standard-profiles', 'api-client-permission', 'integration-users',
118
+ 'field-level-security', 'standard-profiles', 'api-client-permission', 'soap-login-api-auth', 'integration-users',
117
119
  'integration-least-privilege',
118
120
  'escalation-perms', 'report-folder-access', 'apex-crud-fls', 'apex-rest-endpoint',
119
121
  'guest-executable-apex', 'experience-cloud-site', 'content-links', 'apex-sharing', 'flows-without-sharing',
@@ -130,7 +132,7 @@ const DOMAIN = {
130
132
  'debug-log-access', 'transaction-security-policy', 'threat-detection', 'guest-traffic-anomaly',
131
133
  'login-anomaly'],
132
134
  devSecurity: ['code-security', 'visualforce-xss', 'scheduled-apex'],
133
- network: ['remote-sites', 'csp-trusted-sites', 'connected-apps', 'connected-app-scope', 'connected-app-inactivity', 'cors-allowlist',
135
+ network: ['remote-sites', 'csp-trusted-sites', 'connected-apps', 'connected-app-scope', 'connected-app-inactivity', 'oauth-token-inventory', 'cors-allowlist',
134
136
  'email-security', 'outbound-messages', 'experience-csp'],
135
137
  dataGovernance: ['data-classification', 'field-history-tracking', 'sandbox-data-masking'],
136
138
  configGovernance: ['health-check', 'api-limits', 'release-updates', 'legacy-api-version', 'installed-packages', 'deployment-identity', 'session-hardening'],
@@ -26,6 +26,7 @@ export const CHECK_META = {
26
26
  'sso-enforcement': { effort: 'project', impact: 'Without enforced SSO, username/password logins bypass your identity provider’s MFA and conditional access.' },
27
27
  'mfa-enforcement': { effort: 'quick', impact: 'Portal/external users without MFA let a stolen password reach customer or partner data directly.' },
28
28
  'api-client-permission': { effort: 'quick', impact: '“Use Any API Client” bypasses API Access Control, letting a user reach the org from any tool.' },
29
+ 'soap-login-api-auth': { effort: 'quick', impact: 'SOAP login() callers without Use Any API Auth stop authenticating in Winter \'27, server to server, with no UI error.' },
29
30
  'integration-users': { effort: 'moderate', impact: 'Over-privileged service accounts are prime targets: one stolen key grants broad, unattended access.' },
30
31
  'integration-least-privilege': { effort: 'moderate', impact: 'An integration account keeps whatever it was granted at go-live: long-lived credentials, no interactive user to notice misuse, and frequently outside MFA and IP restrictions. Every permission it is not using is standing privilege waiting on a leaked key.' },
31
32
  'content-links': { effort: 'quick', impact: 'Public file links without expiry or password leak documents to anyone who finds the URL.' },
@@ -44,6 +45,7 @@ export const CHECK_META = {
44
45
  'anonymous-apex-audit': { effort: 'quick', impact: 'Anonymous Apex execution in production can run arbitrary privileged code leaving little trace.' },
45
46
  'debug-log-access': { effort: 'quick', impact: 'Active high-detail debug traces capture sensitive field values readable by anyone with log access.' },
46
47
  'connected-app-inactivity': { effort: 'quick', impact: 'Stale connected apps remain authorized attack surface long after they’re abandoned.' },
48
+ 'oauth-token-inventory': { effort: 'quick', impact: 'A standing refresh token is replayed for API access without any login, so a breached vendor keeps working access.' },
47
49
  'my-domain-login-policy': { effort: 'quick', impact: 'Allowing login.salesforce.com login bypasses My Domain SSO enforcement.' },
48
50
  'high-assurance-session': { effort: 'moderate', impact: 'Admin-capable apps without short or high-assurance sessions let a hijacked session retain elevated rights.' },
49
51
  'enhanced-domains': { effort: 'moderate', impact: 'Without Enhanced Domains, cross-org cookie leakage and URL spoofing become possible.' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cclabsnz/sf-audit",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "description": "Read-only Salesforce security audit for the sf CLI: 88 checks, attack-chain correlation, A-F risk grading, and compliance mapping to OWASP, SOC 2, ISO 27001, NZISM and more.",
5
5
  "keywords": [
6
6
  "salesforce",
@@ -99,7 +99,8 @@
99
99
  "js-yaml@3": "^3.15.1",
100
100
  "handlebars": "^4.7.9",
101
101
  "brace-expansion": "^5.0.9",
102
- "fast-uri@3": "^3.1.6"
102
+ "fast-uri@3": "^3.1.6",
103
+ "browserslist": "^4.28.7"
103
104
  }
104
105
  }
105
106
  }