@cclabsnz/sf-audit 1.6.1 → 1.7.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/README.md +96 -5
- package/lib/apps/analyzeApps.d.ts +1 -1
- package/lib/apps/appResolver.d.ts +1 -1
- package/lib/apps/grantedAccess.d.ts +1 -1
- package/lib/chains/AttackChain.d.ts +1 -1
- package/lib/chains/namedChains.d.ts +1 -1
- package/lib/checks/CheckEngine.d.ts +1 -1
- package/lib/checks/SecurityCheck.d.ts +3 -3
- package/lib/checks/impl/AgentActionSurfaceCheck.d.ts +1 -1
- package/lib/checks/impl/AgentActionSurfaceCheck.js +1 -1
- package/lib/checks/impl/AgentChannelExposureCheck.d.ts +1 -1
- package/lib/checks/impl/AgentInventoryCheck.d.ts +1 -1
- package/lib/checks/impl/AgentInventoryCheck.js +1 -1
- package/lib/checks/impl/AgentMonitoringCoverageCheck.d.ts +1 -1
- package/lib/checks/impl/AgentUserPrivilegeCheck.d.ts +1 -1
- package/lib/checks/impl/AnonymousApexAuditCheck.d.ts +1 -1
- package/lib/checks/impl/ApexCrudFLSCheck.d.ts +1 -1
- package/lib/checks/impl/ApexLoggingCheck.d.ts +1 -1
- package/lib/checks/impl/ApexRestEndpointCheck.d.ts +1 -1
- package/lib/checks/impl/ApexSharingCheck.d.ts +1 -1
- package/lib/checks/impl/ApexSharingCheck.js +3 -2
- package/lib/checks/impl/ApiClientPermissionCheck.d.ts +1 -1
- package/lib/checks/impl/ApiLimitsCheck.d.ts +1 -1
- package/lib/checks/impl/AuditTrailCheck.d.ts +1 -1
- package/lib/checks/impl/AuthProvidersCheck.d.ts +1 -1
- package/lib/checks/impl/CertificateExpiryCheck.d.ts +1 -1
- package/lib/checks/impl/ClassicSitesCheck.d.ts +1 -1
- package/lib/checks/impl/CodeSecurityCheck.d.ts +1 -1
- package/lib/checks/impl/CodeSecurityCheck.js +5 -5
- package/lib/checks/impl/ConnectedAppInactivityCheck.d.ts +1 -1
- package/lib/checks/impl/ConnectedAppScopeCheck.d.ts +1 -1
- package/lib/checks/impl/ConnectedAppsCheck.d.ts +1 -1
- package/lib/checks/impl/ContentLinksCheck.d.ts +1 -1
- package/lib/checks/impl/CorsAllowlistCheck.d.ts +1 -1
- package/lib/checks/impl/CspTrustedSitesCheck.d.ts +1 -1
- package/lib/checks/impl/CustomLabelsCredentialCheck.d.ts +1 -1
- package/lib/checks/impl/CustomSettingsCheck.d.ts +1 -1
- package/lib/checks/impl/DataClassificationCheck.d.ts +1 -1
- package/lib/checks/impl/DataExportAccessCheck.d.ts +1 -1
- package/lib/checks/impl/DebugLogAccessCheck.d.ts +1 -1
- package/lib/checks/impl/DeploymentIdentityCheck.d.ts +1 -1
- package/lib/checks/impl/EmailSecurityCheck.d.ts +1 -1
- package/lib/checks/impl/EncryptionCoverageCheck.d.ts +1 -1
- package/lib/checks/impl/EnhancedDomainsCheck.d.ts +1 -1
- package/lib/checks/impl/EnhancedDomainsCheck.js +2 -2
- package/lib/checks/impl/EscalationPermsCheck.d.ts +1 -1
- package/lib/checks/impl/EventMonitoringCheck.d.ts +1 -1
- package/lib/checks/impl/EventMonitoringCheck.js +1 -1
- package/lib/checks/impl/ExperienceCloudSiteCheck.d.ts +1 -1
- package/lib/checks/impl/ExperienceCspCheck.d.ts +1 -1
- package/lib/checks/impl/ExternalCredentialsCheck.d.ts +1 -1
- package/lib/checks/impl/FailedLoginCheck.d.ts +1 -1
- package/lib/checks/impl/FieldHistoryTrackingCheck.d.ts +1 -1
- package/lib/checks/impl/FieldLevelSecurityCheck.d.ts +1 -1
- package/lib/checks/impl/FlowsWithoutSharingCheck.d.ts +1 -1
- package/lib/checks/impl/FlowsWithoutSharingCheck.js +10 -9
- package/lib/checks/impl/GuestApiAccessCheck.d.ts +1 -1
- package/lib/checks/impl/GuestExecutableApexCheck.d.ts +1 -1
- package/lib/checks/impl/GuestExecutableApexCheck.js +4 -3
- package/lib/checks/impl/GuestObjectExposureCheck.d.ts +1 -1
- package/lib/checks/impl/GuestRecordAccessPolicyCheck.d.ts +1 -1
- package/lib/checks/impl/GuestSiteOptionsCheck.d.ts +1 -1
- package/lib/checks/impl/GuestTrafficAnomalyCheck.d.ts +1 -1
- package/lib/checks/impl/GuestTrafficAnomalyCheck.js +1 -1
- package/lib/checks/impl/GuestUserAccessCheck.d.ts +1 -1
- package/lib/checks/impl/HardcodedCredentialsCheck.d.ts +1 -1
- package/lib/checks/impl/HardcodedCredentialsCheck.js +8 -1
- package/lib/checks/impl/HealthCheckCheck.d.ts +1 -1
- package/lib/checks/impl/HighAssuranceSessionCheck.d.ts +1 -1
- package/lib/checks/impl/InactiveUsersCheck.d.ts +1 -1
- package/lib/checks/impl/InstalledPackagesCheck.d.ts +1 -1
- package/lib/checks/impl/IntegrationUsersCheck.d.ts +1 -1
- package/lib/checks/impl/InternalUserMfaCheck.d.ts +1 -1
- package/lib/checks/impl/IpRestrictionsCheck.d.ts +1 -1
- package/lib/checks/impl/LegacyApiVersionCheck.d.ts +1 -1
- package/lib/checks/impl/LoginAccessPolicyCheck.d.ts +1 -1
- package/lib/checks/impl/LoginAnomalyCheck.d.ts +1 -1
- package/lib/checks/impl/LoginSessionCheck.d.ts +1 -1
- package/lib/checks/impl/MfaEnforcementCheck.d.ts +1 -1
- package/lib/checks/impl/MfaMethodStrengthCheck.d.ts +1 -1
- package/lib/checks/impl/MfaRegistrationCheck.d.ts +1 -1
- package/lib/checks/impl/MyDomainLoginPolicyCheck.d.ts +1 -1
- package/lib/checks/impl/NamedCredentialsCheck.d.ts +1 -1
- package/lib/checks/impl/NamedCredentialsCheck.js +7 -6
- package/lib/checks/impl/OutboundMessagesCheck.d.ts +1 -1
- package/lib/checks/impl/PasswordSessionPolicyCheck.d.ts +2 -2
- package/lib/checks/impl/PermissionsCheck.d.ts +1 -1
- package/lib/checks/impl/PrivilegedAccessCheck.d.ts +1 -1
- package/lib/checks/impl/PublicContentExposureCheck.d.ts +1 -1
- package/lib/checks/impl/PublicGroupSharingCheck.d.ts +1 -1
- package/lib/checks/impl/ReleaseUpdatesCheck.d.ts +1 -1
- package/lib/checks/impl/RemoteSitesCheck.d.ts +1 -1
- package/lib/checks/impl/ReportFolderAccessCheck.d.ts +1 -1
- package/lib/checks/impl/SandboxDataMaskingCheck.d.ts +1 -1
- package/lib/checks/impl/ScheduledApexCheck.d.ts +1 -1
- package/lib/checks/impl/SeparationOfDutiesCheck.d.ts +1 -1
- package/lib/checks/impl/SessionHardeningCheck.d.ts +1 -1
- package/lib/checks/impl/SharingModelCheck.d.ts +1 -1
- package/lib/checks/impl/SiemIntegrationCheck.d.ts +1 -1
- package/lib/checks/impl/SsoEnforcementCheck.d.ts +1 -1
- package/lib/checks/impl/StandardProfilesCheck.d.ts +1 -1
- package/lib/checks/impl/ThreatDetectionCheck.d.ts +1 -1
- package/lib/checks/impl/TransactionSecurityPolicyCheck.d.ts +1 -1
- package/lib/checks/impl/TrustedIPRangesCheck.d.ts +1 -1
- package/lib/checks/impl/TrustedUrlHygieneCheck.d.ts +1 -1
- package/lib/checks/impl/UsersAndAdminsCheck.d.ts +1 -1
- package/lib/checks/impl/VisualforceXssCheck.d.ts +1 -1
- package/lib/commands/audit/events/pull.d.ts +1 -1
- package/lib/commands/audit/events/pull.js +3 -3
- package/lib/commands/audit/security.js +3 -1
- package/lib/findings/AuditResult.d.ts +1 -1
- package/lib/findings/Finding.d.ts +1 -1
- package/lib/findings/ScoringConfig.d.ts +9 -217
- package/lib/findings/scoring.d.ts +2 -2
- package/lib/findings/scoring.js +1 -1
- package/lib/history/AuditDiff.d.ts +1 -1
- package/lib/history/metricMeta.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/lib/wire.d.ts +6 -6
- package/lib/lib/wire.js +4 -4
- package/lib/renderers/ClientReportRenderer.d.ts +1 -1
- package/lib/renderers/ClientReportRenderer.js +6 -3
- package/lib/renderers/HistoryRenderer.js +2 -1
- package/lib/renderers/HtmlRenderer.js +3 -4
- package/lib/renderers/MarkdownRenderer.js +1 -1
- package/lib/renderers/chartAsset.d.ts +12 -0
- package/lib/renderers/chartAsset.js +25 -0
- package/package.json +20 -18
- package/lib/api/ApiError.d.ts +0 -6
- package/lib/api/ApiError.js +0 -6
- package/lib/api/MetadataClient.d.ts +0 -4
- package/lib/api/MetadataClient.js +0 -2
- package/lib/api/MetadataClientImpl.d.ts +0 -8
- package/lib/api/MetadataClientImpl.js +0 -22
- package/lib/api/RestClient.d.ts +0 -6
- package/lib/api/RestClient.js +0 -2
- package/lib/api/RestClientImpl.d.ts +0 -10
- package/lib/api/RestClientImpl.js +0 -45
- package/lib/api/SoqlClient.d.ts +0 -10
- package/lib/api/SoqlClient.js +0 -2
- package/lib/api/SoqlClientImpl.d.ts +0 -9
- package/lib/api/SoqlClientImpl.js +0 -19
- package/lib/api/ToolingClient.d.ts +0 -5
- package/lib/api/ToolingClient.js +0 -2
- package/lib/api/ToolingClientImpl.d.ts +0 -10
- package/lib/api/ToolingClientImpl.js +0 -29
- package/lib/api/index.d.ts +0 -9
- package/lib/api/index.js +0 -5
- package/lib/checks/eventLogAccess.d.ts +0 -14
- package/lib/checks/eventLogAccess.js +0 -33
- package/lib/context/AuditCache.d.ts +0 -78
- package/lib/context/AuditCache.js +0 -2
- package/lib/context/AuditContext.d.ts +0 -19
- package/lib/context/AuditContext.js +0 -2
- package/lib/context/OrgInfo.d.ts +0 -9
- package/lib/context/OrgInfo.js +0 -2
- package/lib/context/OrgMetrics.d.ts +0 -20
- package/lib/context/OrgMetrics.js +0 -20
- package/lib/events/EventBaselineStore.d.ts +0 -16
- package/lib/events/EventBaselineStore.js +0 -55
- package/lib/events/eventLogQuery.d.ts +0 -21
- package/lib/events/eventLogQuery.js +0 -34
- package/lib/events/pullEventLogs.d.ts +0 -51
- package/lib/events/pullEventLogs.js +0 -79
- package/lib/findings/RiskLevel.d.ts +0 -3
- package/lib/findings/RiskLevel.js +0 -2
- package/lib/renderers/html-utils.d.ts +0 -2
- package/lib/renderers/html-utils.js +0 -8
- package/lib/report/branding.d.ts +0 -18
- package/lib/report/branding.js +0 -19
- package/lib/report/fonts.d.ts +0 -2
- package/lib/report/fonts.js +0 -22
- package/src/assets/fonts/dm-sans-italic-latin.woff2 +0 -0
- package/src/assets/fonts/dm-sans-normal-latin.woff2 +0 -0
- package/src/assets/fonts/dm-serif-display-italic-latin.woff2 +0 -0
- package/src/assets/fonts/dm-serif-display-normal-latin.woff2 +0 -0
package/README.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://cloudcounsel.co.nz"><img src="https://raw.githubusercontent.com/cclabsnz/sf-audit-plugin/main/assets/cloudcounsel-lockup.png" width="240" alt="CloudCounsel Ltd" /></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
# @cclabsnz/sf-audit
|
|
2
6
|
|
|
3
7
|
[](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/ci.yml)
|
|
4
8
|
[](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/codeql.yml)
|
|
9
|
+
[](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/semgrep.yml)
|
|
5
10
|
[](https://securityscorecards.dev/viewer/?uri=github.com/cclabsnz/sf-audit-plugin)
|
|
6
11
|
[](https://www.npmjs.com/package/@cclabsnz/sf-audit)
|
|
7
|
-
[](https://www.npmjs.com/package/@cclabsnz/sf-audit#provenance)
|
|
8
13
|
[](LICENSE)
|
|
9
14
|
|
|
10
15
|
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.
|
|
@@ -286,7 +291,7 @@ Findings are mapped to controls across eight security and privacy frameworks. Th
|
|
|
286
291
|
|
|
287
292
|
> **Not an attestation.** A control rendering "No findings detected" means this audit's checks surfaced no issues mapped to it. It is **not** a statement of compliance or certification. See [Scope & Liability](#scope--liability).
|
|
288
293
|
|
|
289
|
-
**Further reading:** [Mapping Salesforce security to NZISM, the NZ Privacy Act and ISO 27001](https://
|
|
294
|
+
**Further reading:** [Mapping Salesforce security to NZISM, the NZ Privacy Act and ISO 27001](https://softwareinsights.dev/posts/salesforce-security-nzism-nz-privacy-act/) and [Why Salesforce Health Cloud needs its own security review](https://softwareinsights.dev/posts/salesforce-health-cloud-security-review/). More in [Further reading](#further-reading).
|
|
290
295
|
|
|
291
296
|
## Scope & Liability
|
|
292
297
|
|
|
@@ -305,11 +310,52 @@ Findings are mapped to controls across eight security and privacy frameworks. Th
|
|
|
305
310
|
|
|
306
311
|
Because this tool authenticates against production orgs, "is it safe to run?" deserves a verifiable answer, not just a claim. Here's how you can check for yourself:
|
|
307
312
|
|
|
308
|
-
- **Read-only, enforced in CI.** The "no writes to your org" promise is a passing test, not a footnote. `test/unit/
|
|
309
|
-
- **
|
|
310
|
-
|
|
313
|
+
- **Read-only, enforced in CI.** The "no writes to your org" promise is a passing test, not a footnote. `test/unit/invariants/readonly-invariant.test.ts` statically scans this package's entire source tree and fails the build if any jsforce mutation API, HTTP write verb, or bulk/composite write path ever appears. Every org request funnels through the core clients (`@cclabsnz/sf-core`, `src/api/*ClientImpl.ts`), which issue only SOQL queries, REST **GET**s, and Metadata reads. Each package in the monorepo runs the same guard against its own source, so nothing is covered by omission.
|
|
314
|
+
- **Nothing phones home, enforced the same way.** `test/unit/invariants/network-egress.test.ts` fails the build on any third-party HTTP client, raw `node:http`/`https` use, telemetry/analytics/LLM endpoint, or websocket — and on any remote asset (`<script src>`, `<link href>`, `@import`) in a generated report. The only network destination is the org you authenticated against. Generated HTML reports are **fully self-contained**: webfonts are embedded as data URIs and Chart.js is inlined, so opening a report never calls out to a CDN — which matters, because reports carry sensitive findings and are often opened offline. Run both guards yourself:
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
pnpm --filter @cclabsnz/sf-audit test test/unit/invariants
|
|
318
|
+
```
|
|
319
|
+
- **What you install matches the public source.** Releases are published from GitHub Actions via [npm trusted publishing (OIDC)](https://docs.npmjs.com/trusted-publishers) with [build provenance](https://docs.npmjs.com/generating-provenance-statements) — no long-lived token, and the npm page shows a signed attestation linking the tarball to the exact public commit that built it. Verify it yourself:
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
npm audit signatures # reports "verified attestations" for @cclabsnz/sf-audit
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
- **Independent scans on every change.** Two static-analysis engines — [CodeQL](https://github.com/cclabsnz/sf-audit-plugin/security/code-scanning) (`security-extended`, of both the source **and** the CI workflows) and [Semgrep](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/semgrep.yml) (OWASP Top 10 + security-audit rulesets) — an [OpenSSF Scorecard](https://securityscorecards.dev/viewer/?uri=github.com/cclabsnz/sf-audit-plugin) supply-chain review, a PR **dependency-review** gate (vulnerabilities **and** a copyleft-license policy), and a `pnpm audit` gate — plus Dependabot, and GitHub secret scanning with push protection. All GitHub Actions are pinned to commit SHAs. Each release ships a CycloneDX **SBOM**.
|
|
326
|
+
- **Regulated-environment readiness.** The above give reviewers a paper trail for procurement: SBOM per release, an enforced dependency **license policy**, signed provenance, and independent SAST/supply-chain scans.
|
|
311
327
|
- **Least privilege & disclosure.** See [PERMISSIONS.md](PERMISSIONS.md) for the minimal access it needs and [SECURITY.md](SECURITY.md) for private vulnerability reporting.
|
|
312
328
|
|
|
329
|
+
### What third-party scanners flag, and why
|
|
330
|
+
|
|
331
|
+
[Socket](https://socket.dev/npm/package/@cclabsnz/sf-audit) raises two **supply-chain risk** alerts against this package. Neither is a vulnerability — both are behavioural heuristics — and rather than suppress them quietly, here is exactly what triggers each and how you can confirm it. The triage is committed as [`socket.yml`](../../socket.yml).
|
|
332
|
+
|
|
333
|
+
| Alert | What triggers it | Why it is expected |
|
|
334
|
+
| --- | --- | --- |
|
|
335
|
+
| **Filesystem access** | `node:fs` reads and writes | It is a CLI that writes your audit reports (HTML/MD/JSON) to disk and reads local inputs: report-branding overrides, event-log baselines under `~/.sf/audit-history`, and its own history archive. Every path is one you pass on the command line or the tool's own dot-directory. |
|
|
336
|
+
| **URL strings** | `https://` literals in the shipped code | These are inert citation links rendered as `<a href>` in reports — OWASP, NZISM, the NZ Privacy Act, Te Whatu Ora and CIS-style benchmark references cited by compliance findings. They are never fetched. |
|
|
337
|
+
|
|
338
|
+
Check the second one yourself — this lists every URL in the published build:
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
npm pack @cclabsnz/sf-audit && tar xzf cclabsnz-sf-audit-*.tgz
|
|
342
|
+
grep -rhoE 'https?://[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z]{2,}[^"'"'"'`,;) ]*' package/lib | sort -u
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
As of v1.6.1 that prints seven results, every one a standards-body or documentation link:
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
https://docs.securitybenchmark.org/controls-at-a-glance.html
|
|
349
|
+
https://genai.owasp.org/llm-top-10/
|
|
350
|
+
https://nzism.gcsb.govt.nz/ism-document
|
|
351
|
+
https://owasp.org/Top10/2021/
|
|
352
|
+
https://privacy.org.nz/privacy-act-2020/privacy-principles/
|
|
353
|
+
https://www.legislation.govt.nz/act/public/2020/0031/latest/LMS23342.html
|
|
354
|
+
https://www.tewhatuora.govt.nz/health-services-and-programmes/cyber-hub/cyber-standards
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
No CDN, telemetry, or analytics endpoints — and the network-egress invariant above fails the build if one is ever added.
|
|
358
|
+
|
|
313
359
|
## Scoring
|
|
314
360
|
|
|
315
361
|
Each finding is assigned a risk level with a corresponding weight:
|
|
@@ -600,3 +646,48 @@ npm run clean # remove compiled output
|
|
|
600
646
|
```
|
|
601
647
|
|
|
602
648
|
Maintainers: see **[docs/RELEASE.md](docs/RELEASE.md)** for the release checklist and the one-time repository-hardening steps (npm provenance token, branch protection, and the CodeQL / Scorecard setup behind the badges above).
|
|
649
|
+
|
|
650
|
+
## Further reading
|
|
651
|
+
|
|
652
|
+
Deep dives on this tool and the topics it checks, from our engineering blog **[softwareinsights.dev](https://softwareinsights.dev)**.
|
|
653
|
+
|
|
654
|
+
**How the commands work:**
|
|
655
|
+
|
|
656
|
+
- [How sf-audit works — checks, attack chains, and compliance mapping](https://softwareinsights.dev/posts/sf-audit-61-checks-attack-chains-compliance-mapping/) — the design walkthrough behind `sf audit security`
|
|
657
|
+
- [Free Salesforce Event Monitoring: a baseline from EventLogFile without Shield](https://softwareinsights.dev/posts/salesforce-free-event-monitoring-eventlogfile-baseline/) — why [`sf audit events pull`](#free-event-baseline) exists and how to cron it
|
|
658
|
+
- [Which connected apps use less than they're granted? Ask your own logs](https://softwareinsights.dev/posts/salesforce-connected-app-least-privilege-granted-vs-used/) — the granted-vs-used method behind [`sf audit apps`](#connected-app-least-privilege)
|
|
659
|
+
- [Scanner or breach? Triage EventLogFile in one command](https://softwareinsights.dev/posts/salesforce-eventlogfile-guest-traffic-triage-scanner-or-breach/) — pairing an `events pull` baseline with the [sfelf-triage](https://github.com/cclabsnz/sfelf-triage) companion
|
|
660
|
+
- [Salesforce guest user exposure, graded by real reachability](https://softwareinsights.dev/posts/sf-audit-guest-user-exposure-reachability/) — the UI-API reachability tiering behind the [guest checks](#guest--external-facing-access)
|
|
661
|
+
- [sf-audit vs sf-cli-security-audit](https://softwareinsights.dev/posts/sf-audit-vs-sf-cli-security-audit/) — how this plugin differs from a configurable policy engine, and when to reach for each
|
|
662
|
+
|
|
663
|
+
**The access model the privilege checks encode** — the reasoning behind [Users, Permissions & Privilege](#users-permissions--privilege):
|
|
664
|
+
|
|
665
|
+
- [Why your developers don't need Modify All Data](https://softwareinsights.dev/posts/salesforce-developers-modify-all-data-what-they-need-instead/) — part 1 of a four-part series on delivery-team access; feeds Users & Admins and Privileged Access & Shadow Admins
|
|
666
|
+
- [The access model: tiers and roles](https://softwareinsights.dev/posts/salesforce-delivery-team-access-model-tiers-and-roles/) — the tiering that Separation of Duties and Privilege Escalation Permissions test against
|
|
667
|
+
- [Sizing the model to your team](https://softwareinsights.dev/posts/salesforce-access-model-sizing-internal-vs-external-admin-teams/) — internal vs external admins, and what the model costs to run
|
|
668
|
+
- [Deployable permission sets](https://softwareinsights.dev/posts/salesforce-delivery-team-deployable-permission-sets/) — the metadata and the CI identity, which the Integration / Service Accounts check inventories
|
|
669
|
+
|
|
670
|
+
**Platform changes the checks track:**
|
|
671
|
+
|
|
672
|
+
- [Hardening Agentforce against prompt injection (post-ForcedLeak)](https://softwareinsights.dev/posts/salesforce-agentforce-forcedleak-prompt-injection-hardening/) — feeds the Agentforce / GenAI checks
|
|
673
|
+
- [Audit your Agentforce footprint: every agent, agent user, and permission](https://softwareinsights.dev/posts/salesforce-agentforce-footprint-audit/) — the manual SOQL behind Agent Inventory
|
|
674
|
+
- [Agentforce agent user least privilege](https://softwareinsights.dev/posts/salesforce-agentforce-agent-user-least-privilege/) — feeds the Agent User Privilege check
|
|
675
|
+
- [Salesforce MFA enforcement: the revised 2026 dates](https://softwareinsights.dev/posts/salesforce-mfa-enforcement-paused-revised-dates-2026/) — feeds the MFA checks
|
|
676
|
+
- [The MFA enforcement admin guide](https://softwareinsights.dev/posts/salesforce-mfa-enforcement-2026-admin-guide/) — what the MFA Enforcement / Registration / Method Strength checks are measuring against
|
|
677
|
+
- [MFA lockout recovery and break-glass accounts](https://softwareinsights.dev/posts/salesforce-mfa-lockout-recovery-break-glass-accounts/) — the operational side of the MFA and High Assurance Session checks
|
|
678
|
+
- [OAuth username-password (ROPC) flow retirement in Winter '27](https://softwareinsights.dev/posts/salesforce-oauth-username-password-flow-retirement-winter-27/) — feeds the SSO Enforcement and Connected App OAuth Scopes checks
|
|
679
|
+
- [Email change verification retirement and Authorized Email Domains](https://softwareinsights.dev/posts/salesforce-email-change-verification-retirement-authorized-email-domains/) — feeds the Email Security check
|
|
680
|
+
- [Summer '26: SAML retirement & Apex secure-by-default](https://softwareinsights.dev/posts/salesforce-summer-26-saml-retirement-apex-secure-by-default/) — feeds the SSO / Apex checks
|
|
681
|
+
- [Salesforce security enforcement in 2026 — every change and date](https://softwareinsights.dev/posts/salesforce-security-enforcement-2026-complete-guide/) — the overall posture this tool measures
|
|
682
|
+
- [Report-export step-up enforcement: known issues](https://softwareinsights.dev/posts/salesforce-transaction-security-policy-report-export-known-issues/) — feeds the data-export / transaction-security checks
|
|
683
|
+
|
|
684
|
+
**Compliance and NZ context** — background for the [framework mappings](#compliance-frameworks):
|
|
685
|
+
|
|
686
|
+
- [Mapping Salesforce security to NZISM, the NZ Privacy Act and ISO 27001](https://softwareinsights.dev/posts/salesforce-security-nzism-nz-privacy-act/)
|
|
687
|
+
- [Data sovereignty for New Zealand Salesforce orgs](https://softwareinsights.dev/posts/salesforce-data-sovereignty-new-zealand/) — residency vs sovereignty, and why the `nz` framework pack exists
|
|
688
|
+
- [IPP 3A indirect collection notices](https://softwareinsights.dev/posts/salesforce-nz-privacy-ipp3a-indirect-collection-notice/) — feeds the NZ Privacy Act control mappings
|
|
689
|
+
- [Why Salesforce Health Cloud needs its own security review](https://softwareinsights.dev/posts/salesforce-health-cloud-security-review/) — the HISO 10029 context
|
|
690
|
+
|
|
691
|
+
## Commercial support
|
|
692
|
+
|
|
693
|
+
`sf-audit` is free and open source. If you'd like hands-on help — interpreting findings, prioritising remediation, or a full Salesforce security and architecture review — **[CloudCounsel](https://cloudcounsel.co.nz)**, the team behind this plugin, offers Salesforce security consulting. Reach us at [hello@cloudcounsel.co.nz](mailto:hello@cloudcounsel.co.nz).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AppFinding } from './types.js';
|
|
2
|
-
import type { SoqlClient } from '
|
|
2
|
+
import type { SoqlClient } from '@cclabsnz/sf-core';
|
|
3
3
|
export declare function analyzeApps(restApiCsv: string, soql: SoqlClient, opts: {
|
|
4
4
|
since: number;
|
|
5
5
|
soakDays: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ResolvedApp } from './types.js';
|
|
2
|
-
import type { SoqlClient } from '
|
|
2
|
+
import type { SoqlClient } from '@cclabsnz/sf-core';
|
|
3
3
|
export declare function resolveApps(appIds: string[], soql: SoqlClient, userIds: string[]): Promise<ResolvedApp[]>;
|
|
4
4
|
//# sourceMappingURL=appResolver.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { GrantedAccess } from './types.js';
|
|
2
|
-
import type { SoqlClient } from '
|
|
2
|
+
import type { SoqlClient } from '@cclabsnz/sf-core';
|
|
3
3
|
export declare function computeGranted(appId: string, runAsUsers: string[], soql: SoqlClient, scope: string | null): Promise<GrantedAccess>;
|
|
4
4
|
//# sourceMappingURL=grantedAccess.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SecurityCheck } from './SecurityCheck.js';
|
|
2
|
-
import type { AuditContext } from '
|
|
2
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
3
3
|
import type { AuditResult } from '../findings/AuditResult.js';
|
|
4
4
|
import type { ScoringConfig } from '../findings/ScoringConfig.js';
|
|
5
5
|
export declare class CheckEngine {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { Finding } from '../findings/Finding.js';
|
|
3
|
-
import type { AuditCache } from '
|
|
4
|
-
import type { OrgMetrics } from '
|
|
3
|
+
import type { AuditCache } from '@cclabsnz/sf-core';
|
|
4
|
+
import type { OrgMetrics } from '@cclabsnz/sf-core';
|
|
5
5
|
export interface CheckResult {
|
|
6
6
|
findings: Finding[];
|
|
7
7
|
metrics?: Partial<OrgMetrics>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class AgentActionSurfaceCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "agent-action-surface";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isApiError } from '
|
|
1
|
+
import { isApiError } from '@cclabsnz/sf-core';
|
|
2
2
|
// An agent carrying more than this many actions has a large, hard-to-review surface. Info
|
|
3
3
|
// only — a big surface is not a vulnerability by itself, but it is worth surfacing.
|
|
4
4
|
const ACTION_COUNT_THRESHOLD = 15;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class AgentChannelExposureCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "agent-channel-exposure";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class AgentInventoryCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "agent-inventory";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isApiError } from '
|
|
1
|
+
import { isApiError } from '@cclabsnz/sf-core';
|
|
2
2
|
// BotDefinition.Type values that denote an Agentforce / GenAI agent rather than a
|
|
3
3
|
// classic Einstein Bot. Matched case-insensitively; anything else (typically 'Bot')
|
|
4
4
|
// is treated as a classic bot. LIKE-style matching so exact enum spellings across
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class AgentMonitoringCoverageCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "agent-monitoring-coverage";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class AgentUserPrivilegeCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "agent-user-privilege";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class AnonymousApexAuditCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "anonymous-apex-audit";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ApexCrudFLSCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "apex-crud-fls";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ApexLoggingCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "apex-logging";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ApexRestEndpointCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "apex-rest-endpoint";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ApexSharingCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "apex-sharing";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ApexRepository } from '@cclabsnz/sf-core';
|
|
1
2
|
const INHERITED_SHARING = /\binherited\s+sharing\b/i;
|
|
2
3
|
const WITHOUT_SHARING = /\bwithout\s+sharing\b/i;
|
|
3
4
|
const WITH_SHARING = /\bwith\s+sharing\b/i;
|
|
@@ -30,8 +31,8 @@ export class ApexSharingCheck {
|
|
|
30
31
|
let apexBodies = ctx.cache.apexBodies;
|
|
31
32
|
if (!apexBodies) {
|
|
32
33
|
// Fall back to querying if cache not populated
|
|
33
|
-
const records = await ctx.tooling.
|
|
34
|
-
apexBodies = records.map((r) => ({ name: r.
|
|
34
|
+
const records = await new ApexRepository(ctx.tooling).listClasses({ excludeManaged: true });
|
|
35
|
+
apexBodies = records.map((r) => ({ name: r.name, body: r.body ?? '' }));
|
|
35
36
|
}
|
|
36
37
|
const withSharingClasses = [];
|
|
37
38
|
const withoutSharingClasses = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ApiClientPermissionCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "api-client-permission";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ApiLimitsCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "api-limits";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class AuditTrailCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "audit-trail";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
/**
|
|
4
4
|
* Reviews external identity federation — Auth Providers and SAML SSO configs.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class CertificateExpiryCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "certificate-expiry";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
/**
|
|
4
4
|
* Audits classic Force.com Sites (Visualforce sites), a public unauthenticated
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class CodeSecurityCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "code-security";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ApexRepository } from '@cclabsnz/sf-core';
|
|
1
2
|
// SBS-CODE-002: dynamic SOQL with string concatenation is the primary SOQL injection vector.
|
|
2
3
|
// Pattern: Database.query( or Database.countQuery( followed by a + operator before the closing paren/semicolon.
|
|
3
4
|
const DYNAMIC_SOQL_INJECTION = /Database\.(query|countQuery)\s*\([^;)]*\+[^;)]*[);]/gi;
|
|
@@ -15,13 +16,12 @@ export class CodeSecurityCheck {
|
|
|
15
16
|
// Fire all three independent Tooling queries in parallel.
|
|
16
17
|
// COUNT(Id) expr0 puts the result in records[0].expr0; COUNT() without a field
|
|
17
18
|
// puts it in totalSize which is not in the typed return value.
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const apex = new ApexRepository(ctx.tooling);
|
|
20
|
+
const [classCount, triggerCount, coverageResults] = await Promise.all([
|
|
21
|
+
apex.countClasses({ excludeManaged: true }),
|
|
22
|
+
apex.countTriggers({ excludeManaged: true }),
|
|
21
23
|
ctx.tooling.query('SELECT PercentCovered FROM ApexOrgWideCoverage'),
|
|
22
24
|
]);
|
|
23
|
-
const classCount = classCountResults[0]?.expr0 ?? 0;
|
|
24
|
-
const triggerCount = triggerCountResults[0]?.expr0 ?? 0;
|
|
25
25
|
if (coverageResults.length > 0) {
|
|
26
26
|
const coverage = coverageResults[0].PercentCovered;
|
|
27
27
|
let riskLevel = 'LOW';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ConnectedAppInactivityCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "connected-app-inactivity";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ConnectedAppScopeCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "connected-app-scope";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ConnectedAppsCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "connected-apps";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ContentLinksCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "content-links";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class CorsAllowlistCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "cors-allowlist";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
2
|
-
import type { AuditContext } from '
|
|
2
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
3
3
|
export declare class CspTrustedSitesCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "csp-trusted-sites";
|
|
5
5
|
readonly name = "CSP Trusted Sites";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class CustomLabelsCredentialCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "custom-labels-credential";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class CustomSettingsCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "custom-settings";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class DataClassificationCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "data-classification";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
/**
|
|
4
4
|
* Finds the profiles / permission sets that grant a bulk data-extraction
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class DebugLogAccessCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "debug-log-access";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class DeploymentIdentityCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "deployment-identity";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class EmailSecurityCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "email-security";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
/**
|
|
4
4
|
* Cross-references data classification against ACTUAL field encryption. `data-
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class EnhancedDomainsCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "enhanced-domains";
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// 2. The instance URL uses the enhanced domain format (contains .my.salesforce.com or .develop.my.salesforce.com)
|
|
11
11
|
// 3. Org is not still on a shared instance URL like na1.salesforce.com
|
|
12
12
|
// Patterns are matched against the parsed hostname and anchored to its end, so a URL
|
|
13
|
-
// that merely *contains* the string (
|
|
14
|
-
// cannot be mistaken for an enhanced-domain org. All enhanced variants
|
|
13
|
+
// that merely *contains* the string (an attacker-controlled host with a path of
|
|
14
|
+
// `/x.my.salesforce.com`) cannot be mistaken for an enhanced-domain org. All enhanced variants
|
|
15
15
|
// (sandbox/develop/scratch) are subdomains of my.salesforce.com, so one suffix suffices.
|
|
16
16
|
const ENHANCED_DOMAIN_PATTERN = /\.my\.salesforce\.com$/i;
|
|
17
17
|
const LEGACY_INSTANCE_PATTERN = /^[a-z]{2}\d+\.salesforce\.com$/i;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class EscalationPermsCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "escalation-perms";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class EventMonitoringCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "event-monitoring";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class ExperienceCloudSiteCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "experience-cloud-site";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
/**
|
|
4
4
|
* Advisory review of Experience Cloud CSP / Lightning Web Security posture.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
/**
|
|
4
4
|
* Reviews External Credentials (the modern auth half of Named Credentials) for
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class FailedLoginCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "failed-login-detection";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class FieldHistoryTrackingCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "field-history-tracking";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class FieldLevelSecurityCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "field-level-security";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditContext } from '
|
|
1
|
+
import type { AuditContext } from '@cclabsnz/sf-core';
|
|
2
2
|
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
3
|
export declare class FlowsWithoutSharingCheck implements SecurityCheck {
|
|
4
4
|
readonly id = "flows-without-sharing";
|