@cclabsnz/sf-audit 1.2.0 → 1.3.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/LICENSE +201 -0
- package/README.md +38 -30
- package/lib/chains/namedChains.js +4 -4
- package/lib/checks/impl/AnonymousApexAuditCheck.js +5 -5
- package/lib/checks/impl/ApexCrudFLSCheck.d.ts +1 -1
- package/lib/checks/impl/ApexCrudFLSCheck.js +4 -4
- package/lib/checks/impl/ApexLoggingCheck.js +10 -10
- package/lib/checks/impl/ApexRestEndpointCheck.js +5 -5
- package/lib/checks/impl/ApexSharingCheck.js +3 -3
- package/lib/checks/impl/ApiClientPermissionCheck.js +2 -2
- package/lib/checks/impl/CertificateExpiryCheck.js +1 -1
- package/lib/checks/impl/ConnectedAppInactivityCheck.d.ts +1 -1
- package/lib/checks/impl/ConnectedAppInactivityCheck.js +5 -5
- package/lib/checks/impl/ConnectedAppScopeCheck.d.ts +1 -1
- package/lib/checks/impl/ConnectedAppScopeCheck.js +4 -4
- package/lib/checks/impl/ConnectedAppsCheck.js +2 -2
- package/lib/checks/impl/ContentLinksCheck.js +6 -6
- package/lib/checks/impl/CorsAllowlistCheck.js +3 -3
- package/lib/checks/impl/CustomLabelsCredentialCheck.d.ts +1 -1
- package/lib/checks/impl/CustomLabelsCredentialCheck.js +7 -7
- package/lib/checks/impl/DataClassificationCheck.js +6 -6
- package/lib/checks/impl/DebugLogAccessCheck.js +6 -6
- package/lib/checks/impl/DeploymentIdentityCheck.js +8 -8
- package/lib/checks/impl/EmailSecurityCheck.d.ts +10 -0
- package/lib/checks/impl/EmailSecurityCheck.js +117 -0
- package/lib/checks/impl/EnhancedDomainsCheck.d.ts +1 -1
- package/lib/checks/impl/EnhancedDomainsCheck.js +6 -6
- package/lib/checks/impl/EscalationPermsCheck.js +2 -2
- package/lib/checks/impl/EventMonitoringCheck.js +6 -6
- package/lib/checks/impl/ExperienceCloudSiteCheck.js +3 -3
- package/lib/checks/impl/FailedLoginCheck.js +5 -5
- package/lib/checks/impl/FieldHistoryTrackingCheck.js +3 -3
- package/lib/checks/impl/FieldLevelSecurityCheck.js +2 -2
- package/lib/checks/impl/GuestExecutableApexCheck.d.ts +1 -1
- package/lib/checks/impl/GuestExecutableApexCheck.js +5 -5
- package/lib/checks/impl/GuestUserAccessCheck.js +5 -5
- package/lib/checks/impl/HealthCheckCheck.js +2 -2
- package/lib/checks/impl/HighAssuranceSessionCheck.js +4 -4
- package/lib/checks/impl/InstalledPackagesCheck.js +5 -5
- package/lib/checks/impl/IntegrationUsersCheck.js +5 -5
- package/lib/checks/impl/InternalUserMfaCheck.js +2 -2
- package/lib/checks/impl/IpRestrictionsCheck.js +3 -3
- package/lib/checks/impl/LegacyApiVersionCheck.js +1 -1
- package/lib/checks/impl/MfaEnforcementCheck.js +3 -3
- package/lib/checks/impl/MfaMethodStrengthCheck.js +3 -3
- package/lib/checks/impl/MfaRegistrationCheck.js +2 -2
- package/lib/checks/impl/MyDomainLoginPolicyCheck.d.ts +1 -1
- package/lib/checks/impl/MyDomainLoginPolicyCheck.js +9 -9
- package/lib/checks/impl/NamedCredentialsCheck.js +3 -3
- package/lib/checks/impl/OutboundMessagesCheck.d.ts +10 -0
- package/lib/checks/impl/OutboundMessagesCheck.js +88 -0
- package/lib/checks/impl/PasswordSessionPolicyCheck.js +3 -3
- package/lib/checks/impl/PermissionsCheck.js +3 -3
- package/lib/checks/impl/PrivilegedAccessCheck.d.ts +11 -0
- package/lib/checks/impl/PrivilegedAccessCheck.js +111 -0
- package/lib/checks/impl/PublicContentExposureCheck.d.ts +10 -0
- package/lib/checks/impl/PublicContentExposureCheck.js +98 -0
- package/lib/checks/impl/PublicGroupSharingCheck.js +1 -1
- package/lib/checks/impl/ReleaseUpdatesCheck.js +2 -2
- package/lib/checks/impl/RemoteSitesCheck.js +1 -1
- package/lib/checks/impl/ReportFolderAccessCheck.d.ts +1 -1
- package/lib/checks/impl/ReportFolderAccessCheck.js +4 -4
- package/lib/checks/impl/ScheduledApexCheck.js +1 -1
- package/lib/checks/impl/SeparationOfDutiesCheck.d.ts +11 -0
- package/lib/checks/impl/SeparationOfDutiesCheck.js +114 -0
- package/lib/checks/impl/SharingModelCheck.d.ts +1 -1
- package/lib/checks/impl/SharingModelCheck.js +8 -8
- package/lib/checks/impl/SiemIntegrationCheck.js +4 -4
- package/lib/checks/impl/SsoEnforcementCheck.js +5 -5
- package/lib/checks/impl/StandardProfilesCheck.js +2 -2
- package/lib/checks/impl/TransactionSecurityPolicyCheck.js +2 -2
- package/lib/checks/impl/TrustedIPRangesCheck.js +5 -5
- package/lib/checks/impl/VisualforceXssCheck.js +6 -6
- package/lib/checks/permCatalog.d.ts +15 -0
- package/lib/checks/permCatalog.js +42 -0
- package/lib/checks/registry.js +12 -0
- package/lib/commands/audit/diff.js +1 -1
- package/lib/commands/audit/security.js +2 -2
- package/lib/compliance/mapping.js +9 -2
- package/lib/context/AuditCache.d.ts +9 -0
- package/lib/findings/CheckMeta.js +8 -3
- package/lib/renderers/ClientReportRenderer.js +4 -4
- package/lib/renderers/DiffHtmlRenderer.js +1 -1
- package/lib/renderers/HistoryRenderer.js +1 -1
- package/lib/renderers/HtmlRenderer.js +3 -3
- package/lib/renderers/MarkdownRenderer.js +2 -2
- package/messages/audit.security.md +30 -2
- package/package.json +2 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Wraps a query so a single inaccessible source degrades to an inconclusive finding
|
|
2
|
+
// rather than failing the whole check (mirrors the project-wide permission-error pattern).
|
|
3
|
+
async function tryQuery(fn, findings, category, id, label) {
|
|
4
|
+
try {
|
|
5
|
+
return await fn();
|
|
6
|
+
}
|
|
7
|
+
catch (err) {
|
|
8
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
9
|
+
findings.push({
|
|
10
|
+
id,
|
|
11
|
+
category,
|
|
12
|
+
riskLevel: 'INFO',
|
|
13
|
+
inconclusive: true,
|
|
14
|
+
title: `${label} could not be read`,
|
|
15
|
+
detail: `The query was not accessible: ${msg}`,
|
|
16
|
+
remediation: 'Grant the audit user "View Setup and Configuration", then re-run the audit.',
|
|
17
|
+
});
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export class EmailSecurityCheck {
|
|
22
|
+
id = 'email-security';
|
|
23
|
+
name = 'Email Security & Spoofing';
|
|
24
|
+
category = 'External Connectivity';
|
|
25
|
+
description = 'Flags inbound email services that accept mail from any sender or run Apex without authentication, and org-wide send-as addresses available to every profile';
|
|
26
|
+
async run(ctx) {
|
|
27
|
+
const findings = [];
|
|
28
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
29
|
+
const owaUrl = `${baseUrl}/lightning/setup/OrgWideEmailAddresses/home`;
|
|
30
|
+
const svcUrl = `${baseUrl}/lightning/setup/EmailToApex/home`;
|
|
31
|
+
// 1. Org-wide email addresses available to all profiles — any user can send "as" them.
|
|
32
|
+
const owa = await tryQuery(() => ctx.soql.queryAll('SELECT Id, Address, DisplayName, IsAllowAllProfiles FROM OrgWideEmailAddress'), findings, this.category, 'email-security-owa-inaccessible', 'Org-wide email addresses');
|
|
33
|
+
if (owa) {
|
|
34
|
+
const allProfiles = owa.filter((r) => r.IsAllowAllProfiles);
|
|
35
|
+
if (allProfiles.length > 0) {
|
|
36
|
+
findings.push({
|
|
37
|
+
id: 'email-security-owa-all-profiles',
|
|
38
|
+
category: this.category,
|
|
39
|
+
riskLevel: 'MEDIUM',
|
|
40
|
+
title: `${allProfiles.length} org-wide email address(es) are available to all profiles`,
|
|
41
|
+
detail: 'An org-wide email address available to all profiles lets any user send email that appears to come from that address. This enables internal impersonation (e.g. spoofing a finance or executive sender) in phishing campaigns originating from inside the org.',
|
|
42
|
+
remediation: 'Restrict each org-wide email address to the specific profiles that legitimately need to send as it, rather than allowing all profiles.',
|
|
43
|
+
affectedItems: allProfiles.map((r) => ({
|
|
44
|
+
label: r.Address,
|
|
45
|
+
url: owaUrl,
|
|
46
|
+
note: `${r.DisplayName || 'no display name'}: restrict to specific profiles`,
|
|
47
|
+
})),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else if (owa.length > 0) {
|
|
51
|
+
findings.push({
|
|
52
|
+
id: 'email-security-owa-ok',
|
|
53
|
+
category: this.category,
|
|
54
|
+
riskLevel: 'LOW',
|
|
55
|
+
passed: true,
|
|
56
|
+
title: `${owa.length} org-wide email address(es) are scoped to specific profiles`,
|
|
57
|
+
detail: 'No org-wide email address is exposed to all profiles, limiting send-as impersonation.',
|
|
58
|
+
remediation: 'Continue to scope org-wide addresses to the profiles that need them.',
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// 2. Inbound email services (Email-to-Apex) — internet-reachable Apex triggers.
|
|
63
|
+
const services = await tryQuery(() => ctx.soql.queryAll('SELECT Id, FunctionName, IsActive, IsAuthenticationRequired FROM EmailServicesFunction WHERE IsActive = true'), findings, this.category, 'email-security-services-inaccessible', 'Inbound email services');
|
|
64
|
+
if (services && services.length > 0) {
|
|
65
|
+
const unauthenticated = services.filter((s) => !s.IsAuthenticationRequired);
|
|
66
|
+
if (unauthenticated.length > 0) {
|
|
67
|
+
findings.push({
|
|
68
|
+
id: 'email-security-services-no-auth',
|
|
69
|
+
category: this.category,
|
|
70
|
+
riskLevel: 'HIGH',
|
|
71
|
+
title: `${unauthenticated.length} active inbound email service(s) do not require authentication`,
|
|
72
|
+
detail: 'An inbound email service that does not require authentication runs Apex on receipt of email from any sender. Attackers can invoke the handler repeatedly with crafted payloads, abusing it for spam relay, data injection, or as an unauthenticated entry point into Apex logic.',
|
|
73
|
+
remediation: 'Enable "Advanced Email Security Settings" so the service requires authentication (SPF/DKIM/TLS), and restrict accepted senders on each email address.',
|
|
74
|
+
affectedItems: unauthenticated.map((s) => ({
|
|
75
|
+
label: s.FunctionName,
|
|
76
|
+
url: svcUrl,
|
|
77
|
+
note: 'Active service accepts unauthenticated email',
|
|
78
|
+
})),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
findings.push({
|
|
83
|
+
id: 'email-security-services-ok',
|
|
84
|
+
category: this.category,
|
|
85
|
+
riskLevel: 'LOW',
|
|
86
|
+
passed: true,
|
|
87
|
+
title: `${services.length} active inbound email service(s) require authentication`,
|
|
88
|
+
detail: 'All active inbound email services require authentication before running Apex.',
|
|
89
|
+
remediation: 'Continue to require authentication and restrict accepted senders.',
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// 3. Inbound email service addresses with no authorized-sender restriction.
|
|
94
|
+
const addresses = await tryQuery(() => ctx.soql.queryAll('SELECT Id, LocalPart, EmailDomainName, IsActive, AuthorizedSenders FROM EmailServicesAddress WHERE IsActive = true'), findings, this.category, 'email-security-addresses-inaccessible', 'Inbound email service addresses');
|
|
95
|
+
if (addresses && addresses.length > 0) {
|
|
96
|
+
const open = addresses.filter((a) => !a.AuthorizedSenders || a.AuthorizedSenders.trim() === '');
|
|
97
|
+
if (open.length > 0) {
|
|
98
|
+
findings.push({
|
|
99
|
+
id: 'email-security-addresses-open',
|
|
100
|
+
category: this.category,
|
|
101
|
+
riskLevel: 'MEDIUM',
|
|
102
|
+
title: `${open.length} inbound email address(es) accept mail from any sender`,
|
|
103
|
+
detail: 'An email service address with no "Accept Email From" restriction processes messages from any sender on the internet. Combined with an Apex handler, this is an unauthenticated, internet-facing input surface.',
|
|
104
|
+
remediation: 'Populate "Accept Email From" on each active email service address with the specific domains or addresses that should be allowed to send to it.',
|
|
105
|
+
affectedItems: open.map((a) => ({
|
|
106
|
+
label: `${a.LocalPart}${a.EmailDomainName ? '@' + a.EmailDomainName : ''}`,
|
|
107
|
+
url: svcUrl,
|
|
108
|
+
note: 'No authorized-sender restriction',
|
|
109
|
+
})),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// If nothing was readable at all, the per-source inconclusive findings already explain why.
|
|
114
|
+
return { findings };
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=EmailSecurityCheck.js.map
|
|
@@ -4,7 +4,7 @@ export declare class EnhancedDomainsCheck implements SecurityCheck {
|
|
|
4
4
|
readonly id = "enhanced-domains";
|
|
5
5
|
readonly name = "Enhanced Domains";
|
|
6
6
|
readonly category = "Authentication";
|
|
7
|
-
readonly description = "Verifies Enhanced Domains is enabled
|
|
7
|
+
readonly description = "Verifies Enhanced Domains is enabled: prevents cross-org cookie leakage and enables org-specific URL isolation (required since Spring 2023)";
|
|
8
8
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=EnhancedDomainsCheck.d.ts.map
|
|
@@ -15,7 +15,7 @@ export class EnhancedDomainsCheck {
|
|
|
15
15
|
id = 'enhanced-domains';
|
|
16
16
|
name = 'Enhanced Domains';
|
|
17
17
|
category = 'Authentication';
|
|
18
|
-
description = 'Verifies Enhanced Domains is enabled
|
|
18
|
+
description = 'Verifies Enhanced Domains is enabled: prevents cross-org cookie leakage and enables org-specific URL isolation (required since Spring 2023)';
|
|
19
19
|
async run(ctx) {
|
|
20
20
|
const findings = [];
|
|
21
21
|
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
@@ -45,8 +45,8 @@ export class EnhancedDomainsCheck {
|
|
|
45
45
|
id: 'enhanced-domains-no-my-domain',
|
|
46
46
|
category: this.category,
|
|
47
47
|
riskLevel: isSandbox ? 'MEDIUM' : 'HIGH',
|
|
48
|
-
title: 'My Domain is not configured
|
|
49
|
-
detail: `Enhanced Domains (required for production orgs since Spring 2023) depends on My Domain being configured first. Without My Domain, the org uses shared Salesforce infrastructure URLs, which means cookies and sessions are not isolated to this specific org
|
|
48
|
+
title: 'My Domain is not configured: Enhanced Domains cannot be enabled',
|
|
49
|
+
detail: `Enhanced Domains (required for production orgs since Spring 2023) depends on My Domain being configured first. Without My Domain, the org uses shared Salesforce infrastructure URLs, which means cookies and sessions are not isolated to this specific org, increasing the risk of cross-org credential leakage. My Domain also enables SSO, Lightning Experience, and granular login policies.`,
|
|
50
50
|
remediation: 'Configure My Domain in Setup → My Domain. After testing, deploy to all users. Then enable Enhanced Domains in Setup → My Domain → Enable Enhanced Domains.',
|
|
51
51
|
affectedItems: [{ label: 'My Domain Setup', url: domainSetupUrl, note: 'Configure My Domain as a prerequisite for Enhanced Domains' }],
|
|
52
52
|
});
|
|
@@ -58,7 +58,7 @@ export class EnhancedDomainsCheck {
|
|
|
58
58
|
category: this.category,
|
|
59
59
|
riskLevel: 'LOW',
|
|
60
60
|
passed: true,
|
|
61
|
-
title: `Enhanced Domains is active
|
|
61
|
+
title: `Enhanced Domains is active: org uses isolated subdomain (${myDomain})`,
|
|
62
62
|
detail: `The org instance URL (${instanceUrl}) uses the Enhanced Domain format, confirming that Enhanced Domains is enabled. This means Visualforce pages, Experience Cloud sites, and Lightning apps are served from org-specific subdomains, preventing cross-org cookie leakage and improving URL isolation between Salesforce customers on shared infrastructure.`,
|
|
63
63
|
remediation: 'Verify that any hardcoded legacy URLs (force.com, visualforce.com, site.com) in integrations, bookmarks, or email templates have been updated to the new Enhanced Domain URLs.',
|
|
64
64
|
});
|
|
@@ -68,13 +68,13 @@ export class EnhancedDomainsCheck {
|
|
|
68
68
|
id: 'enhanced-domains-not-detected',
|
|
69
69
|
category: this.category,
|
|
70
70
|
riskLevel: isSandbox ? 'LOW' : 'MEDIUM',
|
|
71
|
-
title: `Enhanced Domains may not be enabled
|
|
71
|
+
title: `Enhanced Domains may not be enabled: org URL appears to use a legacy format`,
|
|
72
72
|
detail: `The org instance URL (${instanceUrl}) does not match the Enhanced Domain URL pattern (*.my.salesforce.com). The org has My Domain (${myDomain}) but may not have completed the Enhanced Domains migration. Enhanced Domains was required for all production orgs as of Spring 2023 and provides critical URL isolation that prevents cross-org cookie leakage.`,
|
|
73
73
|
remediation: 'Enable Enhanced Domains in Setup → My Domain → Enable Enhanced Domains. Review Salesforce release notes for your org edition to confirm Enhanced Domains is available and required. Update any hardcoded legacy URLs after migration.',
|
|
74
74
|
affectedItems: [{
|
|
75
75
|
label: myDomain,
|
|
76
76
|
url: domainSetupUrl,
|
|
77
|
-
note: `Instance URL: ${instanceUrl}
|
|
77
|
+
note: `Instance URL: ${instanceUrl} (expected *.my.salesforce.com format)`,
|
|
78
78
|
}],
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -63,10 +63,10 @@ export class EscalationPermsCheck {
|
|
|
63
63
|
riskLevel: 'HIGH',
|
|
64
64
|
title: `${affected.length} escalation-permission grant(s) across active users`,
|
|
65
65
|
detail: 'These permissions let a user create accounts, reset passwords, assign permission sets, modify metadata, ' +
|
|
66
|
-
'or register auth providers
|
|
66
|
+
'or register auth providers: the primitives an attacker uses for lateral movement and persistence after an initial foothold.',
|
|
67
67
|
remediation: 'Remove these permissions from non-administrator profiles/permission sets and document who legitimately needs each one.',
|
|
68
68
|
affectedItems: affected.map((a) => ({
|
|
69
|
-
label: `${a.username}
|
|
69
|
+
label: `${a.username}: ${a.perm}`,
|
|
70
70
|
url: `${baseUrl}/${a.userId}`,
|
|
71
71
|
note: 'Review and remove if not essential',
|
|
72
72
|
})),
|
|
@@ -33,9 +33,9 @@ export class EventMonitoringCheck {
|
|
|
33
33
|
id: 'event-monitoring-disabled',
|
|
34
34
|
category: this.category,
|
|
35
35
|
riskLevel: 'HIGH',
|
|
36
|
-
title: 'No Event Monitoring log files found in the last 35 days
|
|
36
|
+
title: 'No Event Monitoring log files found in the last 35 days: SBS-MON-001',
|
|
37
37
|
detail: 'SBS-MON-001 requires Event Monitoring storage to be enabled so that login, API access, and data export events are captured. No EventLogFile records exist for the past 35 days, indicating Event Monitoring is either not licensed or not configured.',
|
|
38
|
-
remediation: 'Enable Event Monitoring in Setup → Event Monitoring Settings. If the feature is not licensed, raise with your Salesforce account team
|
|
38
|
+
remediation: 'Enable Event Monitoring in Setup → Event Monitoring Settings. If the feature is not licensed, raise with your Salesforce account team. SBS-MON-001 compliance requires it.',
|
|
39
39
|
affectedItems: [{ label: 'Event Monitoring Setup', url: setupUrl, note: 'Enable event log storage' }],
|
|
40
40
|
});
|
|
41
41
|
return { findings };
|
|
@@ -46,7 +46,7 @@ export class EventMonitoringCheck {
|
|
|
46
46
|
category: this.category,
|
|
47
47
|
riskLevel: 'LOW',
|
|
48
48
|
passed: true,
|
|
49
|
-
title: `Event Monitoring active
|
|
49
|
+
title: `Event Monitoring active: ${totalFiles} log file(s) across ${eventTypes.length} event type(s) (SBS-MON-001)`,
|
|
50
50
|
detail: `SBS-MON-001 requires Event Monitoring to be enabled and actively capturing events. Found ${totalFiles} EventLogFile records covering ${eventTypes.length} distinct event types over the past 35 days. Event types captured: ${eventTypes.slice(0, 12).join(', ')}${eventTypes.length > 12 ? ` (+${eventTypes.length - 12} more)` : ''}.`,
|
|
51
51
|
remediation: 'Review the list of monitored event types and ensure Login, API, DataExport, and LightningInteraction events are included.',
|
|
52
52
|
});
|
|
@@ -58,7 +58,7 @@ export class EventMonitoringCheck {
|
|
|
58
58
|
id: 'event-monitoring-retention-short',
|
|
59
59
|
category: this.category,
|
|
60
60
|
riskLevel: 'MEDIUM',
|
|
61
|
-
title: `Event logs cover only ${daysCovered} day(s)
|
|
61
|
+
title: `Event logs cover only ${daysCovered} day(s): SBS-INT-004 requires 30-day minimum`,
|
|
62
62
|
detail: `SBS-INT-004 requires API event logs to be retained for at least 30 days to support incident investigation. The earliest EventLogFile available is from ${new Date(earliestDate).toISOString().split('T')[0]}, giving only ${daysCovered} day(s) of coverage within the past 35-day window.`,
|
|
63
63
|
remediation: `Export EventLogFile records to an external storage system or SIEM on a daily or weekly basis to maintain 30+ days of retention. Salesforce's native event log retention is typically 1–30 days depending on edition and Event Monitoring tier.`,
|
|
64
64
|
});
|
|
@@ -73,8 +73,8 @@ export class EventMonitoringCheck {
|
|
|
73
73
|
category: this.category,
|
|
74
74
|
riskLevel: 'MEDIUM',
|
|
75
75
|
inconclusive: true,
|
|
76
|
-
title: 'Event Monitoring log files could not be accessed
|
|
77
|
-
detail: 'SBS-MON-001 requires Event Monitoring storage to be enabled. EventLogFile was not accessible
|
|
76
|
+
title: 'Event Monitoring log files could not be accessed: SBS-MON-001 cannot be verified',
|
|
77
|
+
detail: 'SBS-MON-001 requires Event Monitoring storage to be enabled. EventLogFile was not accessible. This may indicate the feature is not licensed or the audit user lacks the "View Event Log Files" permission.',
|
|
78
78
|
remediation: 'Grant "View Event Log Files" permission to the audit user, or verify Event Monitoring is licensed and enabled in Setup → Event Monitoring Settings.',
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -50,7 +50,7 @@ export class ExperienceCloudSiteCheck {
|
|
|
50
50
|
affectedItems: selfRegSites.map((n) => ({
|
|
51
51
|
label: n.Name,
|
|
52
52
|
url: `${baseUrl}/lightning/setup/SetupNetworks/home`,
|
|
53
|
-
note: `Self-registration enabled
|
|
53
|
+
note: `Self-registration enabled, SelfRegProfileId: ${n.SelfRegProfileId}`,
|
|
54
54
|
})),
|
|
55
55
|
});
|
|
56
56
|
}
|
|
@@ -65,7 +65,7 @@ export class ExperienceCloudSiteCheck {
|
|
|
65
65
|
affectedItems: guestSites.map((n) => ({
|
|
66
66
|
label: n.Name,
|
|
67
67
|
url: setupUrl,
|
|
68
|
-
note: `Guest access enabled
|
|
68
|
+
note: `Guest access enabled: verify Guest Profile permissions`,
|
|
69
69
|
})),
|
|
70
70
|
});
|
|
71
71
|
}
|
|
@@ -75,7 +75,7 @@ export class ExperienceCloudSiteCheck {
|
|
|
75
75
|
category: this.category,
|
|
76
76
|
riskLevel: 'LOW',
|
|
77
77
|
passed: true,
|
|
78
|
-
title: `${networks.length} live Experience Cloud site(s)
|
|
78
|
+
title: `${networks.length} live Experience Cloud site(s): no self-registration or open guest access`,
|
|
79
79
|
detail: `All ${networks.length} live site(s) have self-registration disabled and no active guest users. Portal access requires an explicit user account.`,
|
|
80
80
|
remediation: 'Continue to monitor site configuration as sites are updated. Review portal user object permissions periodically.',
|
|
81
81
|
affectedItems: networks.map((n) => ({
|
|
@@ -23,7 +23,7 @@ export class FailedLoginCheck {
|
|
|
23
23
|
category: this.category,
|
|
24
24
|
riskLevel: 'INFO',
|
|
25
25
|
inconclusive: true,
|
|
26
|
-
title: 'LoginHistory could not be queried
|
|
26
|
+
title: 'LoginHistory could not be queried: failed login analysis skipped',
|
|
27
27
|
detail: 'The LoginHistory SOQL query was not accessible. This may indicate the audit user lacks "View All Users" or event monitoring access.',
|
|
28
28
|
remediation: 'Grant "View All Users" to the audit user. For event-level access, enable Event Monitoring.',
|
|
29
29
|
});
|
|
@@ -68,7 +68,7 @@ export class FailedLoginCheck {
|
|
|
68
68
|
affectedItems: heavyTargets.map((r) => ({
|
|
69
69
|
label: r.Username,
|
|
70
70
|
url: setupUrl,
|
|
71
|
-
note: `${r.expr0} failed attempts in 7 days
|
|
71
|
+
note: `${r.expr0} failed attempts in 7 days: likely automated attack`,
|
|
72
72
|
})),
|
|
73
73
|
});
|
|
74
74
|
}
|
|
@@ -94,13 +94,13 @@ export class FailedLoginCheck {
|
|
|
94
94
|
category: this.category,
|
|
95
95
|
riskLevel: 'HIGH',
|
|
96
96
|
title: `${totalFailures} failed logins across the org in the last 7 days`,
|
|
97
|
-
detail: `The org has recorded ${totalFailures} failed login attempts in 7 days distributed across many accounts. This pattern is consistent with broad credential stuffing
|
|
97
|
+
detail: `The org has recorded ${totalFailures} failed login attempts in 7 days distributed across many accounts. This pattern is consistent with broad credential stuffing: attackers using large lists of username/password combinations from data breaches, targeting the entire org rather than specific accounts. Even a low success rate across many attempts can yield multiple compromised accounts.`,
|
|
98
98
|
remediation: 'Review Login History for patterns (source IPs, time clustering, usernames). Enable Transaction Security Policies to rate-limit or block logins from suspicious IPs. Consider enabling Salesforce Shield or Event Monitoring for deeper login analytics.',
|
|
99
99
|
affectedItems: [
|
|
100
100
|
{
|
|
101
101
|
label: 'Org-wide login activity',
|
|
102
102
|
url: setupUrl,
|
|
103
|
-
note: `${totalFailures} failures in 7 days
|
|
103
|
+
note: `${totalFailures} failures in 7 days: review for patterns`,
|
|
104
104
|
},
|
|
105
105
|
],
|
|
106
106
|
});
|
|
@@ -111,7 +111,7 @@ export class FailedLoginCheck {
|
|
|
111
111
|
category: this.category,
|
|
112
112
|
riskLevel: 'LOW',
|
|
113
113
|
passed: true,
|
|
114
|
-
title: `${totalFailures} failed login(s) in 7 days
|
|
114
|
+
title: `${totalFailures} failed login(s) in 7 days: no brute-force patterns detected`,
|
|
115
115
|
detail: `${totalFailures} failed login attempts recorded in the last 7 days, but no single account exceeded the brute-force threshold (${BRUTE_FORCE_PER_USER} failures). This volume appears consistent with normal user error.`,
|
|
116
116
|
remediation: 'Continue monitoring. Configure Transaction Security Policies to alert on anomalous login activity as volumes change.',
|
|
117
117
|
});
|
|
@@ -33,7 +33,7 @@ export class FieldHistoryTrackingCheck {
|
|
|
33
33
|
category: this.category,
|
|
34
34
|
riskLevel: 'LOW',
|
|
35
35
|
passed: true,
|
|
36
|
-
title: 'Field history tracking enabled on all checked sensitive objects
|
|
36
|
+
title: 'Field history tracking enabled on all checked sensitive objects: SBS-DATA-004',
|
|
37
37
|
detail: `SBS-DATA-004 requires field history tracking on sensitive objects to support incident investigation and compliance evidence. All ${SENSITIVE_OBJECTS.length} checked objects have at least one tracked field. Objects: ${withTracking.map((o) => `${o} (${trackedMap.get(o)} field(s))`).join(', ')}.`,
|
|
38
38
|
remediation: 'Periodically review which specific fields are tracked to ensure key sensitive fields (email address, phone, revenue, status) are included.',
|
|
39
39
|
});
|
|
@@ -43,13 +43,13 @@ export class FieldHistoryTrackingCheck {
|
|
|
43
43
|
id: 'field-history-tracking-missing',
|
|
44
44
|
category: this.category,
|
|
45
45
|
riskLevel: withoutTracking.length >= 3 ? 'HIGH' : 'MEDIUM',
|
|
46
|
-
title: `${withoutTracking.length} sensitive object(s) have no field history tracking
|
|
46
|
+
title: `${withoutTracking.length} sensitive object(s) have no field history tracking: SBS-DATA-004`,
|
|
47
47
|
detail: `SBS-DATA-004 requires field history tracking on sensitive objects to capture who changed what data and when, enabling post-incident investigation and audit evidence. The following objects have no tracked fields: ${withoutTracking.join(', ')}. ${withTracking.length > 0 ? `Objects already configured: ${withTracking.map((o) => `${o} (${trackedMap.get(o)} field(s))`).join(', ')}.` : ''}`,
|
|
48
48
|
remediation: 'Enable field history tracking on each listed object in Setup → Object Manager → [Object] → Fields & Relationships → Set History Tracking. At minimum track key sensitive fields: email addresses, phone numbers, revenue fields, owner changes, and status changes.',
|
|
49
49
|
affectedItems: withoutTracking.map((name) => ({
|
|
50
50
|
label: name,
|
|
51
51
|
url: `${setupUrl}/list?objectType=${name}`,
|
|
52
|
-
note: 'No fields have history tracking enabled
|
|
52
|
+
note: 'No fields have history tracking enabled: configure via Object Manager → Set History Tracking',
|
|
53
53
|
})),
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -121,7 +121,7 @@ export class FieldLevelSecurityCheck {
|
|
|
121
121
|
return {
|
|
122
122
|
label: r.Field,
|
|
123
123
|
url: `${baseUrl}/lightning/setup/ObjectManager/${objectApiName}/FieldsAndRelationships/view`,
|
|
124
|
-
note: `Readable by ${r.cnt} permission sets
|
|
124
|
+
note: `Readable by ${r.cnt} permission sets: restrict to minimum required`,
|
|
125
125
|
};
|
|
126
126
|
}),
|
|
127
127
|
detail: 'Widely-accessible sensitive fields increase the risk of data exposure. These fields may contain PII, PHI, or financial data.',
|
|
@@ -139,7 +139,7 @@ export class FieldLevelSecurityCheck {
|
|
|
139
139
|
return {
|
|
140
140
|
label: r.Field,
|
|
141
141
|
url: `${baseUrl}/lightning/setup/ObjectManager/${objectApiName}/FieldsAndRelationships/view`,
|
|
142
|
-
note: `Readable by ${r.cnt} permission sets
|
|
142
|
+
note: `Readable by ${r.cnt} permission sets: review and reduce access`,
|
|
143
143
|
};
|
|
144
144
|
}),
|
|
145
145
|
detail: 'Widely-accessible sensitive fields increase the risk of data exposure. These fields may contain PII, PHI, or financial data.',
|
|
@@ -4,7 +4,7 @@ export declare class GuestExecutableApexCheck implements SecurityCheck {
|
|
|
4
4
|
readonly id = "guest-executable-apex";
|
|
5
5
|
readonly name = "Guest-Executable Apex";
|
|
6
6
|
readonly category = "Access Control";
|
|
7
|
-
readonly description = "Finds Apex classes that unauthenticated guest profiles can execute, flagging those that run without sharing
|
|
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
8
|
readonly dependsOnCache: readonly ["apexBodies"];
|
|
9
9
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
10
|
}
|
|
@@ -4,7 +4,7 @@ export class GuestExecutableApexCheck {
|
|
|
4
4
|
id = 'guest-executable-apex';
|
|
5
5
|
name = 'Guest-Executable Apex';
|
|
6
6
|
category = 'Access Control';
|
|
7
|
-
description = 'Finds Apex classes that unauthenticated guest profiles can execute, flagging those that run without sharing
|
|
7
|
+
description = 'Finds Apex classes that unauthenticated guest profiles can execute, flagging those that run without sharing: the classic unauthenticated data-exfiltration vector';
|
|
8
8
|
// Use cached Apex bodies (from HardcodedCredentialsCheck) when available to classify sharing.
|
|
9
9
|
dependsOnCache = ['apexBodies'];
|
|
10
10
|
async run(ctx) {
|
|
@@ -17,7 +17,7 @@ export class GuestExecutableApexCheck {
|
|
|
17
17
|
category: this.category,
|
|
18
18
|
riskLevel: 'LOW',
|
|
19
19
|
passed: true,
|
|
20
|
-
title: 'No active guest users
|
|
20
|
+
title: 'No active guest users: guest-executable Apex not a concern',
|
|
21
21
|
detail: 'There are no active guest users, so no Apex class is reachable by unauthenticated visitors.',
|
|
22
22
|
remediation: 'If an Experience Cloud/Sites guest user is added later, re-run this audit.',
|
|
23
23
|
});
|
|
@@ -70,9 +70,9 @@ export class GuestExecutableApexCheck {
|
|
|
70
70
|
title: `${unprotected.length} guest-executable Apex class(es) run without "with sharing"`,
|
|
71
71
|
detail: 'These Apex classes can be invoked by unauthenticated guest users AND do not enforce record-level sharing. ' +
|
|
72
72
|
'This is the classic Salesforce guest-user exploit chain: an attacker calls the class and reads or writes ' +
|
|
73
|
-
'business data in bulk with no login. Object-level guest permissions do not mitigate this
|
|
73
|
+
'business data in bulk with no login. Object-level guest permissions do not mitigate this: the class runs in system context.',
|
|
74
74
|
remediation: 'Add "with sharing" to every guest-reachable Apex class, enforce CRUD/FLS, and remove guest execution access from any class that does not strictly need it.',
|
|
75
|
-
affectedItems: unprotected.map((n) => ({ label: n, url: apexUrl, note: 'Guest-executable + without/with-no sharing
|
|
75
|
+
affectedItems: unprotected.map((n) => ({ label: n, url: apexUrl, note: 'Guest-executable + without/with-no sharing: fix immediately' })),
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
if (exposed.length > 0) {
|
|
@@ -84,7 +84,7 @@ export class GuestExecutableApexCheck {
|
|
|
84
84
|
detail: 'Guest user profiles can execute these Apex classes. Even with "with sharing", any guest-reachable Apex is ' +
|
|
85
85
|
'unauthenticated attack surface and must enforce CRUD/FLS and validate all input.',
|
|
86
86
|
remediation: 'Review each class for least-privilege: confirm "with sharing", CRUD/FLS checks, and input validation. Remove guest access where unnecessary.',
|
|
87
|
-
affectedItems: exposed.map((n) => ({ label: n, url: apexUrl, note: 'Guest-executable
|
|
87
|
+
affectedItems: exposed.map((n) => ({ label: n, url: apexUrl, note: 'Guest-executable: review for least privilege' })),
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
return { findings };
|
|
@@ -104,9 +104,9 @@ export class GuestUserAccessCheck {
|
|
|
104
104
|
.filter(Boolean)
|
|
105
105
|
.join('/');
|
|
106
106
|
return {
|
|
107
|
-
label: `${v.username}
|
|
107
|
+
label: `${v.username}: ${v.sobjectType}`,
|
|
108
108
|
url: `${baseUrl}/${v.userId}`,
|
|
109
|
-
note: `Can ${actions}
|
|
109
|
+
note: `Can ${actions}: remove immediately`,
|
|
110
110
|
};
|
|
111
111
|
}),
|
|
112
112
|
detail: 'Unauthenticated users (guests) with write access to standard objects represents a critical misconfiguration. SBS-CPORTAL-002 requires guest users have no access to business objects.',
|
|
@@ -121,9 +121,9 @@ export class GuestUserAccessCheck {
|
|
|
121
121
|
riskLevel: 'HIGH',
|
|
122
122
|
title: `${readViolations.length} object(s) grant read access to guest user(s)`,
|
|
123
123
|
affectedItems: readViolations.map((v) => ({
|
|
124
|
-
label: `${v.username}
|
|
124
|
+
label: `${v.username}: ${v.sobjectType}`,
|
|
125
125
|
url: `${baseUrl}/${v.userId}`,
|
|
126
|
-
note: 'Read access
|
|
126
|
+
note: 'Read access: remove from guest profile; restrict to authenticated users only',
|
|
127
127
|
})),
|
|
128
128
|
detail: 'SBS-CPORTAL-002 requires guest users be limited to authentication flows only with no access to business objects. Read access exposes data to unauthenticated visitors.',
|
|
129
129
|
remediation: 'Remove Read permissions on all business objects from guest user profiles. Data access should only be granted after authentication.',
|
|
@@ -139,7 +139,7 @@ export class GuestUserAccessCheck {
|
|
|
139
139
|
affectedItems: sharingExposures.map((e) => ({
|
|
140
140
|
label: e.shareTable,
|
|
141
141
|
url: `${baseUrl}/lightning/setup/SecuritySharing/page`,
|
|
142
|
-
note: `${e.count} sharing rule(s)
|
|
142
|
+
note: `${e.count} sharing rule(s): review and remove guest-targeting rules`,
|
|
143
143
|
})),
|
|
144
144
|
detail: 'Sharing rules targeting guest users can expose internal records to unauthenticated visitors.',
|
|
145
145
|
remediation: 'Review and remove sharing rules that grant guest users access to Salesforce records. Use Experience Cloud sites with explicit data access controls instead.',
|
|
@@ -39,7 +39,7 @@ export class HealthCheckCheck {
|
|
|
39
39
|
affectedItems: highRisks.map((r) => ({
|
|
40
40
|
label: r.Setting,
|
|
41
41
|
url: healthCheckUrl,
|
|
42
|
-
note: `Current: ${r.OrgValue}
|
|
42
|
+
note: `Current: ${r.OrgValue}. Recommended: ${r.StandardValue}`,
|
|
43
43
|
})),
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -60,7 +60,7 @@ export class HealthCheckCheck {
|
|
|
60
60
|
affectedItems: mediumRisks.map((r) => ({
|
|
61
61
|
label: r.Setting,
|
|
62
62
|
url: healthCheckUrl,
|
|
63
|
-
note: `Current: ${r.OrgValue}
|
|
63
|
+
note: `Current: ${r.OrgValue}. Recommended: ${r.StandardValue}`,
|
|
64
64
|
})),
|
|
65
65
|
});
|
|
66
66
|
}
|
|
@@ -38,7 +38,7 @@ export class HighAssuranceSessionCheck {
|
|
|
38
38
|
category: this.category,
|
|
39
39
|
riskLevel: 'LOW',
|
|
40
40
|
passed: true,
|
|
41
|
-
title: 'No connected apps found
|
|
41
|
+
title: 'No connected apps found: session policy check not applicable',
|
|
42
42
|
detail: 'No connected apps are configured in this org.',
|
|
43
43
|
remediation: 'Continue monitoring as connected apps are added.',
|
|
44
44
|
});
|
|
@@ -66,8 +66,8 @@ export class HighAssuranceSessionCheck {
|
|
|
66
66
|
label: a.Name,
|
|
67
67
|
url: setupUrl,
|
|
68
68
|
note: a.SessionTimeout === null || a.SessionTimeout === 0
|
|
69
|
-
? 'No session timeout
|
|
70
|
-
: `Session timeout: ${Math.round(a.SessionTimeout / 3600)}h
|
|
69
|
+
? 'No session timeout: sessions never expire'
|
|
70
|
+
: `Session timeout: ${Math.round(a.SessionTimeout / 3600)}h, reduce to ≤2h`,
|
|
71
71
|
})),
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -82,7 +82,7 @@ export class HighAssuranceSessionCheck {
|
|
|
82
82
|
affectedItems: noTimeout.slice(0, 20).map((a) => ({
|
|
83
83
|
label: a.Name,
|
|
84
84
|
url: setupUrl,
|
|
85
|
-
note: 'No session timeout
|
|
85
|
+
note: 'No session timeout: configure a timeout in Connected App policies',
|
|
86
86
|
})),
|
|
87
87
|
});
|
|
88
88
|
}
|
|
@@ -50,13 +50,13 @@ export class InstalledPackagesCheck {
|
|
|
50
50
|
id: 'installed-packages-unmanaged',
|
|
51
51
|
category: this.category,
|
|
52
52
|
riskLevel: 'HIGH',
|
|
53
|
-
title: `${unmanagedPackages.length} unmanaged package(s) installed
|
|
53
|
+
title: `${unmanagedPackages.length} unmanaged package(s) installed: code is editable and bypasses AppExchange security review`,
|
|
54
54
|
detail: 'Unmanaged packages contain Apex code, Visualforce pages, and other metadata that can be edited directly in the target org. Unlike managed packages, unmanaged packages are not subject to the Salesforce AppExchange security review process. Installed unmanaged code should be treated as untrusted third-party code and reviewed manually for data access, SOQL injection vulnerabilities, and hardcoded credentials.',
|
|
55
55
|
remediation: 'Review the code in each unmanaged package. Remove any unmanaged packages that are no longer required. For required packages, conduct a manual security review of the included Apex code and ensure it follows Salesforce security best practices. Consider migrating functionality to managed packages or native platform features.',
|
|
56
56
|
affectedItems: unmanagedPackages.map((p) => ({
|
|
57
57
|
label: p.SubscriberPackage.Name,
|
|
58
58
|
url: setupUrl,
|
|
59
|
-
note: `no namespace
|
|
59
|
+
note: `no namespace | unmanaged | publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'} | version: ${versionString(p)}`,
|
|
60
60
|
})),
|
|
61
61
|
});
|
|
62
62
|
}
|
|
@@ -71,7 +71,7 @@ export class InstalledPackagesCheck {
|
|
|
71
71
|
affectedItems: betaPackages.map((p) => ({
|
|
72
72
|
label: p.SubscriberPackage.Name,
|
|
73
73
|
url: setupUrl,
|
|
74
|
-
note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'none'}
|
|
74
|
+
note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'none'} | state: Beta | version: ${versionString(p)} | publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'}`,
|
|
75
75
|
})),
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -79,13 +79,13 @@ export class InstalledPackagesCheck {
|
|
|
79
79
|
id: 'installed-packages-inventory',
|
|
80
80
|
category: this.category,
|
|
81
81
|
riskLevel: 'INFO',
|
|
82
|
-
title: `${packages.length} package(s) installed
|
|
82
|
+
title: `${packages.length} package(s) installed: full inventory`,
|
|
83
83
|
detail: `${packages.length} installed package(s) found. All installed packages should be reviewed periodically to confirm they are still required, up to date, and from trusted publishers. Packages with elevated data access permissions should be audited for field-level security and sharing configurations.`,
|
|
84
84
|
remediation: 'Review the package inventory at least annually. Remove packages that are no longer in use. Ensure all packages are updated to their latest GA versions to receive security patches.',
|
|
85
85
|
affectedItems: packages.map((p) => ({
|
|
86
86
|
label: p.SubscriberPackage.Name,
|
|
87
87
|
url: setupUrl,
|
|
88
|
-
note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'no namespace
|
|
88
|
+
note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'no namespace (unmanaged)'} | version: ${versionString(p)} | publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'} | state: ${p.SubscriberPackageVersion.ReleaseState}`,
|
|
89
89
|
})),
|
|
90
90
|
});
|
|
91
91
|
return { findings };
|
|
@@ -48,7 +48,7 @@ export class IntegrationUsersCheck {
|
|
|
48
48
|
category: this.category,
|
|
49
49
|
riskLevel: 'LOW',
|
|
50
50
|
passed: true,
|
|
51
|
-
title: 'No candidate non-human identities found
|
|
51
|
+
title: 'No candidate non-human identities found: SBS-ACS-007',
|
|
52
52
|
detail: 'SBS-ACS-007 requires all non-human identities to be inventoried and documented. No standard users matching common service account patterns (by username) or never-logged-in users were found.',
|
|
53
53
|
remediation: 'As integration accounts are created, ensure they are documented with a named owner, stated purpose, and review date.',
|
|
54
54
|
});
|
|
@@ -59,7 +59,7 @@ export class IntegrationUsersCheck {
|
|
|
59
59
|
id: 'integration-users-inventory',
|
|
60
60
|
category: this.category,
|
|
61
61
|
riskLevel: 'INFO',
|
|
62
|
-
title: `${candidates.length} candidate non-human identity/identities found
|
|
62
|
+
title: `${candidates.length} candidate non-human identity/identities found: SBS-ACS-007`,
|
|
63
63
|
detail: 'SBS-ACS-007 requires all non-human identities (integration accounts, service users, automation users) to be inventoried and documented with a named owner, stated purpose, and review date. These users were identified by never having a UI login (and being more than 30 days old) or matching common service-account username patterns.',
|
|
64
64
|
remediation: 'Verify that each listed user is a known, documented non-human identity. Any undocumented account should be reviewed and either documented or deactivated. Maintain a register of all integration identities with their owner and purpose.',
|
|
65
65
|
affectedItems: candidates.map((u) => ({
|
|
@@ -92,13 +92,13 @@ export class IntegrationUsersCheck {
|
|
|
92
92
|
id: 'integration-users-broad-permissions',
|
|
93
93
|
category: this.category,
|
|
94
94
|
riskLevel: modifyAll.length > 0 ? 'HIGH' : 'MEDIUM',
|
|
95
|
-
title: `${broadPermUsers.length} service account(s) hold Modify All / View All Data
|
|
96
|
-
detail: `SBS-ACS-008 requires non-human identities to hold only the minimum permissions necessary for their function. ${modifyAll.length} account(s) have "Modify All Data" and ${viewAll.length} have "View All Data"
|
|
95
|
+
title: `${broadPermUsers.length} service account(s) hold Modify All / View All Data: SBS-ACS-008`,
|
|
96
|
+
detail: `SBS-ACS-008 requires non-human identities to hold only the minimum permissions necessary for their function. ${modifyAll.length} account(s) have "Modify All Data" and ${viewAll.length} have "View All Data". These are org-wide permissions exposing all records and should never be granted to integration accounts without explicit documented justification.`,
|
|
97
97
|
remediation: `Replace broad data permissions with object- and field-specific permissions scoped to the integration's actual data needs. Use a dedicated permission set that grants only the objects and operations the integration requires.`,
|
|
98
98
|
affectedItems: broadPermUsers.map((r) => ({
|
|
99
99
|
label: r.Assignee.Username,
|
|
100
100
|
url: `${baseUrl}/${r.Assignee.Id}`,
|
|
101
|
-
note: `via: ${r.PermissionSet.Name}
|
|
101
|
+
note: `via: ${r.PermissionSet.Name}: ${r.PermissionSet.PermissionsModifyAllData ? 'Modify All Data' : 'View All Data'}`,
|
|
102
102
|
})),
|
|
103
103
|
});
|
|
104
104
|
}
|
|
@@ -67,12 +67,12 @@ export class InternalUserMfaCheck {
|
|
|
67
67
|
category: this.category,
|
|
68
68
|
riskLevel,
|
|
69
69
|
title: `${usersWithoutMfa.length} of ${users.length} active internal user(s) lack explicit MFA enforcement permission`,
|
|
70
|
-
detail: `${usersWithoutMfa.length} active standard users do not have the PermissionsMultiFactorForUiLogins permission assigned. Salesforce auto-enforced MFA at the system level in Spring 2023, but the explicit permission provides belt-and-suspenders assurance
|
|
70
|
+
detail: `${usersWithoutMfa.length} active standard users do not have the PermissionsMultiFactorForUiLogins permission assigned. Salesforce auto-enforced MFA at the system level in Spring 2023, but the explicit permission provides belt-and-suspenders assurance. Users without it rely solely on system-level enforcement, which can have edge cases in API-heavy or SSO-integrated environments. Users without the explicit permission should be reviewed to confirm they are subject to effective MFA controls.`,
|
|
71
71
|
remediation: 'Assign the "Multi-Factor Authentication for User Interface Logins" permission to all internal standard users via their profile or a permission set. This ensures MFA is explicitly enforced regardless of system-level settings. Prioritise users with privileged access or access to sensitive data.',
|
|
72
72
|
affectedItems: usersWithoutMfa.slice(0, 50).map((u) => ({
|
|
73
73
|
label: u.Username,
|
|
74
74
|
url: `${baseUrl}/${u.Id}`,
|
|
75
|
-
note: `profile: ${u.Profile?.Name ?? 'unknown'}
|
|
75
|
+
note: `profile: ${u.Profile?.Name ?? 'unknown'} | last login: ${u.LastLoginDate ? new Date(u.LastLoginDate).toISOString().split('T')[0] : 'never'}`,
|
|
76
76
|
})),
|
|
77
77
|
});
|
|
78
78
|
return { findings };
|
|
@@ -72,7 +72,7 @@ export class IpRestrictionsCheck {
|
|
|
72
72
|
affectedItems: unrestrictedAdmins.map((u) => ({
|
|
73
73
|
label: u.Username,
|
|
74
74
|
url: `${baseUrl}/${u.Id}`,
|
|
75
|
-
note: `Profile: ${u.Profile.Name}
|
|
75
|
+
note: `Profile: ${u.Profile.Name}: add IP ranges in Setup → Profiles → Login IP Ranges`,
|
|
76
76
|
})),
|
|
77
77
|
detail: 'Administrator accounts without IP login restrictions can be accessed from any network, increasing exposure to credential-stuffing attacks.',
|
|
78
78
|
remediation: 'Add IP login ranges to all admin profiles in Setup → Profiles → Login IP Ranges, or enable MFA as a compensating control.',
|
|
@@ -87,7 +87,7 @@ export class IpRestrictionsCheck {
|
|
|
87
87
|
affectedItems: ipBypassingApps.map((app) => ({
|
|
88
88
|
label: app.name,
|
|
89
89
|
url: `${baseUrl}/lightning/setup/ConnectedApplication/page`,
|
|
90
|
-
note: 'IP Relaxation = All
|
|
90
|
+
note: 'IP Relaxation = All: change to "Enforce IP Restrictions" or "Relax IP Restrictions" to reinstate controls',
|
|
91
91
|
})),
|
|
92
92
|
detail: `Connected apps configured with IP Relaxation set to "All" allow API access from any IP address for any user, completely overriding profile-level IP restrictions. An attacker with a stolen OAuth token or credential can authenticate from anywhere regardless of org-level IP policies.`,
|
|
93
93
|
remediation: 'Set IP Relaxation to "Enforce IP Restrictions" (WhiteList) for all connected apps unless there is a documented, audited business requirement for remote access. Review each app and confirm the relaxation setting is intentional.',
|
|
@@ -102,7 +102,7 @@ export class IpRestrictionsCheck {
|
|
|
102
102
|
affectedItems: ipRelaxingApps.map((app) => ({
|
|
103
103
|
label: app.name,
|
|
104
104
|
url: `${baseUrl}/lightning/setup/ConnectedApplication/page`,
|
|
105
|
-
note: 'IP Relaxation = Relax
|
|
105
|
+
note: 'IP Relaxation = Relax: confirm documented justification exists',
|
|
106
106
|
})),
|
|
107
107
|
detail: `Connected apps configured with IP Relaxation set to "Relax" allow the app's users to access the org from outside the IP ranges defined on their profile when using this app. This weakens the IP restriction control for API access.`,
|
|
108
108
|
remediation: 'Set IP Relaxation to "Enforce IP Restrictions" unless the integration genuinely requires access from IP addresses outside the corporate network. Document any justified relaxations in the system of record.',
|