@cclabsnz/sf-audit 1.25.0 → 1.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +38 -21
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -9,6 +9,19 @@ published note and carries the signed provenance attestation and CycloneDX SBOM
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [v1.25.1](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.25.1) — 2026-11-11
13
+
14
+ Documentation only. No change to checks, scores or reports.
15
+
16
+ ### Changed
17
+
18
+ - **The README shows the report on its first screen**: a screenshot of a sample technical report,
19
+ linked to the full [technical](https://www.softwareinsights.dev/samples/sf-audit/sample-report.html)
20
+ and [executive](https://www.softwareinsights.dev/samples/sf-audit/sample-executive-report.html)
21
+ samples, and the install and run commands. The npm page shows the README as it was at publish,
22
+ so this release carries it there. (#206)
23
+ - The incident evidence-bundle spec is agreed, with resume and the staging sweep deferred. (#210)
24
+
12
25
  ## [v1.25.0](https://github.com/cclabsnz/sf-audit-plugin/releases/tag/v1.25.0) — 2026-11-10
13
26
 
14
27
  The technical HTML report is redesigned. It now uses the executive report's white consulting look
package/README.md CHANGED
@@ -5,26 +5,35 @@
5
5
  # @cclabsnz/sf-audit
6
6
 
7
7
  [![CI](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/ci.yml)
8
- [![CodeQL](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/codeql.yml/badge.svg)](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/codeql.yml)
9
- [![Semgrep](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/semgrep.yml/badge.svg)](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/semgrep.yml)
10
- [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/cclabsnz/sf-audit-plugin/badge)](https://securityscorecards.dev/viewer/?uri=github.com/cclabsnz/sf-audit-plugin)
11
- [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/14149/badge)](https://www.bestpractices.dev/projects/14149)
12
8
  [![npm version](https://img.shields.io/npm/v/@cclabsnz/sf-audit)](https://www.npmjs.com/package/@cclabsnz/sf-audit)
13
- [![npm provenance](https://img.shields.io/badge/npm-signed%20provenance-brightgreen)](https://www.npmjs.com/package/@cclabsnz/sf-audit#provenance)
9
+ [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/cclabsnz/sf-audit-plugin/badge)](https://securityscorecards.dev/viewer/?uri=github.com/cclabsnz/sf-audit-plugin)
14
10
  [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
15
11
 
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.
12
+ A read-only security audit for any Salesforce org, run from the Salesforce CLI (`sf`): 109 checks, an
13
+ A–F grade, and a report your security team (or your client's) can act on.
14
+
15
+ <a href="https://www.softwareinsights.dev/samples/sf-audit/sample-report.html"><img src="https://www.softwareinsights.dev/samples/sf-audit/sample-report.png" width="720" alt="sf-audit HTML report for a fictional org: grade F at 77 out of 100 and why, 42 open findings by severity, and user, code, integration and governance metrics" /></a>
17
16
 
18
- - **109 read-only checks** across identity, access, data (including Data Cloud and Shield), code, integrations (including inbound email handlers and package install handlers), monitoring, and Agentforce / GenAI. Apex findings say which control a class bypasses: record sharing, or CRUD/FLS
19
- - **Attack-chain correlation:** links individual findings into named, multi-step attack scenarios — nineteen modelled chains, plus an emergent pass for combinations nobody has named yet (see [Attack chains](#attack-chains))
20
- - **Compliance mapping:** every finding mapped to **source-verified** controls across 10 frameworks: 8 general baseline frameworks (OWASP Top 10, OWASP LLM Top 10, SOC 2, ISO/IEC 27001:2022, Security Benchmark for Salesforce, NZ Privacy Act 2020, HISO 10029, NZISM) plus 2 specialized jurisdictional packs (HIPAA Security Rule, GDPR)
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
22
- - **History & diff:** archives each run and shows security-posture drift over time (skipped by default on CI runners, so they keep no org data)
23
- - **CI-ready:** `--format sarif` for GitHub code scanning, `--fail-on` to gate a pipeline, and [accepted-risk waivers](#accepting-a-risk) that expire
24
- - **Free event baseline:** `sf audit events pull` captures the org's free daily `EventLogFile` logs to local disk before the 1-day retention window drops them — no Event Monitoring / Shield add-on needed
25
- - **Connected-app least-privilege:** `sf audit apps` reads the `RestApi`, `BulkApi2`, `GraphQlQueryExecution` and `AuraRequest` EventLogFiles to see which objects each connected app actually uses, compares that against what its run-as user is granted (permission sets and profile), and reports the over-grant per object and read/write bit — plus a suggested least-privilege permission set, which `--emit-permset <dir>` writes as local `.permissionset-meta.xml` files (never deployed)
26
- - **Guest User Anomaly investigation:** `sf audit incident collect` saves the guest user's evidence for each anomaly wave, and `sf audit incident report` analyses it offline into a cited verdict: who it was, whether content came back, and whether anyone logged in ([walkthrough](https://www.softwareinsights.dev/posts/salesforce-guest-user-anomaly-investigation-sf-audit-incident/))
27
- - Strictly read-only (SOQL/Tooling/REST GETs + Metadata API reads); see [PERMISSIONS.md](PERMISSIONS.md) for the least-privilege access it needs
17
+ *A sample report from a fictional org, produced by the real checks against synthetic data. Open the
18
+ full [technical report](https://www.softwareinsights.dev/samples/sf-audit/sample-report.html) or the
19
+ [executive report](https://www.softwareinsights.dev/samples/sf-audit/sample-executive-report.html).*
20
+
21
+ ```bash
22
+ sf plugins install @cclabsnz/sf-audit # warns that it is unsigned: answer y (see Installation)
23
+ sf audit security --target-org <orgAlias>
24
+ ```
25
+
26
+ That writes an HTML report to the current directory. **Safe to run against production:** it only
27
+ uses SOQL, Tooling/REST GETs and Metadata API reads, and a test fails the build if a write call
28
+ appears in the source ([PERMISSIONS.md](PERMISSIONS.md), [Trust & verification](#trust--verification)).
29
+
30
+ - **Checks:** identity, access, data, guest exposure, integrations, code, monitoring and Agentforce. See [What It Checks](#what-it-checks)
31
+ - **Attack chains:** findings linked into multi-step attack scenarios: nineteen named chains, plus a pass for combinations nobody has named yet
32
+ - **Compliance:** every finding mapped to 10 frameworks, including SOC 2, ISO/IEC 27001, OWASP, NZISM, HIPAA and GDPR
33
+ - **CI:** `--format sarif` for GitHub code scanning, `--fail-on` to gate a pipeline, and expiring [risk waivers](#accepting-a-risk)
34
+
35
+ The plugin also has commands to capture the free daily event logs, check connected apps for least
36
+ privilege, and investigate guest-user anomalies. See [Other commands](#other-commands).
28
37
 
29
38
  ## Installation
30
39
 
@@ -133,7 +142,9 @@ Every flag, more examples, and what the executive report contains:
133
142
  ## What It Checks
134
143
 
135
144
  **109 read-only checks** across ten domains. Every finding is risk-rated CRITICAL → INFO, mapped to
136
- compliance controls, and correlated into [attack chains](#attack-chains).
145
+ compliance controls, and correlated into [attack chains](#attack-chains). Coverage includes Data
146
+ Cloud and Shield, inbound email handlers and package install handlers, and Apex findings say which
147
+ control a class bypasses: record sharing, or CRUD/FLS.
137
148
 
138
149
  | Domain | Checks |
139
150
  |--------|-------:|
@@ -194,7 +205,7 @@ All nineteen with severities and trigger conditions: **[docs/ATTACK-CHAINS.md](d
194
205
 
195
206
  ## Scope & Liability
196
207
 
197
- **What this tool is.** A read-only, point-in-time configuration review. Every check uses standard Salesforce SOQL, Tooling, and REST **GET** queries only: the tool performs no DML, no metadata deployments, and never modifies the target org or its data. It runs under the permissions of the authenticated `sf` user; checks that the user cannot access are reported as *inconclusive* rather than passing silently.
208
+ **What this tool is.** A read-only, point-in-time configuration review. Every check uses standard Salesforce SOQL, Tooling, and REST **GET** queries and Metadata API reads only: the tool performs no DML, no metadata deployments, and never modifies the target org or its data. It runs under the permissions of the authenticated `sf` user; checks that the user cannot access are reported as *inconclusive* rather than passing silently.
198
209
 
199
210
  **What this tool is not.** It is **not** a penetration test, a dynamic/runtime security test, or a source-code audit of managed-package internals. It does not exploit vulnerabilities, attempt privilege escalation, or guarantee detection of every misconfiguration. The Health Score and A–F grade are **prioritisation aids**, not certifications, and do not represent compliance with, or accreditation under, any standard (OWASP, SOC 2, ISO 27001, HIPAA, GDPR, or otherwise). Compliance-framework tags indicate *relevance* to a control area only.
200
211
 
@@ -210,6 +221,11 @@ All nineteen with severities and trigger conditions: **[docs/ATTACK-CHAINS.md](d
210
221
  Because this tool authenticates against production orgs, "is it safe to run?" deserves a verifiable
211
222
  answer rather than a claim. Every guarantee below is something you can check yourself:
212
223
 
224
+ [![CodeQL](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/codeql.yml/badge.svg)](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/codeql.yml)
225
+ [![Semgrep](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/semgrep.yml/badge.svg)](https://github.com/cclabsnz/sf-audit-plugin/actions/workflows/semgrep.yml)
226
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/14149/badge)](https://www.bestpractices.dev/projects/14149)
227
+ [![npm provenance](https://img.shields.io/badge/npm-signed%20provenance-brightgreen)](https://www.npmjs.com/package/@cclabsnz/sf-audit#provenance)
228
+
213
229
  - **Read-only, enforced in CI** — a test statically fails the build if any write path appears in the source
214
230
  - **No network egress** — enforced the same way; reports are fully self-contained (fonts and Chart.js inlined)
215
231
  - **Signed provenance** — released from CI via npm trusted publishing (OIDC); `npm audit signatures` verifies the tarball against the public commit
@@ -287,7 +303,7 @@ Beyond the audit itself, the plugin ships five commands. Each is documented in
287
303
  | `sf audit events pull` | Capture the org's **free** daily `EventLogFile` logs to local disk before the ~1-day retention window drops them — no Event Monitoring / Shield add-on needed. Idempotent, safe to cron |
288
304
  | `sf audit timeline` | Reconstruct one actor's activity across every captured event type, entirely offline. Refuses to expand a shared identity or join on a blank field, and always reports capture coverage first |
289
305
  | `sf audit preflight` | Read the running user's effective permissions in one query and report which checks will produce a verdict and which will return inconclusive — **before** an audit is run |
290
- | `sf audit apps` | Read the API event logs to compare what each connected app actually *uses* against what its run-as user is *granted*, and suggest a least-privilege permission set. `--emit-permset <dir>` writes it as local `.permissionset-meta.xml` files for review; nothing is deployed |
306
+ | `sf audit apps` | Read the `RestApi`, `BulkApi2`, `GraphQlQueryExecution` and `AuraRequest` event logs to compare what each connected app actually *uses* against what its run-as user is *granted*, per object and read/write, and suggest a least-privilege permission set. `--emit-permset <dir>` writes it as local `.permissionset-meta.xml` files for review; nothing is deployed |
291
307
 
292
308
  To triage captured logs for abuse patterns, pair `events pull` with the companion CLI
293
309
  **[sfelf-triage](https://github.com/cclabsnz/sfelf-triage)**, which reads this plugin's
@@ -297,11 +313,12 @@ To triage captured logs for abuse patterns, pair `events pull` with the companio
297
313
 
298
314
  `sf audit incident collect --target-org <alias>` finds Guest User Anomaly waves and saves a
299
315
  guest-filtered evidence bundle to `~/.sf/incidents/`. `sf audit incident report --bundle <dir>`
300
- analyses it offline and writes an HTML/Markdown/JSON report with evidence CSVs. Pass
316
+ analyses it offline into a cited verdict (who it was, whether content came back, and whether anyone
317
+ logged in) as an HTML/Markdown/JSON report with evidence CSVs. Pass
301
318
  `--ip-ranges` with provider range files you have downloaded to classify hosting; the plugin
302
319
  never fetches them. Use `--redact` before sharing beyond the client's security team. Bundles in
303
320
  `~/.sf/incidents` hold guest-traffic rows and linked-user details unencrypted, so handle them as
304
- sensitive data.
321
+ sensitive data. A worked example: [investigating a Guest User Anomaly with sf-audit](https://www.softwareinsights.dev/posts/salesforce-guest-user-anomaly-investigation-sf-audit-incident/).
305
322
 
306
323
  ## Requirements
307
324
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cclabsnz/sf-audit",
3
- "version": "1.25.0",
3
+ "version": "1.25.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",