@cclabsnz/sf-audit 1.8.1 → 1.8.2
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 +27 -27
- package/lib/checks/impl/AgentActionSurfaceCheck.d.ts +1 -1
- package/lib/checks/impl/AgentChannelExposureCheck.d.ts +1 -1
- package/lib/checks/impl/AgentInventoryCheck.d.ts +1 -1
- package/lib/checks/impl/AgentMonitoringCoverageCheck.d.ts +1 -1
- package/lib/checks/impl/AgentUserPrivilegeCheck.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/CodeSecurityCheck.d.ts +1 -1
- package/lib/checks/impl/ConnectedAppInactivityCheck.d.ts +1 -1
- package/lib/checks/impl/ConnectedAppsCheck.d.ts +1 -1
- package/lib/checks/impl/CspTrustedSitesCheck.d.ts +1 -1
- package/lib/checks/impl/DeploymentIdentityCheck.d.ts +1 -1
- package/lib/checks/impl/EventMonitoringCheck.d.ts +1 -1
- package/lib/checks/impl/GuestExecutableApexCheck.d.ts +1 -1
- package/lib/checks/impl/GuestTrafficAnomalyCheck.d.ts +1 -1
- package/lib/checks/impl/GuestUserAccessCheck.d.ts +1 -1
- package/lib/checks/impl/HardcodedCredentialsCheck.d.ts +2 -2
- package/lib/checks/impl/HealthCheckCheck.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/NamedCredentialsCheck.d.ts +1 -1
- package/lib/checks/impl/PrivilegedAccessCheck.d.ts +1 -1
- package/lib/checks/impl/PublicGroupSharingCheck.d.ts +1 -1
- package/lib/checks/impl/RemoteSitesCheck.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/SiemIntegrationCheck.d.ts +1 -1
- package/lib/checks/impl/TrustedUrlHygieneCheck.d.ts +1 -1
- package/lib/checks/impl/VisualforceXssCheck.d.ts +1 -1
- package/package.json +12 -9
package/README.md
CHANGED
|
@@ -309,7 +309,7 @@ Findings are mapped to controls across eight security and privacy frameworks. Th
|
|
|
309
309
|
|
|
310
310
|
> **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).
|
|
311
311
|
|
|
312
|
-
**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).
|
|
312
|
+
**Further reading:** [Mapping Salesforce security to NZISM, the NZ Privacy Act and ISO 27001](https://www.softwareinsights.dev/posts/salesforce-security-nzism-nz-privacy-act/) and [Why Salesforce Health Cloud needs its own security review](https://www.softwareinsights.dev/posts/salesforce-health-cloud-security-review/). More in [Further reading](#further-reading).
|
|
313
313
|
|
|
314
314
|
## Scope & Liability
|
|
315
315
|
|
|
@@ -829,44 +829,44 @@ Maintainers: see **[docs/RELEASE.md](docs/RELEASE.md)** for the release checklis
|
|
|
829
829
|
|
|
830
830
|
## Further reading
|
|
831
831
|
|
|
832
|
-
Deep dives on this tool and the topics it checks, from our engineering blog **[softwareinsights.dev](https://softwareinsights.dev)**.
|
|
832
|
+
Deep dives on this tool and the topics it checks, from our engineering blog **[softwareinsights.dev](https://www.softwareinsights.dev)**.
|
|
833
833
|
|
|
834
834
|
**How the commands work:**
|
|
835
835
|
|
|
836
|
-
- [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`
|
|
837
|
-
- [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
|
|
838
|
-
- [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)
|
|
839
|
-
- [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
|
|
840
|
-
- [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)
|
|
841
|
-
- [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
|
|
836
|
+
- [How sf-audit works — checks, attack chains, and compliance mapping](https://www.softwareinsights.dev/posts/sf-audit-61-checks-attack-chains-compliance-mapping/) — the design walkthrough behind `sf audit security`
|
|
837
|
+
- [Free Salesforce Event Monitoring: a baseline from EventLogFile without Shield](https://www.softwareinsights.dev/posts/salesforce-free-event-monitoring-eventlogfile-baseline/) — why [`sf audit events pull`](#free-event-baseline) exists and how to cron it
|
|
838
|
+
- [Which connected apps use less than they're granted? Ask your own logs](https://www.softwareinsights.dev/posts/salesforce-connected-app-least-privilege-granted-vs-used/) — the granted-vs-used method behind [`sf audit apps`](#connected-app-least-privilege)
|
|
839
|
+
- [Scanner or breach? Triage EventLogFile in one command](https://www.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
|
|
840
|
+
- [Salesforce guest user exposure, graded by real reachability](https://www.softwareinsights.dev/posts/sf-audit-guest-user-exposure-reachability/) — the UI-API reachability tiering behind the [guest checks](#guest--external-facing-access)
|
|
841
|
+
- [sf-audit vs sf-cli-security-audit](https://www.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
|
|
842
842
|
|
|
843
843
|
**The access model the privilege checks encode** — the reasoning behind [Users, Permissions & Privilege](#users-permissions--privilege):
|
|
844
844
|
|
|
845
|
-
- [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
|
|
846
|
-
- [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
|
|
847
|
-
- [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
|
|
848
|
-
- [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
|
|
845
|
+
- [Why your developers don't need Modify All Data](https://www.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
|
|
846
|
+
- [The access model: tiers and roles](https://www.softwareinsights.dev/posts/salesforce-delivery-team-access-model-tiers-and-roles/) — the tiering that Separation of Duties and Privilege Escalation Permissions test against
|
|
847
|
+
- [Sizing the model to your team](https://www.softwareinsights.dev/posts/salesforce-access-model-sizing-internal-vs-external-admin-teams/) — internal vs external admins, and what the model costs to run
|
|
848
|
+
- [Deployable permission sets](https://www.softwareinsights.dev/posts/salesforce-delivery-team-deployable-permission-sets/) — the metadata and the CI identity, which the Integration / Service Accounts check inventories
|
|
849
849
|
|
|
850
850
|
**Platform changes the checks track:**
|
|
851
851
|
|
|
852
|
-
- [Hardening Agentforce against prompt injection (post-ForcedLeak)](https://softwareinsights.dev/posts/salesforce-agentforce-forcedleak-prompt-injection-hardening/) — feeds the Agentforce / GenAI checks
|
|
853
|
-
- [Audit your Agentforce footprint: every agent, agent user, and permission](https://softwareinsights.dev/posts/salesforce-agentforce-footprint-audit/) — the manual SOQL behind Agent Inventory
|
|
854
|
-
- [Agentforce agent user least privilege](https://softwareinsights.dev/posts/salesforce-agentforce-agent-user-least-privilege/) — feeds the Agent User Privilege check
|
|
855
|
-
- [Salesforce MFA enforcement: the revised 2026 dates](https://softwareinsights.dev/posts/salesforce-mfa-enforcement-paused-revised-dates-2026/) — feeds the MFA checks
|
|
856
|
-
- [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
|
|
857
|
-
- [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
|
|
858
|
-
- [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
|
|
859
|
-
- [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
|
|
860
|
-
- [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
|
|
861
|
-
- [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
|
|
862
|
-
- [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
|
|
852
|
+
- [Hardening Agentforce against prompt injection (post-ForcedLeak)](https://www.softwareinsights.dev/posts/salesforce-agentforce-forcedleak-prompt-injection-hardening/) — feeds the Agentforce / GenAI checks
|
|
853
|
+
- [Audit your Agentforce footprint: every agent, agent user, and permission](https://www.softwareinsights.dev/posts/salesforce-agentforce-footprint-audit/) — the manual SOQL behind Agent Inventory
|
|
854
|
+
- [Agentforce agent user least privilege](https://www.softwareinsights.dev/posts/salesforce-agentforce-agent-user-least-privilege/) — feeds the Agent User Privilege check
|
|
855
|
+
- [Salesforce MFA enforcement: the revised 2026 dates](https://www.softwareinsights.dev/posts/salesforce-mfa-enforcement-paused-revised-dates-2026/) — feeds the MFA checks
|
|
856
|
+
- [The MFA enforcement admin guide](https://www.softwareinsights.dev/posts/salesforce-mfa-enforcement-2026-admin-guide/) — what the MFA Enforcement / Registration / Method Strength checks are measuring against
|
|
857
|
+
- [MFA lockout recovery and break-glass accounts](https://www.softwareinsights.dev/posts/salesforce-mfa-lockout-recovery-break-glass-accounts/) — the operational side of the MFA and High Assurance Session checks
|
|
858
|
+
- [OAuth username-password (ROPC) flow retirement in Winter '27](https://www.softwareinsights.dev/posts/salesforce-oauth-username-password-flow-retirement-winter-27/) — feeds the SSO Enforcement and Connected App OAuth Scopes checks
|
|
859
|
+
- [Email change verification retirement and Authorized Email Domains](https://www.softwareinsights.dev/posts/salesforce-email-change-verification-retirement-authorized-email-domains/) — feeds the Email Security check
|
|
860
|
+
- [Summer '26: SAML retirement & Apex secure-by-default](https://www.softwareinsights.dev/posts/salesforce-summer-26-saml-retirement-apex-secure-by-default/) — feeds the SSO / Apex checks
|
|
861
|
+
- [Salesforce security enforcement in 2026 — every change and date](https://www.softwareinsights.dev/posts/salesforce-security-enforcement-2026-complete-guide/) — the overall posture this tool measures
|
|
862
|
+
- [Report-export step-up enforcement: known issues](https://www.softwareinsights.dev/posts/salesforce-transaction-security-policy-report-export-known-issues/) — feeds the data-export / transaction-security checks
|
|
863
863
|
|
|
864
864
|
**Compliance and NZ context** — background for the [framework mappings](#compliance-frameworks):
|
|
865
865
|
|
|
866
|
-
- [Mapping Salesforce security to NZISM, the NZ Privacy Act and ISO 27001](https://softwareinsights.dev/posts/salesforce-security-nzism-nz-privacy-act/)
|
|
867
|
-
- [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
|
|
868
|
-
- [IPP 3A indirect collection notices](https://softwareinsights.dev/posts/salesforce-nz-privacy-ipp3a-indirect-collection-notice/) — feeds the NZ Privacy Act control mappings
|
|
869
|
-
- [Why Salesforce Health Cloud needs its own security review](https://softwareinsights.dev/posts/salesforce-health-cloud-security-review/) — the HISO 10029 context
|
|
866
|
+
- [Mapping Salesforce security to NZISM, the NZ Privacy Act and ISO 27001](https://www.softwareinsights.dev/posts/salesforce-security-nzism-nz-privacy-act/)
|
|
867
|
+
- [Data sovereignty for New Zealand Salesforce orgs](https://www.softwareinsights.dev/posts/salesforce-data-sovereignty-new-zealand/) — residency vs sovereignty, and why the `nz` framework pack exists
|
|
868
|
+
- [IPP 3A indirect collection notices](https://www.softwareinsights.dev/posts/salesforce-nz-privacy-ipp3a-indirect-collection-notice/) — feeds the NZ Privacy Act control mappings
|
|
869
|
+
- [Why Salesforce Health Cloud needs its own security review](https://www.softwareinsights.dev/posts/salesforce-health-cloud-security-review/) — the HISO 10029 context
|
|
870
870
|
|
|
871
871
|
## Commercial support
|
|
872
872
|
|
|
@@ -5,7 +5,7 @@ export declare class AgentActionSurfaceCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Agent Action Surface";
|
|
6
6
|
readonly category = "AI & Agents";
|
|
7
7
|
readonly description = "Inventories Agentforce topics and actions (GenAiPlugin / GenAiFunction), flagging write-capable actions (Apex/Flow that create, update, or delete) and agents with an unusually large action surface. Write-capable actions on an exposed agent let a prompt injection take actions, not just read data.";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['agentInventory', 'agentAccess'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
private isWriteCapable;
|
|
11
11
|
private queryWithFallback;
|
|
@@ -5,7 +5,7 @@ export declare class AgentChannelExposureCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Agentforce Channel Exposure";
|
|
6
6
|
readonly category = "AI & Agents";
|
|
7
7
|
readonly description = "Correlates active Agentforce agents with the channels that reach them (Experience Cloud sites, embedded deployments, messaging channels) and flags guest-reachable exposure.";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['agentInventory', 'agentAccess'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
private queryGuestSites;
|
|
11
11
|
private queryMessagingChannels;
|
|
@@ -5,7 +5,7 @@ export declare class AgentInventoryCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Agentforce Agent Inventory";
|
|
6
6
|
readonly category = "AI & Agents";
|
|
7
7
|
readonly description = "Inventories Agentforce agents and classic Einstein Bots, their active versions, run-as users, and the users licensed to run agents.";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['agentInventory', 'agentUsers', 'agentAccess'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
private classifyType;
|
|
11
11
|
private queryBotDefinitions;
|
|
@@ -5,7 +5,7 @@ export declare class AgentMonitoringCoverageCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Agentforce Monitoring Coverage";
|
|
6
6
|
readonly category = "AI & Agents";
|
|
7
7
|
readonly description = "Flags orgs that run active Agentforce agents without Event Monitoring capture or Transaction Security policies to detect and respond to agent abuse.";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['agentInventory', 'agentAccess', 'eventLogSummary'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
private hasEnabledTransactionSecurityPolicy;
|
|
11
11
|
}
|
|
@@ -5,7 +5,7 @@ export declare class AgentUserPrivilegeCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Agent User Privilege";
|
|
6
6
|
readonly category = "AI & Agents";
|
|
7
7
|
readonly description = "Flags Agentforce run-as / agent users whose effective access is over-broad: Modify/View All Data, write access to many objects, or read access to data classified as sensitive. An injected prompt can exfiltrate or mutate exactly what the agent user can reach.";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['agentUsers', 'agentAccess'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
private evaluateUser;
|
|
11
11
|
private querySensitiveObjects;
|
|
@@ -5,7 +5,7 @@ export declare class ApexCrudFLSCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Apex CRUD/FLS Enforcement";
|
|
6
6
|
readonly category = "Code Security";
|
|
7
7
|
readonly description = "Flags Apex classes that perform DML or SOQL without checking CRUD/FLS permissions: OWASP Top 10 for Salesforce";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['apexBodies'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=ApexCrudFLSCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class ApexLoggingCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Apex Logging Framework";
|
|
6
6
|
readonly category = "Code Security";
|
|
7
7
|
readonly description = "SBS-CODE-003/004: checks for persistent logging framework usage and sensitive data in Apex logs";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['apexBodies', 'scheduledApexClassNames'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=ApexLoggingCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class ApexRestEndpointCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Apex REST Endpoint Security";
|
|
6
6
|
readonly category = "Code Security";
|
|
7
7
|
readonly description = "Flags @RestResource Apex classes that run without sharing, exposing records to REST callers without record-level access control";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['apexBodies'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=ApexRestEndpointCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class ApexSharingCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Apex Sharing Declarations";
|
|
6
6
|
readonly category = "Code Security";
|
|
7
7
|
readonly description = "Classifies Apex classes by sharing declaration (with sharing, without sharing, inherited, omitted)";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['apexBodies'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=ApexSharingCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class CodeSecurityCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Code Security and Coverage";
|
|
6
6
|
readonly category = "Code Security";
|
|
7
7
|
readonly description = "Reports org-wide Apex test coverage, class/trigger counts, and flags potential SOQL injection patterns";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['apexBodies'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=CodeSecurityCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class ConnectedAppInactivityCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Inactive Connected Apps";
|
|
6
6
|
readonly category = "App Security";
|
|
7
7
|
readonly description = "Flags connected apps with no OAuth logins in the past 90 days: stale apps are unused attack surface";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['connectedAppNames'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=ConnectedAppInactivityCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class ConnectedAppsCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Connected Apps";
|
|
6
6
|
readonly category = "App Security";
|
|
7
7
|
readonly description = "Flags connected apps not restricted to admin-approved users";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['connectedAppNames'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=ConnectedAppsCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class CspTrustedSitesCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "CSP Trusted Sites";
|
|
6
6
|
readonly category = "Network Security";
|
|
7
7
|
readonly description = "Checks Content Security Policy trusted sites for insecure HTTP endpoints that allow mixed-content loading.";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['cspTrustedSites'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=CspTrustedSitesCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class DeploymentIdentityCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Deployment Identity";
|
|
6
6
|
readonly category = "Deployments";
|
|
7
7
|
readonly description = "SBS-DEP-001/003: checks for a designated deployment identity and monitors for uncontrolled deployment activity";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['connectedAppNames'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=DeploymentIdentityCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class EventMonitoringCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Event Monitoring Storage";
|
|
6
6
|
readonly category = "Event Monitoring";
|
|
7
7
|
readonly description = "SBS-MON-001 / SBS-INT-004: verifies Event Monitoring is enabled and logs cover at least 30 days";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['eventLogSummary'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=EventMonitoringCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class GuestExecutableApexCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Guest-Executable Apex";
|
|
6
6
|
readonly category = "Access Control";
|
|
7
7
|
readonly description = "Finds Apex classes that unauthenticated guest profiles can execute, flagging those that run without sharing: the classic unauthenticated data-exfiltration vector";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['apexBodies'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=GuestExecutableApexCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class GuestTrafficAnomalyCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Guest Traffic Anomaly";
|
|
6
6
|
readonly category = "Threat Detection";
|
|
7
7
|
readonly description = "Scans recent EventLogFile guest requests for anonymizer/hosting source IPs, single-IP bursts, and GraphQL totalCount reconnaissance sweeps";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['eventLogSummary'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
/** Parse an EventLogFile CSV, pushing guest-attributed rows into `out`. */
|
|
11
11
|
private parseGuestRows;
|
|
@@ -5,7 +5,7 @@ export declare class GuestUserAccessCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Guest User Access";
|
|
6
6
|
readonly category = "Access Control";
|
|
7
7
|
readonly description = "Audits object permissions and sharing rules granted to unauthenticated guest users";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['healthCloudInstalled'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=GuestUserAccessCheck.d.ts.map
|
|
@@ -5,8 +5,8 @@ export declare class HardcodedCredentialsCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Hardcoded Credentials";
|
|
6
6
|
readonly category = "Code Security";
|
|
7
7
|
readonly description = "Scans Apex code for hardcoded Bearer tokens, Basic auth, API keys, and raw callout URLs";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
9
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['namedCredentialEndpoints', 'remoteSiteUrls'];
|
|
9
|
+
readonly populatesCache: readonly ['apexBodies'];
|
|
10
10
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=HardcodedCredentialsCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class HealthCheckCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Security Health Check";
|
|
6
6
|
readonly category = "Health Check";
|
|
7
7
|
readonly description = "Reads the Salesforce Health Check score and flags individual risk items";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['healthCheckRisks', 'healthCloudInstalled'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=HealthCheckCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class MfaMethodStrengthCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "MFA Method Strength";
|
|
6
6
|
readonly category = "Authentication";
|
|
7
7
|
readonly description = "Classifies registered MFA methods by strength (phishing-resistant / TOTP / weak) using Salesforce's guidance and NIST; flags admin users with weak-only methods";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['mfaRegistrations'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=MfaMethodStrengthCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class MfaRegistrationCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "MFA Method Registration";
|
|
6
6
|
readonly category = "Authentication";
|
|
7
7
|
readonly description = "Identifies active standard users who have not registered any MFA method in TwoFactorInfo";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['mfaRegistrations'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=MfaRegistrationCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class NamedCredentialsCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Named Credentials";
|
|
6
6
|
readonly category = "External Connectivity";
|
|
7
7
|
readonly description = "Inventories Named Credentials and flags any not referenced in Apex code";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['namedCredentialEndpoints'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=NamedCredentialsCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class PrivilegedAccessCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Privileged Access & Shadow Admins";
|
|
6
6
|
readonly category = "Permissions";
|
|
7
7
|
readonly description = "Resolves each active user's effective high-risk permissions (profile + permission sets + groups) and flags admin-equivalent users who are not on the System Administrator profile";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['effectivePermissions'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=PrivilegedAccessCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class PublicGroupSharingCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Public Group Sharing Exposure";
|
|
6
6
|
readonly category = "Sharing & Visibility";
|
|
7
7
|
readonly description = "Finds sharing rules that grant broad access to All Internal Users";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['healthCloudInstalled'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=PublicGroupSharingCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class RemoteSitesCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Remote Site Settings";
|
|
6
6
|
readonly category = "External Connectivity";
|
|
7
7
|
readonly description = "Inventories remote site settings and flags those with protocol security disabled";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['remoteSiteUrls'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=RemoteSitesCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class ScheduledApexCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Scheduled and Batch Apex";
|
|
6
6
|
readonly category = "Code Security";
|
|
7
7
|
readonly description = "Lists active scheduled and batch Apex jobs running in the org";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['scheduledApexClassNames'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=ScheduledApexCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class SeparationOfDutiesCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Separation of Duties";
|
|
6
6
|
readonly category = "Permissions";
|
|
7
7
|
readonly description = "Flags users whose effective permissions combine into self-escalation, fraud, or undetectable-abuse pairings that violate separation of duties";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['effectivePermissions'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=SeparationOfDutiesCheck.d.ts.map
|
|
@@ -12,7 +12,7 @@ export declare class SessionHardeningCheck implements SecurityCheck {
|
|
|
12
12
|
readonly name = "Session & Clickjack Hardening";
|
|
13
13
|
readonly category = "Session Security";
|
|
14
14
|
readonly description = "Grades clickjack, CSRF, session-lock, and XSS-protection settings from Health Check and gives per-setting remediation";
|
|
15
|
-
readonly dependsOnCache: readonly [
|
|
15
|
+
readonly dependsOnCache: readonly ['healthCheckRisks'];
|
|
16
16
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
17
17
|
private static readonly FLAGS;
|
|
18
18
|
/** Authoritative evaluation from SecuritySettings metadata; null → fall back to the cache path. */
|
|
@@ -5,7 +5,7 @@ export declare class SiemIntegrationCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "SIEM Integration Signals";
|
|
6
6
|
readonly category = "Event Monitoring";
|
|
7
7
|
readonly description = "SBS-MON-003/004: detects evidence of SIEM or external monitoring integration using cached org data (zero extra queries)";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['namedCredentialEndpoints', 'remoteSiteUrls', 'connectedAppNames', 'scheduledApexClassNames', 'eventLogSummary'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=SiemIntegrationCheck.d.ts.map
|
|
@@ -5,7 +5,7 @@ export declare class TrustedUrlHygieneCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Trusted URL Hygiene";
|
|
6
6
|
readonly category = "AI & Agents";
|
|
7
7
|
readonly description = "Reviews the CSP trusted-sites allowlist for non-Salesforce domains that could be repurposed as data-exfiltration channels (the ForcedLeak pattern). With --resolve-domains, DNS-checks each domain for unresolvable or parked entries.";
|
|
8
|
-
readonly dependsOnCache: readonly [
|
|
8
|
+
readonly dependsOnCache: readonly ['cspTrustedSites'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
private reviewFinding;
|
|
11
11
|
private unresolvableFinding;
|
|
@@ -5,7 +5,7 @@ export declare class VisualforceXssCheck implements SecurityCheck {
|
|
|
5
5
|
readonly name = "Visualforce XSS Patterns";
|
|
6
6
|
readonly category = "Code Security";
|
|
7
7
|
readonly description = "Scans Visualforce page markup for common XSS patterns: escape=\"false\", unencoded merge fields in script blocks and HTML attributes";
|
|
8
|
-
readonly populatesCache: readonly [
|
|
8
|
+
readonly populatesCache: readonly ['vfPageBodies'];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=VisualforceXssCheck.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cclabsnz/sf-audit",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
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",
|
|
@@ -27,28 +27,31 @@
|
|
|
27
27
|
"main": "lib/index.js",
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc -p tsconfig.json",
|
|
30
|
-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --passWithNoTests",
|
|
31
|
-
"test:unit": "node --experimental-vm-modules node_modules/jest/bin/jest.js test/unit --passWithNoTests",
|
|
30
|
+
"test": "npm run typecheck && node --experimental-vm-modules node_modules/jest/bin/jest.js --passWithNoTests",
|
|
31
|
+
"test:unit": "npm run typecheck && node --experimental-vm-modules node_modules/jest/bin/jest.js test/unit --passWithNoTests",
|
|
32
32
|
"prepack": "npm run build",
|
|
33
33
|
"clean": "rm -rf lib",
|
|
34
|
-
"prepare": "git config core.hooksPath .githooks 2>/dev/null || true"
|
|
34
|
+
"prepare": "git config core.hooksPath .githooks 2>/dev/null || true",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.test.json",
|
|
36
|
+
"test:jest": "node --experimental-vm-modules node_modules/jest/bin/jest.js --passWithNoTests"
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
39
|
+
"@cclabsnz/sf-core": "^0.3.0",
|
|
37
40
|
"@oclif/core": "^4",
|
|
38
41
|
"@salesforce/core": "^9",
|
|
39
42
|
"@salesforce/sf-plugins-core": "^13",
|
|
40
43
|
"chart.js": "^4.5.1",
|
|
41
|
-
"zod": "^4"
|
|
42
|
-
"@cclabsnz/sf-core": "^0.3.0"
|
|
44
|
+
"zod": "^4"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
47
|
"@jest/globals": "^30.4.1",
|
|
48
|
+
"@swc/core": "^1.15.47",
|
|
49
|
+
"@swc/jest": "^0.2.39",
|
|
46
50
|
"@types/jest": "^30",
|
|
47
51
|
"@types/node": "^26",
|
|
48
52
|
"jest": "^30",
|
|
49
|
-
"ts-jest": "^29.4.12",
|
|
50
53
|
"ts-node": "^10.9.2",
|
|
51
|
-
"typescript": "^
|
|
54
|
+
"typescript": "^7.0.2"
|
|
52
55
|
},
|
|
53
56
|
"repository": {
|
|
54
57
|
"type": "git",
|
|
@@ -91,7 +94,7 @@
|
|
|
91
94
|
"pnpm": {
|
|
92
95
|
"overrides": {
|
|
93
96
|
"form-data": "^4.0.6",
|
|
94
|
-
"js-yaml@3": "^3.15.
|
|
97
|
+
"js-yaml@3": "^3.15.1",
|
|
95
98
|
"handlebars": "^4.7.9",
|
|
96
99
|
"brace-expansion": "^5.0.9",
|
|
97
100
|
"fast-uri@3": "^3.1.5"
|