@cclabsnz/sf-audit 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +228 -31
- package/lib/api/ToolingClientImpl.js +5 -2
- package/lib/chains/AttackChain.d.ts +20 -0
- package/lib/chains/AttackChain.js +2 -0
- package/lib/chains/Capability.d.ts +7 -0
- package/lib/chains/Capability.js +11 -0
- package/lib/chains/CapabilityRegistry.d.ts +18 -0
- package/lib/chains/CapabilityRegistry.js +53 -0
- package/lib/chains/ChainEngine.d.ts +13 -0
- package/lib/chains/ChainEngine.js +137 -0
- package/lib/chains/namedChains.d.ts +14 -0
- package/lib/chains/namedChains.js +99 -0
- package/lib/checks/CheckEngine.js +33 -5
- package/lib/checks/impl/AnonymousApexAuditCheck.d.ts +10 -0
- package/lib/checks/impl/AnonymousApexAuditCheck.js +106 -0
- package/lib/checks/impl/ApexCrudFLSCheck.d.ts +11 -0
- package/lib/checks/impl/ApexCrudFLSCheck.js +98 -0
- package/lib/checks/impl/ApexLoggingCheck.d.ts +11 -0
- package/lib/checks/impl/ApexLoggingCheck.js +124 -0
- package/lib/checks/impl/ApexRestEndpointCheck.d.ts +11 -0
- package/lib/checks/impl/ApexRestEndpointCheck.js +94 -0
- package/lib/checks/impl/ApexSharingCheck.js +29 -0
- package/lib/checks/impl/ApiClientPermissionCheck.d.ts +10 -0
- package/lib/checks/impl/ApiClientPermissionCheck.js +59 -0
- package/lib/checks/impl/AuditTrailCheck.js +29 -0
- package/lib/checks/impl/CertificateExpiryCheck.d.ts +10 -0
- package/lib/checks/impl/CertificateExpiryCheck.js +123 -0
- package/lib/checks/impl/CodeSecurityCheck.d.ts +2 -1
- package/lib/checks/impl/CodeSecurityCheck.js +46 -6
- package/lib/checks/impl/ConnectedAppInactivityCheck.d.ts +11 -0
- package/lib/checks/impl/ConnectedAppInactivityCheck.js +86 -0
- package/lib/checks/impl/ConnectedAppScopeCheck.d.ts +10 -0
- package/lib/checks/impl/ConnectedAppScopeCheck.js +125 -0
- package/lib/checks/impl/ConnectedAppsCheck.d.ts +1 -0
- package/lib/checks/impl/ConnectedAppsCheck.js +37 -2
- package/lib/checks/impl/ContentLinksCheck.d.ts +10 -0
- package/lib/checks/impl/ContentLinksCheck.js +115 -0
- package/lib/checks/impl/CorsAllowlistCheck.d.ts +10 -0
- package/lib/checks/impl/CorsAllowlistCheck.js +80 -0
- package/lib/checks/impl/CspTrustedSitesCheck.d.ts +10 -0
- package/lib/checks/impl/CspTrustedSitesCheck.js +55 -0
- package/lib/checks/impl/CustomLabelsCredentialCheck.d.ts +10 -0
- package/lib/checks/impl/CustomLabelsCredentialCheck.js +97 -0
- package/lib/checks/impl/DataClassificationCheck.d.ts +10 -0
- package/lib/checks/impl/DataClassificationCheck.js +112 -0
- package/lib/checks/impl/DebugLogAccessCheck.d.ts +10 -0
- package/lib/checks/impl/DebugLogAccessCheck.js +81 -0
- package/lib/checks/impl/DeploymentIdentityCheck.d.ts +11 -0
- package/lib/checks/impl/DeploymentIdentityCheck.js +144 -0
- package/lib/checks/impl/EnhancedDomainsCheck.d.ts +10 -0
- package/lib/checks/impl/EnhancedDomainsCheck.js +84 -0
- package/lib/checks/impl/EscalationPermsCheck.d.ts +10 -0
- package/lib/checks/impl/EscalationPermsCheck.js +77 -0
- package/lib/checks/impl/EventMonitoringCheck.d.ts +11 -0
- package/lib/checks/impl/EventMonitoringCheck.js +84 -0
- package/lib/checks/impl/ExperienceCloudSiteCheck.d.ts +10 -0
- package/lib/checks/impl/ExperienceCloudSiteCheck.js +91 -0
- package/lib/checks/impl/FailedLoginCheck.d.ts +10 -0
- package/lib/checks/impl/FailedLoginCheck.js +122 -0
- package/lib/checks/impl/FieldHistoryTrackingCheck.d.ts +10 -0
- package/lib/checks/impl/FieldHistoryTrackingCheck.js +70 -0
- package/lib/checks/impl/FieldLevelSecurityCheck.js +28 -18
- package/lib/checks/impl/GuestExecutableApexCheck.d.ts +11 -0
- package/lib/checks/impl/GuestExecutableApexCheck.js +93 -0
- package/lib/checks/impl/GuestUserAccessCheck.js +74 -66
- package/lib/checks/impl/HardcodedCredentialsCheck.js +2 -2
- package/lib/checks/impl/HighAssuranceSessionCheck.d.ts +10 -0
- package/lib/checks/impl/HighAssuranceSessionCheck.js +103 -0
- package/lib/checks/impl/InactiveUsersCheck.js +38 -19
- package/lib/checks/impl/InstalledPackagesCheck.d.ts +10 -0
- package/lib/checks/impl/InstalledPackagesCheck.js +94 -0
- package/lib/checks/impl/IntegrationUsersCheck.d.ts +10 -0
- package/lib/checks/impl/IntegrationUsersCheck.js +108 -0
- package/lib/checks/impl/InternalUserMfaCheck.d.ts +10 -0
- package/lib/checks/impl/InternalUserMfaCheck.js +81 -0
- package/lib/checks/impl/IpRestrictionsCheck.js +86 -23
- package/lib/checks/impl/LegacyApiVersionCheck.d.ts +10 -0
- package/lib/checks/impl/LegacyApiVersionCheck.js +91 -0
- package/lib/checks/impl/MfaEnforcementCheck.d.ts +10 -0
- package/lib/checks/impl/MfaEnforcementCheck.js +76 -0
- package/lib/checks/impl/MfaMethodStrengthCheck.d.ts +11 -0
- package/lib/checks/impl/MfaMethodStrengthCheck.js +116 -0
- package/lib/checks/impl/MfaRegistrationCheck.d.ts +11 -0
- package/lib/checks/impl/MfaRegistrationCheck.js +95 -0
- package/lib/checks/impl/MyDomainLoginPolicyCheck.d.ts +10 -0
- package/lib/checks/impl/MyDomainLoginPolicyCheck.js +105 -0
- package/lib/checks/impl/NamedCredentialsCheck.js +37 -2
- package/lib/checks/impl/PermissionsCheck.js +67 -14
- package/lib/checks/impl/PublicGroupSharingCheck.js +20 -9
- package/lib/checks/impl/ReleaseUpdatesCheck.d.ts +10 -0
- package/lib/checks/impl/ReleaseUpdatesCheck.js +106 -0
- package/lib/checks/impl/ReportFolderAccessCheck.d.ts +10 -0
- package/lib/checks/impl/ReportFolderAccessCheck.js +54 -0
- package/lib/checks/impl/ScheduledApexCheck.d.ts +1 -0
- package/lib/checks/impl/ScheduledApexCheck.js +3 -0
- package/lib/checks/impl/SharingModelCheck.d.ts +1 -1
- package/lib/checks/impl/SharingModelCheck.js +103 -32
- package/lib/checks/impl/SiemIntegrationCheck.d.ts +11 -0
- package/lib/checks/impl/SiemIntegrationCheck.js +102 -0
- package/lib/checks/impl/SsoEnforcementCheck.d.ts +10 -0
- package/lib/checks/impl/SsoEnforcementCheck.js +90 -0
- package/lib/checks/impl/StandardProfilesCheck.d.ts +10 -0
- package/lib/checks/impl/StandardProfilesCheck.js +68 -0
- package/lib/checks/impl/TransactionSecurityPolicyCheck.d.ts +10 -0
- package/lib/checks/impl/TransactionSecurityPolicyCheck.js +62 -0
- package/lib/checks/impl/TrustedIPRangesCheck.d.ts +10 -0
- package/lib/checks/impl/TrustedIPRangesCheck.js +106 -0
- package/lib/checks/impl/UsersAndAdminsCheck.js +50 -20
- package/lib/checks/impl/VisualforceXssCheck.d.ts +11 -0
- package/lib/checks/impl/VisualforceXssCheck.js +150 -0
- package/lib/checks/registry.js +97 -12
- package/lib/commands/audit/diff.d.ts +17 -0
- package/lib/commands/audit/diff.js +76 -0
- package/lib/commands/audit/history.d.ts +15 -0
- package/lib/commands/audit/history.js +59 -0
- package/lib/commands/audit/security.d.ts +5 -0
- package/lib/commands/audit/security.js +38 -9
- package/lib/compliance/catalogs/hiso10029.d.ts +3 -0
- package/lib/compliance/catalogs/hiso10029.js +35 -0
- package/lib/compliance/catalogs/index.d.ts +4 -0
- package/lib/compliance/catalogs/index.js +21 -0
- package/lib/compliance/catalogs/iso27001.d.ts +3 -0
- package/lib/compliance/catalogs/iso27001.js +39 -0
- package/lib/compliance/catalogs/nzism.d.ts +3 -0
- package/lib/compliance/catalogs/nzism.js +31 -0
- package/lib/compliance/catalogs/owasp.d.ts +3 -0
- package/lib/compliance/catalogs/owasp.js +37 -0
- package/lib/compliance/catalogs/privacyAct.d.ts +3 -0
- package/lib/compliance/catalogs/privacyAct.js +17 -0
- package/lib/compliance/catalogs/sbs.d.ts +3 -0
- package/lib/compliance/catalogs/sbs.js +61 -0
- package/lib/compliance/catalogs/soc2.d.ts +3 -0
- package/lib/compliance/catalogs/soc2.js +42 -0
- package/lib/compliance/mapping.d.ts +2 -0
- package/lib/compliance/mapping.js +111 -0
- package/lib/compliance/resolve.d.ts +12 -0
- package/lib/compliance/resolve.js +49 -0
- package/lib/compliance/types.d.ts +13 -0
- package/lib/compliance/types.js +2 -0
- package/lib/context/AuditCache.d.ts +20 -0
- package/lib/context/AuditContext.d.ts +0 -2
- package/lib/findings/AuditResult.d.ts +3 -0
- package/lib/findings/CheckMeta.d.ts +9 -0
- package/lib/findings/CheckMeta.js +67 -0
- package/lib/findings/ComplianceMapping.d.ts +3 -0
- package/lib/findings/ComplianceMapping.js +75 -0
- package/lib/findings/Finding.d.ts +20 -0
- package/lib/findings/loadScoringConfig.js +9 -2
- package/lib/findings/scoring.d.ts +2 -1
- package/lib/findings/scoring.js +20 -7
- package/lib/history/AuditDiff.d.ts +26 -0
- package/lib/history/AuditDiff.js +2 -0
- package/lib/history/DiffEngine.d.ts +4 -0
- package/lib/history/DiffEngine.js +61 -0
- package/lib/history/HistoryStore.d.ts +11 -0
- package/lib/history/HistoryStore.js +56 -0
- package/lib/history/metricMeta.d.ts +9 -0
- package/lib/history/metricMeta.js +28 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +2 -1
- package/lib/lib/wire.d.ts +1 -2
- package/lib/lib/wire.js +1 -2
- package/lib/renderers/AuditRenderer.d.ts +2 -0
- package/lib/renderers/ClientReportRenderer.d.ts +29 -0
- package/lib/renderers/ClientReportRenderer.js +205 -0
- package/lib/renderers/DiffHtmlRenderer.d.ts +8 -0
- package/lib/renderers/DiffHtmlRenderer.js +164 -0
- package/lib/renderers/DiffJsonRenderer.d.ts +8 -0
- package/lib/renderers/DiffJsonRenderer.js +8 -0
- package/lib/renderers/DiffRenderer.d.ts +7 -0
- package/lib/renderers/DiffRenderer.js +2 -0
- package/lib/renderers/HistoryRenderer.d.ts +6 -0
- package/lib/renderers/HistoryRenderer.js +140 -0
- package/lib/renderers/HtmlRenderer.d.ts +1 -0
- package/lib/renderers/HtmlRenderer.js +354 -60
- package/lib/renderers/MarkdownRenderer.js +34 -1
- package/lib/renderers/html-utils.d.ts +2 -0
- package/lib/renderers/html-utils.js +8 -0
- package/lib/report/ComplianceMatrix.d.ts +19 -0
- package/lib/report/ComplianceMatrix.js +47 -0
- package/lib/report/ExecutivePriorities.d.ts +8 -0
- package/lib/report/ExecutivePriorities.js +22 -0
- package/lib/report/RemediationRoadmap.d.ts +9 -0
- package/lib/report/RemediationRoadmap.js +18 -0
- package/lib/report/branding.d.ts +18 -0
- package/lib/report/branding.js +19 -0
- package/lib/report/fonts.d.ts +2 -0
- package/lib/report/fonts.js +22 -0
- package/package.json +4 -3
- package/src/assets/fonts/dm-sans-italic-latin.woff2 +0 -0
- package/src/assets/fonts/dm-sans-normal-latin.woff2 +0 -0
- package/src/assets/fonts/dm-serif-display-italic-latin.woff2 +0 -0
- package/src/assets/fonts/dm-serif-display-normal-latin.woff2 +0 -0
- package/config/queries/soql.json +0 -24
- package/config/queries/tooling.json +0 -28
- package/config/scoring.json +0 -17
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Session timeouts are in seconds in SOQL for ConnectedApplication.
|
|
2
|
+
// 8 hours = 28800s; 12 hours = 43200s.
|
|
3
|
+
const LONG_TIMEOUT_SECONDS = 8 * 3600;
|
|
4
|
+
// Patterns that suggest an app has elevated / admin capabilities
|
|
5
|
+
const ADMIN_APP_PATTERNS = [/admin/i, /manage/i, /setup/i, /deploy/i, /devops/i, /audit/i, /monitor/i];
|
|
6
|
+
export class HighAssuranceSessionCheck {
|
|
7
|
+
id = 'high-assurance-session';
|
|
8
|
+
name = 'High Assurance Session Requirements';
|
|
9
|
+
category = 'Authentication';
|
|
10
|
+
description = 'Checks whether connected apps with admin-like capabilities require short session timeouts or high-assurance MFA sessions';
|
|
11
|
+
async run(ctx) {
|
|
12
|
+
const findings = [];
|
|
13
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
14
|
+
const setupUrl = `${baseUrl}/lightning/setup/ConnectedApplication/home`;
|
|
15
|
+
let apps;
|
|
16
|
+
try {
|
|
17
|
+
const result = await ctx.soql.query(`SELECT Id, Name, SessionTimeout, OptionsAllowAdminApprovedUsersOnly
|
|
18
|
+
FROM ConnectedApplication
|
|
19
|
+
ORDER BY Name
|
|
20
|
+
LIMIT 200`);
|
|
21
|
+
apps = result.records;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
findings.push({
|
|
25
|
+
id: 'high-assurance-session-inaccessible',
|
|
26
|
+
category: this.category,
|
|
27
|
+
riskLevel: 'INFO',
|
|
28
|
+
inconclusive: true,
|
|
29
|
+
title: 'Connected app session settings could not be read',
|
|
30
|
+
detail: 'ConnectedApplication session fields were not accessible. High assurance session configuration cannot be verified.',
|
|
31
|
+
remediation: 'Manually review connected apps in Setup → Connected Apps → Manage Connected Apps and verify session timeout policies.',
|
|
32
|
+
});
|
|
33
|
+
return { findings };
|
|
34
|
+
}
|
|
35
|
+
if (apps.length === 0) {
|
|
36
|
+
findings.push({
|
|
37
|
+
id: 'high-assurance-session-no-apps',
|
|
38
|
+
category: this.category,
|
|
39
|
+
riskLevel: 'LOW',
|
|
40
|
+
passed: true,
|
|
41
|
+
title: 'No connected apps found — session policy check not applicable',
|
|
42
|
+
detail: 'No connected apps are configured in this org.',
|
|
43
|
+
remediation: 'Continue monitoring as connected apps are added.',
|
|
44
|
+
});
|
|
45
|
+
return { findings };
|
|
46
|
+
}
|
|
47
|
+
// Identify apps with no session timeout (unlimited) — any session remains valid until logout
|
|
48
|
+
const noTimeout = apps.filter((a) => a.SessionTimeout === null || a.SessionTimeout === 0);
|
|
49
|
+
// Identify admin-pattern apps with very long or no timeouts
|
|
50
|
+
const adminAppsLongTimeout = apps.filter((a) => {
|
|
51
|
+
const isAdminLike = ADMIN_APP_PATTERNS.some((p) => p.test(a.Name));
|
|
52
|
+
const hasLongTimeout = (a.SessionTimeout === null || a.SessionTimeout === 0 || a.SessionTimeout > LONG_TIMEOUT_SECONDS);
|
|
53
|
+
return isAdminLike && hasLongTimeout;
|
|
54
|
+
});
|
|
55
|
+
// Org-level risk: majority of apps have no timeout
|
|
56
|
+
const percentNoTimeout = Math.round((noTimeout.length / apps.length) * 100);
|
|
57
|
+
if (adminAppsLongTimeout.length > 0) {
|
|
58
|
+
findings.push({
|
|
59
|
+
id: 'high-assurance-admin-apps-long-timeout',
|
|
60
|
+
category: this.category,
|
|
61
|
+
riskLevel: 'HIGH',
|
|
62
|
+
title: `${adminAppsLongTimeout.length} admin-related connected app(s) have no or very long session timeout`,
|
|
63
|
+
detail: `Salesforce High Assurance sessions require users to complete MFA within the CURRENT browser session before performing sensitive operations. Connected apps with names suggesting administrative or deployment capabilities should enforce short session timeouts (ideally ≤2 hours) to limit the window of a hijacked session. ${adminAppsLongTimeout.length} apps match admin naming patterns and have sessions that last longer than 8 hours or have no timeout.`,
|
|
64
|
+
remediation: 'Set the session timeout on admin-capability connected apps to 2 hours or less (Setup → Connected Apps → Manage → Edit Policies → Session Timeout). For Salesforce-internal admin operations, configure the app to require High Assurance session level so users must complete MFA within the active session.',
|
|
65
|
+
affectedItems: adminAppsLongTimeout.map((a) => ({
|
|
66
|
+
label: a.Name,
|
|
67
|
+
url: setupUrl,
|
|
68
|
+
note: a.SessionTimeout === null || a.SessionTimeout === 0
|
|
69
|
+
? 'No session timeout — sessions never expire'
|
|
70
|
+
: `Session timeout: ${Math.round(a.SessionTimeout / 3600)}h — reduce to ≤2h`,
|
|
71
|
+
})),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
if (noTimeout.length > 0 && noTimeout.length > apps.length / 2) {
|
|
75
|
+
findings.push({
|
|
76
|
+
id: 'high-assurance-widespread-no-timeout',
|
|
77
|
+
category: this.category,
|
|
78
|
+
riskLevel: 'MEDIUM',
|
|
79
|
+
title: `${noTimeout.length} of ${apps.length} connected app(s) (${percentNoTimeout}%) have no session timeout configured`,
|
|
80
|
+
detail: `${percentNoTimeout}% of connected apps have no session timeout, meaning OAuth tokens and browser sessions can persist indefinitely. An attacker with a stolen token or session cookie can maintain persistent access without triggering any session expiry. Salesforce recommends configuring session timeouts on all connected apps.`,
|
|
81
|
+
remediation: 'Set appropriate session timeouts for all connected apps based on their sensitivity. Production apps handling sensitive data should use 2–8 hour timeouts. Development/CI apps can use longer timeouts if appropriate.',
|
|
82
|
+
affectedItems: noTimeout.slice(0, 20).map((a) => ({
|
|
83
|
+
label: a.Name,
|
|
84
|
+
url: setupUrl,
|
|
85
|
+
note: 'No session timeout — configure a timeout in Connected App policies',
|
|
86
|
+
})),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (adminAppsLongTimeout.length === 0 && (noTimeout.length === 0 || noTimeout.length <= apps.length / 2)) {
|
|
90
|
+
findings.push({
|
|
91
|
+
id: 'high-assurance-session-ok',
|
|
92
|
+
category: this.category,
|
|
93
|
+
riskLevel: 'LOW',
|
|
94
|
+
passed: true,
|
|
95
|
+
title: 'Connected app session timeouts are configured appropriately',
|
|
96
|
+
detail: `${apps.length} connected app(s) reviewed. No admin-pattern apps with dangerously long or absent session timeouts were found.`,
|
|
97
|
+
remediation: 'Periodically review connected app session policies as new apps are added. Consider requiring High Assurance sessions for any app used by administrators.',
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return { findings };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=HighAssuranceSessionCheck.js.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
const BASE_FILTER = `
|
|
2
|
+
IsActive = true
|
|
3
|
+
AND Id NOT IN (SELECT UserId FROM UserLogin WHERE IsFrozen = true)
|
|
4
|
+
AND (LastLoginDate < LAST_N_DAYS:90 OR LastLoginDate = null)
|
|
5
|
+
AND UserType = 'Standard'
|
|
6
|
+
`.trim();
|
|
1
7
|
export class InactiveUsersCheck {
|
|
2
8
|
id = 'inactive-users';
|
|
3
9
|
name = 'Inactive Users';
|
|
@@ -6,42 +12,55 @@ export class InactiveUsersCheck {
|
|
|
6
12
|
async run(ctx) {
|
|
7
13
|
const findings = [];
|
|
8
14
|
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
// Q1: true count — query with LIMIT returns totalSize = min(actual, LIMIT),
|
|
16
|
+
// so a separate COUNT query is required for an accurate number.
|
|
17
|
+
const countResult = await ctx.soql.query(`SELECT COUNT(Id) expr0 FROM User WHERE ${BASE_FILTER}`);
|
|
18
|
+
const totalCount = countResult.records[0]?.expr0 ?? 0;
|
|
19
|
+
if (totalCount === 0) {
|
|
20
|
+
findings.push({
|
|
21
|
+
id: 'inactive-users-none',
|
|
22
|
+
category: this.category,
|
|
23
|
+
riskLevel: 'LOW',
|
|
24
|
+
passed: true,
|
|
25
|
+
title: 'No active users with 90+ days of inactivity',
|
|
26
|
+
detail: 'All active standard users have logged in within the past 90 days.',
|
|
27
|
+
remediation: 'Continue to run periodic user access reviews to catch future stale accounts.',
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
findings,
|
|
31
|
+
metrics: { inactiveUsers90d: 0 },
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// Q2: fetch up to 50 for the affected-items list (display cap, not count cap)
|
|
35
|
+
const displayUsers = await ctx.soql.queryAll(`SELECT Id, Username, Name, Profile.Name, LastLoginDate, UserType
|
|
36
|
+
FROM User
|
|
37
|
+
WHERE ${BASE_FILTER}
|
|
38
|
+
ORDER BY LastLoginDate ASC
|
|
39
|
+
LIMIT 50`);
|
|
20
40
|
let riskLevel = 'LOW';
|
|
21
|
-
if (
|
|
41
|
+
if (totalCount > 20) {
|
|
22
42
|
riskLevel = 'HIGH';
|
|
23
43
|
}
|
|
24
|
-
else if (
|
|
44
|
+
else if (totalCount > 10) {
|
|
25
45
|
riskLevel = 'MEDIUM';
|
|
26
46
|
}
|
|
47
|
+
const overflowNote = totalCount > 50 ? ` (showing first 50 of ${totalCount})` : '';
|
|
27
48
|
findings.push({
|
|
28
49
|
id: 'inactive-users-90d',
|
|
29
50
|
category: this.category,
|
|
30
51
|
riskLevel,
|
|
31
|
-
title: `${
|
|
52
|
+
title: `${totalCount} active user(s) have not logged in for 90+ days`,
|
|
32
53
|
detail: 'Active accounts with no recent login represent stale credentials that may be compromised without detection.',
|
|
33
54
|
remediation: 'Deactivate or review accounts that have been inactive for 90+ days. Establish a regular user access review process.',
|
|
34
|
-
affectedItems:
|
|
55
|
+
affectedItems: displayUsers.map((u) => ({
|
|
35
56
|
label: `${u.Username} (${u.Name})`,
|
|
36
57
|
url: `${baseUrl}/${u.Id}`,
|
|
37
|
-
note: `Last login: ${u.LastLoginDate
|
|
58
|
+
note: `Last login: ${u.LastLoginDate ? new Date(u.LastLoginDate).toISOString().split('T')[0] : 'never'}${overflowNote}`,
|
|
38
59
|
})),
|
|
39
60
|
});
|
|
40
61
|
return {
|
|
41
62
|
findings,
|
|
42
|
-
metrics: {
|
|
43
|
-
inactiveUsers90d: count,
|
|
44
|
-
},
|
|
63
|
+
metrics: { inactiveUsers90d: totalCount },
|
|
45
64
|
};
|
|
46
65
|
}
|
|
47
66
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AuditContext } from '../../context/AuditContext.js';
|
|
2
|
+
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
|
+
export declare class InstalledPackagesCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "installed-packages";
|
|
5
|
+
readonly name = "Installed Packages";
|
|
6
|
+
readonly category = "App Security";
|
|
7
|
+
readonly description = "Inventories installed managed and unmanaged packages; flags unmanaged packages and beta releases in production";
|
|
8
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=InstalledPackagesCheck.d.ts.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export class InstalledPackagesCheck {
|
|
2
|
+
id = 'installed-packages';
|
|
3
|
+
name = 'Installed Packages';
|
|
4
|
+
category = 'App Security';
|
|
5
|
+
description = 'Inventories installed managed and unmanaged packages; flags unmanaged packages and beta releases in production';
|
|
6
|
+
async run(ctx) {
|
|
7
|
+
const findings = [];
|
|
8
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
9
|
+
const setupUrl = `${baseUrl}/lightning/setup/ImportedPackage/home`;
|
|
10
|
+
let packages = [];
|
|
11
|
+
try {
|
|
12
|
+
packages = await ctx.tooling.query(`SELECT Id, SubscriberPackage.Name, SubscriberPackage.NamespacePrefix,
|
|
13
|
+
SubscriberPackageVersion.MajorVersion, SubscriberPackageVersion.MinorVersion,
|
|
14
|
+
SubscriberPackageVersion.PatchVersion, SubscriberPackageVersion.ReleaseState,
|
|
15
|
+
SubscriberPackageVersion.PublisherName
|
|
16
|
+
FROM InstalledSubscriberPackage`);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
findings.push({
|
|
20
|
+
id: 'installed-packages-inaccessible',
|
|
21
|
+
category: this.category,
|
|
22
|
+
riskLevel: 'INFO',
|
|
23
|
+
inconclusive: true,
|
|
24
|
+
title: 'Installed package inventory could not be retrieved via Tooling API',
|
|
25
|
+
detail: 'The InstalledSubscriberPackage Tooling API object was not accessible. This may indicate the audit user lacks Tooling API access or the org edition does not support this query.',
|
|
26
|
+
remediation: 'Review installed packages manually in Setup → Apps → Packaging → Installed Packages. Ensure the audit user has API access enabled.',
|
|
27
|
+
affectedItems: [{ label: 'Installed Packages Setup', url: setupUrl }],
|
|
28
|
+
});
|
|
29
|
+
return { findings };
|
|
30
|
+
}
|
|
31
|
+
if (packages.length === 0) {
|
|
32
|
+
findings.push({
|
|
33
|
+
id: 'installed-packages-none',
|
|
34
|
+
category: this.category,
|
|
35
|
+
riskLevel: 'INFO',
|
|
36
|
+
title: 'No installed packages found',
|
|
37
|
+
detail: 'No InstalledSubscriberPackage records were found. This org does not have any AppExchange or custom packages installed.',
|
|
38
|
+
remediation: 'No action required. Monitor for new package installations as part of your change management process.',
|
|
39
|
+
});
|
|
40
|
+
return { findings };
|
|
41
|
+
}
|
|
42
|
+
const unmanagedPackages = packages.filter((p) => p.SubscriberPackage.NamespacePrefix === null || p.SubscriberPackage.NamespacePrefix === '');
|
|
43
|
+
const betaPackages = packages.filter((p) => p.SubscriberPackageVersion.ReleaseState === 'Beta');
|
|
44
|
+
function versionString(pkg) {
|
|
45
|
+
const v = pkg.SubscriberPackageVersion;
|
|
46
|
+
return `${v.MajorVersion}.${v.MinorVersion}.${v.PatchVersion}`;
|
|
47
|
+
}
|
|
48
|
+
if (unmanagedPackages.length > 0) {
|
|
49
|
+
findings.push({
|
|
50
|
+
id: 'installed-packages-unmanaged',
|
|
51
|
+
category: this.category,
|
|
52
|
+
riskLevel: 'HIGH',
|
|
53
|
+
title: `${unmanagedPackages.length} unmanaged package(s) installed — code is editable and bypasses AppExchange security review`,
|
|
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
|
+
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
|
+
affectedItems: unmanagedPackages.map((p) => ({
|
|
57
|
+
label: p.SubscriberPackage.Name,
|
|
58
|
+
url: setupUrl,
|
|
59
|
+
note: `no namespace — unmanaged — publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'} — version: ${versionString(p)}`,
|
|
60
|
+
})),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (betaPackages.length > 0) {
|
|
64
|
+
findings.push({
|
|
65
|
+
id: 'installed-packages-beta',
|
|
66
|
+
category: this.category,
|
|
67
|
+
riskLevel: 'MEDIUM',
|
|
68
|
+
title: `${betaPackages.length} beta package version(s) installed in production`,
|
|
69
|
+
detail: 'Beta packages have not completed the Salesforce AppExchange security review and are not supported for production use. Installing beta packages in production introduces untested code, may violate ISV agreements, and could expose the org to unreviewed security vulnerabilities.',
|
|
70
|
+
remediation: 'Upgrade each beta package to a generally available (GA) release. If no GA version exists, contact the publisher to determine a release timeline. Do not use beta packages in production environments.',
|
|
71
|
+
affectedItems: betaPackages.map((p) => ({
|
|
72
|
+
label: p.SubscriberPackage.Name,
|
|
73
|
+
url: setupUrl,
|
|
74
|
+
note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'none'} — state: Beta — version: ${versionString(p)} — publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'}`,
|
|
75
|
+
})),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
findings.push({
|
|
79
|
+
id: 'installed-packages-inventory',
|
|
80
|
+
category: this.category,
|
|
81
|
+
riskLevel: 'INFO',
|
|
82
|
+
title: `${packages.length} package(s) installed — full inventory`,
|
|
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
|
+
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
|
+
affectedItems: packages.map((p) => ({
|
|
86
|
+
label: p.SubscriberPackage.Name,
|
|
87
|
+
url: setupUrl,
|
|
88
|
+
note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'no namespace — unmanaged'} — version: ${versionString(p)} — publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'} — state: ${p.SubscriberPackageVersion.ReleaseState}`,
|
|
89
|
+
})),
|
|
90
|
+
});
|
|
91
|
+
return { findings };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=InstalledPackagesCheck.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AuditContext } from '../../context/AuditContext.js';
|
|
2
|
+
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
|
+
export declare class IntegrationUsersCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "integration-users";
|
|
5
|
+
readonly name = "Integration / Service Account Inventory";
|
|
6
|
+
readonly category = "Permissions";
|
|
7
|
+
readonly description = "SBS-ACS-007/008/009: inventories non-human identities and checks for excess privilege";
|
|
8
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=IntegrationUsersCheck.d.ts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Username segments that strongly indicate a service/integration account
|
|
2
|
+
const SERVICE_LIKE_CLAUSES = [
|
|
3
|
+
"Username LIKE '%service%'",
|
|
4
|
+
"Username LIKE '%integration%'",
|
|
5
|
+
"Username LIKE '%.api@%'",
|
|
6
|
+
"Username LIKE '%_api_%'",
|
|
7
|
+
"Username LIKE '%.svc@%'",
|
|
8
|
+
"Username LIKE '%_svc_%'",
|
|
9
|
+
"Username LIKE '%batch%'",
|
|
10
|
+
"Username LIKE '%automation%'",
|
|
11
|
+
"Username LIKE '%system@%'",
|
|
12
|
+
"Username LIKE '%scheduler%'",
|
|
13
|
+
];
|
|
14
|
+
const ASSIGNEE_LIKE_CLAUSES = [
|
|
15
|
+
"Assignee.Username LIKE '%service%'",
|
|
16
|
+
"Assignee.Username LIKE '%integration%'",
|
|
17
|
+
"Assignee.Username LIKE '%.api@%'",
|
|
18
|
+
"Assignee.Username LIKE '%_api_%'",
|
|
19
|
+
"Assignee.Username LIKE '%.svc@%'",
|
|
20
|
+
];
|
|
21
|
+
export class IntegrationUsersCheck {
|
|
22
|
+
id = 'integration-users';
|
|
23
|
+
name = 'Integration / Service Account Inventory';
|
|
24
|
+
category = 'Permissions';
|
|
25
|
+
description = 'SBS-ACS-007/008/009: inventories non-human identities and checks for excess privilege';
|
|
26
|
+
async run(ctx) {
|
|
27
|
+
const findings = [];
|
|
28
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
29
|
+
// Q1: Find candidate service accounts — users who have never logged in (and were created
|
|
30
|
+
// more than 30 days ago, to exclude freshly provisioned human users) or whose username
|
|
31
|
+
// matches common integration account naming patterns. These are likely non-human identities
|
|
32
|
+
// requiring SBS-ACS-007 documentation.
|
|
33
|
+
const serviceUsernameClause = SERVICE_LIKE_CLAUSES.join(' OR ');
|
|
34
|
+
const candidates = await ctx.soql.queryAll(`SELECT Id, Username, Profile.Name, LastLoginDate
|
|
35
|
+
FROM User
|
|
36
|
+
WHERE IsActive = true
|
|
37
|
+
AND UserType = 'Standard'
|
|
38
|
+
AND (
|
|
39
|
+
(LastLoginDate = null AND CreatedDate < LAST_N_DAYS:30)
|
|
40
|
+
OR ${serviceUsernameClause}
|
|
41
|
+
)
|
|
42
|
+
AND Id NOT IN (SELECT UserId FROM UserLogin WHERE IsFrozen = true)
|
|
43
|
+
ORDER BY LastLoginDate ASC NULLS FIRST
|
|
44
|
+
LIMIT 200`);
|
|
45
|
+
if (candidates.length === 0) {
|
|
46
|
+
findings.push({
|
|
47
|
+
id: 'integration-users-none',
|
|
48
|
+
category: this.category,
|
|
49
|
+
riskLevel: 'LOW',
|
|
50
|
+
passed: true,
|
|
51
|
+
title: 'No candidate non-human identities found — SBS-ACS-007',
|
|
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
|
+
remediation: 'As integration accounts are created, ensure they are documented with a named owner, stated purpose, and review date.',
|
|
54
|
+
});
|
|
55
|
+
return { findings };
|
|
56
|
+
}
|
|
57
|
+
// Inventory finding (INFO) — administrators need this list to comply with SBS-ACS-007
|
|
58
|
+
findings.push({
|
|
59
|
+
id: 'integration-users-inventory',
|
|
60
|
+
category: this.category,
|
|
61
|
+
riskLevel: 'INFO',
|
|
62
|
+
title: `${candidates.length} candidate non-human identity/identities found — SBS-ACS-007`,
|
|
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
|
+
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
|
+
affectedItems: candidates.map((u) => ({
|
|
66
|
+
label: u.Username,
|
|
67
|
+
url: `${baseUrl}/${u.Id}`,
|
|
68
|
+
note: u.LastLoginDate
|
|
69
|
+
? `last login: ${new Date(u.LastLoginDate).toISOString().split('T')[0]} | profile: ${u.Profile.Name}`
|
|
70
|
+
: `never logged in | profile: ${u.Profile.Name}`,
|
|
71
|
+
})),
|
|
72
|
+
});
|
|
73
|
+
// Q2: Among service-account-looking users, find those with Modify All / View All Data.
|
|
74
|
+
// SBS-ACS-008 requires non-human identities to hold only the minimum required permissions.
|
|
75
|
+
const assigneeServiceClause = ASSIGNEE_LIKE_CLAUSES.join(' OR ');
|
|
76
|
+
const broadResult = await ctx.soql.query(`SELECT Assignee.Id, Assignee.Username,
|
|
77
|
+
PermissionSet.Name, PermissionSet.PermissionsModifyAllData, PermissionSet.PermissionsViewAllData
|
|
78
|
+
FROM PermissionSetAssignment
|
|
79
|
+
WHERE Assignee.IsActive = true
|
|
80
|
+
AND Assignee.UserType = 'Standard'
|
|
81
|
+
AND (
|
|
82
|
+
Assignee.LastLoginDate = null
|
|
83
|
+
OR ${assigneeServiceClause}
|
|
84
|
+
)
|
|
85
|
+
AND (PermissionSet.PermissionsModifyAllData = true OR PermissionSet.PermissionsViewAllData = true)
|
|
86
|
+
LIMIT 200`);
|
|
87
|
+
const broadPermUsers = broadResult.records;
|
|
88
|
+
if (broadPermUsers.length > 0) {
|
|
89
|
+
const modifyAll = broadPermUsers.filter((r) => r.PermissionSet.PermissionsModifyAllData);
|
|
90
|
+
const viewAll = broadPermUsers.filter((r) => r.PermissionSet.PermissionsViewAllData && !r.PermissionSet.PermissionsModifyAllData);
|
|
91
|
+
findings.push({
|
|
92
|
+
id: 'integration-users-broad-permissions',
|
|
93
|
+
category: this.category,
|
|
94
|
+
riskLevel: modifyAll.length > 0 ? 'HIGH' : 'MEDIUM',
|
|
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
|
+
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
|
+
affectedItems: broadPermUsers.map((r) => ({
|
|
99
|
+
label: r.Assignee.Username,
|
|
100
|
+
url: `${baseUrl}/${r.Assignee.Id}`,
|
|
101
|
+
note: `via: ${r.PermissionSet.Name} — ${r.PermissionSet.PermissionsModifyAllData ? 'Modify All Data' : 'View All Data'}`,
|
|
102
|
+
})),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return { findings };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=IntegrationUsersCheck.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AuditContext } from '../../context/AuditContext.js';
|
|
2
|
+
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
|
+
export declare class InternalUserMfaCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "internal-user-mfa";
|
|
5
|
+
readonly name = "Internal User MFA Enforcement";
|
|
6
|
+
readonly category = "Authentication";
|
|
7
|
+
readonly description = "Checks MFA enforcement for all active internal standard users";
|
|
8
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=InternalUserMfaCheck.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export class InternalUserMfaCheck {
|
|
2
|
+
id = 'internal-user-mfa';
|
|
3
|
+
name = 'Internal User MFA Enforcement';
|
|
4
|
+
category = 'Authentication';
|
|
5
|
+
description = 'Checks MFA enforcement for all active internal standard users';
|
|
6
|
+
async run(ctx) {
|
|
7
|
+
const findings = [];
|
|
8
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
9
|
+
const setupUrl = `${baseUrl}/lightning/setup/EnhancedProfiles/home`;
|
|
10
|
+
// queryAll to avoid LIMIT 500 truncation — PSA query below fetches all records,
|
|
11
|
+
// so a truncated user list would produce false-pass results for the missing users.
|
|
12
|
+
const users = await ctx.soql.queryAll(`SELECT Id, Username, Profile.Name, LastLoginDate
|
|
13
|
+
FROM User
|
|
14
|
+
WHERE IsActive = true
|
|
15
|
+
AND UserType = 'Standard'
|
|
16
|
+
AND Id NOT IN (SELECT UserId FROM UserLogin WHERE IsFrozen = true)
|
|
17
|
+
ORDER BY Username`);
|
|
18
|
+
if (users.length === 0) {
|
|
19
|
+
findings.push({
|
|
20
|
+
id: 'internal-user-mfa-all-enforced',
|
|
21
|
+
category: this.category,
|
|
22
|
+
riskLevel: 'LOW',
|
|
23
|
+
passed: true,
|
|
24
|
+
title: 'No active internal standard users found',
|
|
25
|
+
detail: 'No active, unfrozen standard users were found in this org. MFA enforcement verification is not applicable.',
|
|
26
|
+
remediation: 'No action required.',
|
|
27
|
+
});
|
|
28
|
+
return { findings };
|
|
29
|
+
}
|
|
30
|
+
let mfaUserIds = new Set();
|
|
31
|
+
try {
|
|
32
|
+
const psaResult = await ctx.soql.query(`SELECT AssigneeId
|
|
33
|
+
FROM PermissionSetAssignment
|
|
34
|
+
WHERE PermissionSet.PermissionsMultiFactorForUiLogins = true
|
|
35
|
+
AND Assignee.IsActive = true
|
|
36
|
+
AND Assignee.UserType = 'Standard'`);
|
|
37
|
+
mfaUserIds = new Set(psaResult.records.map((r) => r.AssigneeId));
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
findings.push({
|
|
41
|
+
id: 'internal-user-mfa-inaccessible',
|
|
42
|
+
category: this.category,
|
|
43
|
+
riskLevel: 'INFO',
|
|
44
|
+
inconclusive: true,
|
|
45
|
+
title: 'MFA permission set assignments could not be queried',
|
|
46
|
+
detail: 'The PermissionSetAssignment query for PermissionsMultiFactorForUiLogins was not accessible. This may indicate insufficient permissions to query permission set assignments.',
|
|
47
|
+
remediation: 'Grant "View All Users" or "Manage Users" permission to the audit user. Review MFA enforcement manually in Setup → Users → Permission Sets.',
|
|
48
|
+
});
|
|
49
|
+
return { findings };
|
|
50
|
+
}
|
|
51
|
+
const usersWithoutMfa = users.filter((u) => !mfaUserIds.has(u.Id));
|
|
52
|
+
if (usersWithoutMfa.length === 0) {
|
|
53
|
+
findings.push({
|
|
54
|
+
id: 'internal-user-mfa-all-enforced',
|
|
55
|
+
category: this.category,
|
|
56
|
+
riskLevel: 'LOW',
|
|
57
|
+
passed: true,
|
|
58
|
+
title: `All ${users.length} active internal user(s) have MFA explicitly enforced via permission`,
|
|
59
|
+
detail: 'All active, unfrozen standard users have the PermissionsMultiFactorForUiLogins permission assigned. Salesforce auto-enforced MFA at the system level in Spring 2023; this explicit permission provides belt-and-suspenders assurance that MFA is enforced even if system-level enforcement has edge cases.',
|
|
60
|
+
remediation: 'Continue to ensure all new users are assigned MFA enforcement via their profile or a permission set.',
|
|
61
|
+
});
|
|
62
|
+
return { findings };
|
|
63
|
+
}
|
|
64
|
+
const riskLevel = usersWithoutMfa.length > 20 ? 'HIGH' : 'MEDIUM';
|
|
65
|
+
findings.push({
|
|
66
|
+
id: 'internal-user-mfa-gaps',
|
|
67
|
+
category: this.category,
|
|
68
|
+
riskLevel,
|
|
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 — 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
|
+
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
|
+
affectedItems: usersWithoutMfa.slice(0, 50).map((u) => ({
|
|
73
|
+
label: u.Username,
|
|
74
|
+
url: `${baseUrl}/${u.Id}`,
|
|
75
|
+
note: `profile: ${u.Profile?.Name ?? 'unknown'} — last login: ${u.LastLoginDate ? new Date(u.LastLoginDate).toISOString().split('T')[0] : 'never'}`,
|
|
76
|
+
})),
|
|
77
|
+
});
|
|
78
|
+
return { findings };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=InternalUserMfaCheck.js.map
|