@cclabsnz/sf-audit 1.2.0 → 1.4.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 +135 -31
- package/lib/api/MetadataClient.d.ts +4 -0
- package/lib/api/MetadataClient.js +2 -0
- package/lib/api/MetadataClientImpl.d.ts +8 -0
- package/lib/api/MetadataClientImpl.js +22 -0
- package/lib/api/RestClient.d.ts +1 -0
- package/lib/api/RestClientImpl.d.ts +1 -0
- package/lib/api/RestClientImpl.js +6 -0
- package/lib/chains/CapabilityRegistry.js +19 -0
- package/lib/chains/namedChains.js +26 -4
- package/lib/checks/eventLogAccess.d.ts +14 -0
- package/lib/checks/eventLogAccess.js +33 -0
- 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/AuthProvidersCheck.d.ts +17 -0
- package/lib/checks/impl/AuthProvidersCheck.js +88 -0
- package/lib/checks/impl/CertificateExpiryCheck.js +1 -1
- package/lib/checks/impl/ClassicSitesCheck.d.ts +17 -0
- package/lib/checks/impl/ClassicSitesCheck.js +65 -0
- 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/DataExportAccessCheck.d.ts +19 -0
- package/lib/checks/impl/DataExportAccessCheck.js +79 -0
- 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/EncryptionCoverageCheck.d.ts +19 -0
- package/lib/checks/impl/EncryptionCoverageCheck.js +108 -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 +14 -11
- package/lib/checks/impl/ExperienceCloudSiteCheck.js +3 -3
- package/lib/checks/impl/ExperienceCspCheck.d.ts +18 -0
- package/lib/checks/impl/ExperienceCspCheck.js +57 -0
- package/lib/checks/impl/ExternalCredentialsCheck.d.ts +17 -0
- package/lib/checks/impl/ExternalCredentialsCheck.js +74 -0
- 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/GuestApiAccessCheck.d.ts +19 -0
- package/lib/checks/impl/GuestApiAccessCheck.js +113 -0
- package/lib/checks/impl/GuestExecutableApexCheck.d.ts +1 -1
- package/lib/checks/impl/GuestExecutableApexCheck.js +5 -5
- package/lib/checks/impl/GuestObjectExposureCheck.d.ts +44 -0
- package/lib/checks/impl/GuestObjectExposureCheck.js +241 -0
- package/lib/checks/impl/GuestRecordAccessPolicyCheck.d.ts +34 -0
- package/lib/checks/impl/GuestRecordAccessPolicyCheck.js +120 -0
- package/lib/checks/impl/GuestSiteOptionsCheck.d.ts +18 -0
- package/lib/checks/impl/GuestSiteOptionsCheck.js +92 -0
- package/lib/checks/impl/GuestTrafficAnomalyCheck.d.ts +23 -0
- package/lib/checks/impl/GuestTrafficAnomalyCheck.js +343 -0
- 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/LoginAccessPolicyCheck.d.ts +26 -0
- package/lib/checks/impl/LoginAccessPolicyCheck.js +117 -0
- package/lib/checks/impl/LoginAnomalyCheck.d.ts +17 -0
- package/lib/checks/impl/LoginAnomalyCheck.js +98 -0
- 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/SandboxDataMaskingCheck.d.ts +17 -0
- package/lib/checks/impl/SandboxDataMaskingCheck.js +85 -0
- 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/SessionHardeningCheck.d.ts +21 -0
- package/lib/checks/impl/SessionHardeningCheck.js +134 -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/ThreatDetectionCheck.d.ts +17 -0
- package/lib/checks/impl/ThreatDetectionCheck.js +91 -0
- 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 +45 -0
- package/lib/commands/audit/diff.js +9 -5
- package/lib/commands/audit/events/pull.d.ts +17 -0
- package/lib/commands/audit/events/pull.js +88 -0
- package/lib/commands/audit/security.d.ts +4 -0
- package/lib/commands/audit/security.js +41 -17
- package/lib/compliance/mapping.js +34 -7
- package/lib/context/AuditCache.d.ts +12 -0
- package/lib/context/AuditContext.d.ts +2 -0
- package/lib/events/EventBaselineStore.d.ts +16 -0
- package/lib/events/EventBaselineStore.js +55 -0
- package/lib/events/eventLogQuery.d.ts +21 -0
- package/lib/events/eventLogQuery.js +34 -0
- package/lib/events/pullEventLogs.d.ts +51 -0
- package/lib/events/pullEventLogs.js +79 -0
- package/lib/findings/CheckMeta.js +24 -3
- package/lib/lib/wire.d.ts +2 -0
- package/lib/lib/wire.js +3 -0
- 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 +14 -2
|
@@ -75,7 +75,7 @@ export class PermissionsCheck {
|
|
|
75
75
|
riskLevel: 'INFO',
|
|
76
76
|
inconclusive: true,
|
|
77
77
|
title: 'Unassigned permission set check could not be completed',
|
|
78
|
-
detail: 'The semi-join query to identify unassigned permission sets failed
|
|
78
|
+
detail: 'The semi-join query to identify unassigned permission sets failed. This can occur in orgs with very large numbers of permission set assignments (governor limit on semi-join subqueries). Review orphaned permission sets manually.',
|
|
79
79
|
remediation: 'In Setup → Permission Sets, sort by Last Modified and review sets that appear to have no user assignments.',
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -112,12 +112,12 @@ export class PermissionsCheck {
|
|
|
112
112
|
...profileGrantors.map((r) => ({
|
|
113
113
|
label: r.Name,
|
|
114
114
|
url: `${baseUrl}/${r.Id}`,
|
|
115
|
-
note: 'Granted via Profile
|
|
115
|
+
note: 'Granted via Profile: prefer moving to a permission set for finer control',
|
|
116
116
|
})),
|
|
117
117
|
...psGrantors.map((r) => ({
|
|
118
118
|
label: r.Name,
|
|
119
119
|
url: `${baseUrl}/${r.Id}`,
|
|
120
|
-
note: 'Permission Set
|
|
120
|
+
note: 'Permission Set: document justification in system of record',
|
|
121
121
|
})),
|
|
122
122
|
],
|
|
123
123
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AuditContext } from '../../context/AuditContext.js';
|
|
2
|
+
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
|
+
export declare class PrivilegedAccessCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "privileged-access";
|
|
5
|
+
readonly name = "Privileged Access & Shadow Admins";
|
|
6
|
+
readonly category = "Permissions";
|
|
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 ["effectivePermissions"];
|
|
9
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=PrivilegedAccessCheck.d.ts.map
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { DANGEROUS_PERMS } from '../permCatalog.js';
|
|
2
|
+
const ADMIN_PROFILE = 'System Administrator';
|
|
3
|
+
/** Admin-equivalent = holds Modify All Data, OR can self-escalate to it (Manage Users + Assign Permission Sets). */
|
|
4
|
+
function isAdminEquivalent(perms) {
|
|
5
|
+
return perms.has('ModifyAllData') || (perms.has('ManageUsers') && perms.has('AssignPermissionSets'));
|
|
6
|
+
}
|
|
7
|
+
export class PrivilegedAccessCheck {
|
|
8
|
+
id = 'privileged-access';
|
|
9
|
+
name = 'Privileged Access & Shadow Admins';
|
|
10
|
+
category = 'Permissions';
|
|
11
|
+
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';
|
|
12
|
+
populatesCache = ['effectivePermissions'];
|
|
13
|
+
async run(ctx) {
|
|
14
|
+
const findings = [];
|
|
15
|
+
const setupUrl = `${ctx.orgInfo.instanceUrl}/lightning/setup/ManageUsers/home`;
|
|
16
|
+
const permFields = DANGEROUS_PERMS.map((p) => `PermissionSet.${p.field}`).join(', ');
|
|
17
|
+
const permWhere = DANGEROUS_PERMS.map((p) => `PermissionSet.${p.field} = true`).join(' OR ');
|
|
18
|
+
let rows;
|
|
19
|
+
try {
|
|
20
|
+
rows = await ctx.soql.queryAll(`SELECT AssigneeId, Assignee.Username, Assignee.Name, Assignee.Profile.Name, ${permFields}
|
|
21
|
+
FROM PermissionSetAssignment
|
|
22
|
+
WHERE (${permWhere}) AND Assignee.IsActive = true`);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
26
|
+
findings.push({
|
|
27
|
+
id: 'privileged-access-inaccessible',
|
|
28
|
+
category: this.category,
|
|
29
|
+
riskLevel: 'INFO',
|
|
30
|
+
inconclusive: true,
|
|
31
|
+
title: 'Effective-permission resolution could not be completed',
|
|
32
|
+
detail: `The PermissionSetAssignment query was not accessible: ${msg}`,
|
|
33
|
+
remediation: 'Grant the audit user "View Setup and Configuration" and "View All Users", then re-run the audit.',
|
|
34
|
+
});
|
|
35
|
+
return { findings };
|
|
36
|
+
}
|
|
37
|
+
// Aggregate per user: a user's effective high-risk permissions are the union across
|
|
38
|
+
// all of their PermissionSetAssignment rows (profile permset + permsets + PSG aggregate).
|
|
39
|
+
const byUser = new Map();
|
|
40
|
+
for (const row of rows) {
|
|
41
|
+
const ps = row.PermissionSet ?? {};
|
|
42
|
+
const held = DANGEROUS_PERMS.filter((p) => ps[p.field]).map((p) => p.key);
|
|
43
|
+
if (held.length === 0)
|
|
44
|
+
continue;
|
|
45
|
+
let g = byUser.get(row.AssigneeId);
|
|
46
|
+
if (!g) {
|
|
47
|
+
g = {
|
|
48
|
+
userId: row.AssigneeId,
|
|
49
|
+
username: row.Assignee?.Username ?? row.AssigneeId,
|
|
50
|
+
name: row.Assignee?.Name ?? row.Assignee?.Username ?? row.AssigneeId,
|
|
51
|
+
profileName: row.Assignee?.Profile?.Name ?? 'Unknown',
|
|
52
|
+
perms: [],
|
|
53
|
+
};
|
|
54
|
+
byUser.set(row.AssigneeId, g);
|
|
55
|
+
}
|
|
56
|
+
for (const k of held)
|
|
57
|
+
if (!g.perms.includes(k))
|
|
58
|
+
g.perms.push(k);
|
|
59
|
+
}
|
|
60
|
+
const grants = [...byUser.values()];
|
|
61
|
+
ctx.cache.effectivePermissions = grants;
|
|
62
|
+
const shadowAdmins = grants.filter((g) => g.profileName !== ADMIN_PROFILE && isAdminEquivalent(new Set(g.perms)));
|
|
63
|
+
if (shadowAdmins.length > 0) {
|
|
64
|
+
findings.push({
|
|
65
|
+
id: 'privileged-access-shadow-admins',
|
|
66
|
+
category: this.category,
|
|
67
|
+
riskLevel: 'CRITICAL',
|
|
68
|
+
title: `${shadowAdmins.length} user(s) hold admin-equivalent access without the System Administrator profile`,
|
|
69
|
+
detail: 'These active users have accumulated effective permissions equivalent to a System Administrator (either "Modify All Data" directly, or "Manage Users" combined with "Assign Permission Sets", which lets them grant themselves anything) but sit on a different profile. Such "shadow admins" are easy to miss in profile-based reviews, yet a takeover of any one grants full org control. The access is reached via the user\'s profile, assigned permission sets, or permission set groups combined.',
|
|
70
|
+
remediation: 'Review each user\'s permission sets and profile. Remove "Modify All Data" / the Manage Users + Assign Permission Sets pairing unless the role genuinely requires org administration, and consolidate true admins onto a controlled admin profile.',
|
|
71
|
+
affectedItems: shadowAdmins.map((g) => ({
|
|
72
|
+
label: g.username,
|
|
73
|
+
url: setupUrl,
|
|
74
|
+
note: `Profile: ${g.profileName}, effective: ${g.perms.join(', ')}`,
|
|
75
|
+
})),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
findings.push({
|
|
80
|
+
id: 'privileged-access-no-shadow-admins',
|
|
81
|
+
category: this.category,
|
|
82
|
+
riskLevel: 'LOW',
|
|
83
|
+
passed: true,
|
|
84
|
+
title: 'No shadow admins detected',
|
|
85
|
+
detail: 'No active user holds admin-equivalent effective permissions outside the System Administrator profile.',
|
|
86
|
+
remediation: 'Continue to keep administrative permissions on a controlled admin profile.',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// Informational inventory of privileged users (does not affect the grade beyond the above).
|
|
90
|
+
if (grants.length > 0) {
|
|
91
|
+
findings.push({
|
|
92
|
+
id: 'privileged-access-inventory',
|
|
93
|
+
category: this.category,
|
|
94
|
+
riskLevel: 'INFO',
|
|
95
|
+
title: `${grants.length} active user(s) hold at least one high-risk permission`,
|
|
96
|
+
detail: 'Inventory of active users whose effective permissions include one or more catalogued high-risk permissions. Use this as the privileged-access baseline for least-privilege review.',
|
|
97
|
+
remediation: 'Periodically confirm each privileged user still requires their high-risk permissions; remove any that are no longer needed.',
|
|
98
|
+
affectedItems: grants
|
|
99
|
+
.slice()
|
|
100
|
+
.sort((a, b) => b.perms.length - a.perms.length)
|
|
101
|
+
.map((g) => ({
|
|
102
|
+
label: g.username,
|
|
103
|
+
url: setupUrl,
|
|
104
|
+
note: `Profile: ${g.profileName}, ${g.perms.length} high-risk perm(s): ${g.perms.join(', ')}`,
|
|
105
|
+
})),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return { findings };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=PrivilegedAccessCheck.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 PublicContentExposureCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "public-content-exposure";
|
|
5
|
+
readonly name = "Public Static Resources & Documents";
|
|
6
|
+
readonly category = "File Security";
|
|
7
|
+
readonly description = "Flags Documents marked externally available (retrievable without authentication) and static resources cached publicly";
|
|
8
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=PublicContentExposureCheck.d.ts.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export class PublicContentExposureCheck {
|
|
2
|
+
id = 'public-content-exposure';
|
|
3
|
+
name = 'Public Static Resources & Documents';
|
|
4
|
+
category = 'File Security';
|
|
5
|
+
description = 'Flags Documents marked externally available (retrievable without authentication) and static resources cached publicly';
|
|
6
|
+
async run(ctx) {
|
|
7
|
+
const findings = [];
|
|
8
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
9
|
+
const docUrl = `${baseUrl}/lightning/setup/DocumentManagement/home`;
|
|
10
|
+
const resUrl = `${baseUrl}/lightning/setup/StaticResources/home`;
|
|
11
|
+
// 1. Documents flagged "Externally Available Image" (IsPublic) — anonymous URL access.
|
|
12
|
+
try {
|
|
13
|
+
const docs = await ctx.soql.queryAll('SELECT Id, Name, IsPublic, Folder.Name FROM Document WHERE IsPublic = true');
|
|
14
|
+
if (docs.length > 0) {
|
|
15
|
+
findings.push({
|
|
16
|
+
id: 'public-content-public-documents',
|
|
17
|
+
category: this.category,
|
|
18
|
+
riskLevel: 'HIGH',
|
|
19
|
+
title: `${docs.length} Document(s) are marked externally available (public)`,
|
|
20
|
+
detail: 'A Document with "Externally Available Image" enabled is served from a stable, guessable URL with no authentication. Anyone who obtains or guesses the URL (including search-engine crawlers) can download the file. Documents are frequently used to store images, but also exported reports, spreadsheets, and other data that should not be world-readable.',
|
|
21
|
+
remediation: 'Review each public Document and clear "Externally Available Image" unless the file is genuinely intended for anonymous access. Move sensitive files to authenticated storage (Files/ContentVersion).',
|
|
22
|
+
affectedItems: docs.map((d) => ({
|
|
23
|
+
label: d.Name,
|
|
24
|
+
url: docUrl,
|
|
25
|
+
note: `Folder: ${d.Folder?.Name ?? 'unknown'}: clear "Externally Available Image" if not intended`,
|
|
26
|
+
})),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
findings.push({
|
|
31
|
+
id: 'public-content-documents-ok',
|
|
32
|
+
category: this.category,
|
|
33
|
+
riskLevel: 'LOW',
|
|
34
|
+
passed: true,
|
|
35
|
+
title: 'No externally available Documents found',
|
|
36
|
+
detail: 'No Document is marked "Externally Available Image", so none are retrievable without authentication.',
|
|
37
|
+
remediation: 'Continue to keep Documents private unless anonymous access is explicitly required.',
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
43
|
+
findings.push({
|
|
44
|
+
id: 'public-content-documents-inaccessible',
|
|
45
|
+
category: this.category,
|
|
46
|
+
riskLevel: 'INFO',
|
|
47
|
+
inconclusive: true,
|
|
48
|
+
title: 'Public Documents could not be read',
|
|
49
|
+
detail: `The Document query was not accessible: ${msg}`,
|
|
50
|
+
remediation: 'Grant the audit user read access to Documents, then re-run the audit.',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
// 2. Static resources with public cache control — cacheable by shared/CDN caches.
|
|
54
|
+
try {
|
|
55
|
+
const resources = await ctx.tooling.query("SELECT Id, Name, CacheControl, ContentType FROM StaticResource WHERE CacheControl = 'Public'");
|
|
56
|
+
if (resources.length > 0) {
|
|
57
|
+
findings.push({
|
|
58
|
+
id: 'public-content-public-static-resources',
|
|
59
|
+
category: this.category,
|
|
60
|
+
riskLevel: 'MEDIUM',
|
|
61
|
+
title: `${resources.length} static resource(s) use Public cache control`,
|
|
62
|
+
detail: 'A static resource set to "Public" cache control is served with caching headers that allow shared and CDN caches to store it, and it is reachable by guest users on Experience Cloud sites. Static resources commonly bundle JavaScript, config, and occasionally secrets (API keys, endpoints); a Public resource widens who can retrieve those contents.',
|
|
63
|
+
remediation: 'Set cache control to "Private" for any static resource that is not deliberately public, and remove embedded secrets from static resource contents.',
|
|
64
|
+
affectedItems: resources.map((r) => ({
|
|
65
|
+
label: r.Name,
|
|
66
|
+
url: resUrl,
|
|
67
|
+
note: `${r.ContentType ?? 'unknown type'}: set cache control to Private if not intentionally public`,
|
|
68
|
+
})),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
findings.push({
|
|
73
|
+
id: 'public-content-static-resources-ok',
|
|
74
|
+
category: this.category,
|
|
75
|
+
riskLevel: 'LOW',
|
|
76
|
+
passed: true,
|
|
77
|
+
title: 'No static resources use Public cache control',
|
|
78
|
+
detail: 'All static resources use Private cache control or none exist.',
|
|
79
|
+
remediation: 'Continue to keep static resources Private unless public delivery is required.',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
85
|
+
findings.push({
|
|
86
|
+
id: 'public-content-static-resources-inaccessible',
|
|
87
|
+
category: this.category,
|
|
88
|
+
riskLevel: 'INFO',
|
|
89
|
+
inconclusive: true,
|
|
90
|
+
title: 'Static resource cache settings could not be read',
|
|
91
|
+
detail: `The StaticResource Tooling query was not accessible: ${msg}`,
|
|
92
|
+
remediation: 'Grant the audit user "View Setup and Configuration", then re-run the audit.',
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return { findings };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=PublicContentExposureCheck.js.map
|
|
@@ -58,7 +58,7 @@ export class PublicGroupSharingCheck {
|
|
|
58
58
|
affectedItems: exposures.map((e) => ({
|
|
59
59
|
label: `${e.shareTable} → ${e.groupName}`,
|
|
60
60
|
url: sharingRulesUrl,
|
|
61
|
-
note: `${e.count} sharing rule(s)
|
|
61
|
+
note: `${e.count} sharing rule(s): replace with targeted group or role-based sharing`,
|
|
62
62
|
})),
|
|
63
63
|
detail: 'Sharing rules targeting "All Internal Users" expose records to every active internal user in the org.',
|
|
64
64
|
remediation: 'Replace "All Internal Users" sharing rules with more targeted public groups or role-based sharing.',
|
|
@@ -18,7 +18,7 @@ export class ReleaseUpdatesCheck {
|
|
|
18
18
|
riskLevel: 'INFO',
|
|
19
19
|
inconclusive: true,
|
|
20
20
|
title: 'Pending release updates check could not be completed',
|
|
21
|
-
detail: 'The CriticalUpdate Tooling API object was not accessible
|
|
21
|
+
detail: 'The CriticalUpdate Tooling API object was not accessible. This can occur if the audit user lacks the "Customize Application" permission or if the org is on a restricted edition.',
|
|
22
22
|
remediation: 'Review pending Release Updates manually in Setup → Release Updates.',
|
|
23
23
|
});
|
|
24
24
|
return { findings };
|
|
@@ -61,7 +61,7 @@ export class ReleaseUpdatesCheck {
|
|
|
61
61
|
category: this.category,
|
|
62
62
|
riskLevel: 'HIGH',
|
|
63
63
|
title: `${overdueUpdates.length} release update(s) are past their auto-activation date and still not enabled`,
|
|
64
|
-
detail: 'These updates were scheduled for automatic activation by Salesforce but remain disabled. Running without them may leave the org exposed to security issues or deprecated behaviors that Salesforce has already addressed. In some cases Salesforce may have already force-activated them
|
|
64
|
+
detail: 'These updates were scheduled for automatic activation by Salesforce but remain disabled. Running without them may leave the org exposed to security issues or deprecated behaviors that Salesforce has already addressed. In some cases Salesforce may have already force-activated them. Verify current status in Setup.',
|
|
65
65
|
remediation: 'Enable these updates immediately in Setup → Release Updates. Test each one in a sandbox first. Check whether Salesforce has already force-activated any of these entries, in which case they may already be enforced despite showing as disabled.',
|
|
66
66
|
affectedItems: overdueUpdates.map((u) => ({
|
|
67
67
|
label: u.Name,
|
|
@@ -27,7 +27,7 @@ export class RemoteSitesCheck {
|
|
|
27
27
|
affectedItems: insecureSites.map((r) => ({
|
|
28
28
|
label: r.SiteName,
|
|
29
29
|
url: setupUrl,
|
|
30
|
-
note: `${r.EndpointUrl}
|
|
30
|
+
note: `${r.EndpointUrl}: enable HTTPS and re-enable protocol security`,
|
|
31
31
|
})),
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -4,7 +4,7 @@ export declare class ReportFolderAccessCheck implements SecurityCheck {
|
|
|
4
4
|
readonly id = "report-folder-access";
|
|
5
5
|
readonly name = "Report Folder Public Access";
|
|
6
6
|
readonly category = "Data Access Control";
|
|
7
|
-
readonly description = "Checks for Report folders with Public access
|
|
7
|
+
readonly description = "Checks for Report folders with Public access: any authenticated user can view all reports and their data";
|
|
8
8
|
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=ReportFolderAccessCheck.d.ts.map
|
|
@@ -2,7 +2,7 @@ export class ReportFolderAccessCheck {
|
|
|
2
2
|
id = 'report-folder-access';
|
|
3
3
|
name = 'Report Folder Public Access';
|
|
4
4
|
category = 'Data Access Control';
|
|
5
|
-
description = 'Checks for Report folders with Public access
|
|
5
|
+
description = 'Checks for Report folders with Public access: any authenticated user can view all reports and their data';
|
|
6
6
|
async run(ctx) {
|
|
7
7
|
const findings = [];
|
|
8
8
|
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
@@ -40,12 +40,12 @@ export class ReportFolderAccessCheck {
|
|
|
40
40
|
category: this.category,
|
|
41
41
|
riskLevel: 'HIGH',
|
|
42
42
|
title: `${publicFolders.length} Report folder(s) are publicly accessible to all users`,
|
|
43
|
-
detail: `Public Report folders are accessible to every authenticated Salesforce user
|
|
44
|
-
remediation: 'Change Public Report folders to Private or Shared. For Shared folders, explicitly list the users, roles, or groups that need access. Audit the content of public folders to understand the data exposure
|
|
43
|
+
detail: `Public Report folders are accessible to every authenticated Salesforce user, including over-permissioned integration accounts, recently activated users, and attackers who have compromised any credential. Reports frequently contain cross-object joins, aggregate data, and sensitive field values that bypass field-level security (FLS does not apply to report results in all configurations). An attacker with basic login access who can open a public report folder can exfiltrate bulk data from Account, Contact, Opportunity, and other sensitive objects by running or exporting the reports inside. This is a common path for mass data exfiltration that bypasses record-level security controls.`,
|
|
44
|
+
remediation: 'Change Public Report folders to Private or Shared. For Shared folders, explicitly list the users, roles, or groups that need access. Audit the content of public folders to understand the data exposure. Any report in a public folder may have been accessed by any user. Consider enabling Report Snapshot auditing and restricting the "Export Reports" permission for broad user groups.',
|
|
45
45
|
affectedItems: publicFolders.map((f) => ({
|
|
46
46
|
label: f.Name ?? f.DeveloperName ?? f.Id,
|
|
47
47
|
url: setupUrl,
|
|
48
|
-
note: `AccessType: Public
|
|
48
|
+
note: `AccessType: Public. ${publicFolders.length} folder(s) expose reports to all users`,
|
|
49
49
|
})),
|
|
50
50
|
});
|
|
51
51
|
return { findings };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AuditContext } from '../../context/AuditContext.js';
|
|
2
|
+
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
|
+
/**
|
|
4
|
+
* Advisory for sandboxes: production data copied into a sandbox and left unmasked
|
|
5
|
+
* spreads real PII/PHI into a lower-trust environment with weaker controls and
|
|
6
|
+
* broader developer access. This check runs only in sandboxes and looks for
|
|
7
|
+
* populated PII fields as a proxy for "prod data present" — it cannot prove
|
|
8
|
+
* whether Data Mask has run, so it raises an advisory to confirm masking.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SandboxDataMaskingCheck implements SecurityCheck {
|
|
11
|
+
readonly id = "sandbox-data-masking";
|
|
12
|
+
readonly name = "Sandbox Data Masking";
|
|
13
|
+
readonly category = "Data Security";
|
|
14
|
+
readonly description = "In sandboxes, flags the presence of populated PII fields (likely unmasked production data) and advises running Salesforce Data Mask";
|
|
15
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=SandboxDataMaskingCheck.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Common PII-bearing fields to probe for populated, real-looking data. A count
|
|
2
|
+
// query is cheap and non-invasive (no values are read).
|
|
3
|
+
const PII_PROBES = [
|
|
4
|
+
{ object: 'Contact', where: 'Email != null' },
|
|
5
|
+
{ object: 'Lead', where: 'Email != null' },
|
|
6
|
+
{ object: 'Contact', where: 'Phone != null' },
|
|
7
|
+
];
|
|
8
|
+
/**
|
|
9
|
+
* Advisory for sandboxes: production data copied into a sandbox and left unmasked
|
|
10
|
+
* spreads real PII/PHI into a lower-trust environment with weaker controls and
|
|
11
|
+
* broader developer access. This check runs only in sandboxes and looks for
|
|
12
|
+
* populated PII fields as a proxy for "prod data present" — it cannot prove
|
|
13
|
+
* whether Data Mask has run, so it raises an advisory to confirm masking.
|
|
14
|
+
*/
|
|
15
|
+
export class SandboxDataMaskingCheck {
|
|
16
|
+
id = 'sandbox-data-masking';
|
|
17
|
+
name = 'Sandbox Data Masking';
|
|
18
|
+
category = 'Data Security';
|
|
19
|
+
description = 'In sandboxes, flags the presence of populated PII fields (likely unmasked production data) and advises running Salesforce Data Mask';
|
|
20
|
+
async run(ctx) {
|
|
21
|
+
const findings = [];
|
|
22
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
23
|
+
if (!ctx.orgInfo.isSandbox) {
|
|
24
|
+
findings.push({
|
|
25
|
+
id: 'sandbox-data-masking-na',
|
|
26
|
+
category: this.category,
|
|
27
|
+
riskLevel: 'LOW',
|
|
28
|
+
passed: true,
|
|
29
|
+
title: 'Not a sandbox — data masking not applicable',
|
|
30
|
+
detail: 'This org is a production org, so sandbox data-masking does not apply here.',
|
|
31
|
+
remediation: 'Apply Data Mask to sandboxes seeded from this production org so PII/PHI is not copied in the clear.',
|
|
32
|
+
});
|
|
33
|
+
return { findings };
|
|
34
|
+
}
|
|
35
|
+
let probed = 0;
|
|
36
|
+
let populated = 0;
|
|
37
|
+
for (const p of PII_PROBES) {
|
|
38
|
+
try {
|
|
39
|
+
const r = await ctx.soql.query(`SELECT COUNT() FROM ${p.object} WHERE ${p.where}`);
|
|
40
|
+
probed++;
|
|
41
|
+
if (r.totalSize > 0)
|
|
42
|
+
populated++;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// object not present / not accessible — skip this probe
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (probed === 0) {
|
|
49
|
+
findings.push({
|
|
50
|
+
id: 'sandbox-data-masking-inconclusive',
|
|
51
|
+
category: this.category,
|
|
52
|
+
riskLevel: 'INFO',
|
|
53
|
+
inconclusive: true,
|
|
54
|
+
title: 'Could not probe for PII data in this sandbox',
|
|
55
|
+
detail: 'None of the PII probe objects were queryable, so the presence of unmasked production data could not be assessed.',
|
|
56
|
+
remediation: 'Confirm Data Mask has been run on this sandbox (Setup → Data Mask), independent of this check.',
|
|
57
|
+
});
|
|
58
|
+
return { findings };
|
|
59
|
+
}
|
|
60
|
+
if (populated > 0) {
|
|
61
|
+
findings.push({
|
|
62
|
+
id: 'sandbox-data-masking-pii-present',
|
|
63
|
+
category: this.category,
|
|
64
|
+
riskLevel: 'MEDIUM',
|
|
65
|
+
title: 'Sandbox contains populated PII fields — confirm Data Mask has run',
|
|
66
|
+
detail: 'This is a sandbox and PII-bearing fields (e.g. Contact/Lead email or phone) are populated, which is the footprint of a production copy. If Data Mask has not been run, real PII/PHI is sitting in a lower-trust environment with broader developer/admin access and weaker monitoring. This check cannot confirm whether masking was applied — only that sensitive fields hold data.',
|
|
67
|
+
remediation: 'Run Salesforce Data Mask on this sandbox (Setup → Data Mask) after each refresh, masking PII/PHI fields. Restrict sandbox access and treat sandbox data with the same controls as production until masking is confirmed.',
|
|
68
|
+
affectedItems: [{ label: 'Data Mask', url: `${baseUrl}/lightning/setup/DataMask/home` }],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
findings.push({
|
|
73
|
+
id: 'sandbox-data-masking-ok',
|
|
74
|
+
category: this.category,
|
|
75
|
+
riskLevel: 'LOW',
|
|
76
|
+
passed: true,
|
|
77
|
+
title: 'Sandbox shows no populated PII in the probed fields',
|
|
78
|
+
detail: `Probed ${probed} PII field(s); none were populated, consistent with a masked or data-free sandbox.`,
|
|
79
|
+
remediation: 'Continue running Data Mask after each sandbox refresh.',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return { findings };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=SandboxDataMaskingCheck.js.map
|
|
@@ -51,7 +51,7 @@ export class ScheduledApexCheck {
|
|
|
51
51
|
affectedItems: privilegedJobs.map((job) => ({
|
|
52
52
|
label: `${job.ApexClass.Name} (${job.JobType})`,
|
|
53
53
|
url: apexJobsUrl,
|
|
54
|
-
note: `Owner: ${creatorMap[job.CreatedById].Username} [${creatorMap[job.CreatedById].Profile.Name}]
|
|
54
|
+
note: `Owner: ${creatorMap[job.CreatedById].Username} [${creatorMap[job.CreatedById].Profile.Name}]: reassign to a dedicated integration user`,
|
|
55
55
|
})),
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AuditContext } from '../../context/AuditContext.js';
|
|
2
|
+
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
|
+
export declare class SeparationOfDutiesCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "separation-of-duties";
|
|
5
|
+
readonly name = "Separation of Duties";
|
|
6
|
+
readonly category = "Permissions";
|
|
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 ["effectivePermissions"];
|
|
9
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=SeparationOfDutiesCheck.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Combinations that, held by a single user, enable self-escalation, fraud, or
|
|
2
|
+
// undetectable abuse — even when each permission on its own looks acceptable.
|
|
3
|
+
const COMBOS = [
|
|
4
|
+
{
|
|
5
|
+
id: 'self-escalation',
|
|
6
|
+
label: 'Manage Users + Assign Permission Sets',
|
|
7
|
+
perms: ['ManageUsers', 'AssignPermissionSets'],
|
|
8
|
+
risk: 'CRITICAL',
|
|
9
|
+
why: 'The user can create/modify accounts and grant permission sets, so they can grant themselves (or a confederate) any access in the org: a self-service path to full admin.',
|
|
10
|
+
fix: 'Split these duties across different roles. A user who assigns permission sets should not also administer users.',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'code-and-data',
|
|
14
|
+
label: 'Author Apex + Modify All Data',
|
|
15
|
+
perms: ['AuthorApex', 'ModifyAllData'],
|
|
16
|
+
risk: 'CRITICAL',
|
|
17
|
+
why: 'The user can deploy Apex that runs without sharing AND already has unrestricted data access: enabling code-driven mass exfiltration or tampering that bypasses every control.',
|
|
18
|
+
fix: 'Remove Modify All Data from developers, or Author Apex from data-privileged users. Use separate sandbox/deploy identities for code.',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: 'grant-self-data',
|
|
22
|
+
label: 'Assign Permission Sets + View All Data',
|
|
23
|
+
perms: ['AssignPermissionSets', 'ViewAllData'],
|
|
24
|
+
risk: 'HIGH',
|
|
25
|
+
why: 'The user can read all data and grant access. They can escalate their own or others\' visibility silently.',
|
|
26
|
+
fix: 'Separate permission-set administration from broad data-visibility roles.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'identity-takeover',
|
|
30
|
+
label: 'Manage Auth. Providers + Manage Users',
|
|
31
|
+
perms: ['ManageAuthProviders', 'ManageUsers'],
|
|
32
|
+
risk: 'HIGH',
|
|
33
|
+
why: 'The user can reconfigure SSO/identity providers and administer accounts: enabling them to reroute authentication and impersonate or lock out other users.',
|
|
34
|
+
fix: 'Restrict auth-provider management to a dedicated identity team, separate from user administration.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'external-exfil-channel',
|
|
38
|
+
label: 'Manage Connected Apps + Use Any API Client',
|
|
39
|
+
perms: ['ManageConnectedApps', 'UseAnyApiClient'],
|
|
40
|
+
risk: 'HIGH',
|
|
41
|
+
why: 'The user can stand up OAuth connected apps and reach the org from any API client, bypassing API Access Control: a self-provisioned, persistent exfiltration channel.',
|
|
42
|
+
fix: 'Keep connected-app administration away from users who can bypass API access control.',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'tamper-and-cover',
|
|
46
|
+
label: 'Modify All Data + Manage Event Log Files',
|
|
47
|
+
perms: ['ModifyAllData', 'ManageEventLogFiles'],
|
|
48
|
+
risk: 'MEDIUM',
|
|
49
|
+
why: 'The user can both alter data and access/aggregate the monitoring trail, weakening the ability to detect and reconstruct their actions.',
|
|
50
|
+
fix: 'Keep monitoring/event-log access separate from broad data-modification rights.',
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
export class SeparationOfDutiesCheck {
|
|
54
|
+
id = 'separation-of-duties';
|
|
55
|
+
name = 'Separation of Duties';
|
|
56
|
+
category = 'Permissions';
|
|
57
|
+
description = 'Flags users whose effective permissions combine into self-escalation, fraud, or undetectable-abuse pairings that violate separation of duties';
|
|
58
|
+
dependsOnCache = ['effectivePermissions'];
|
|
59
|
+
async run(ctx) {
|
|
60
|
+
const findings = [];
|
|
61
|
+
const setupUrl = `${ctx.orgInfo.instanceUrl}/lightning/setup/ManageUsers/home`;
|
|
62
|
+
const grants = ctx.cache.effectivePermissions;
|
|
63
|
+
if (!grants) {
|
|
64
|
+
findings.push({
|
|
65
|
+
id: 'separation-of-duties-inconclusive',
|
|
66
|
+
category: this.category,
|
|
67
|
+
riskLevel: 'INFO',
|
|
68
|
+
inconclusive: true,
|
|
69
|
+
title: 'Separation-of-duties analysis could not run',
|
|
70
|
+
detail: 'Effective-permission data was not available (the privileged-access resolution did not complete).',
|
|
71
|
+
remediation: 'Grant the audit user "View Setup and Configuration" and "View All Users", then re-run the audit.',
|
|
72
|
+
});
|
|
73
|
+
return { findings };
|
|
74
|
+
}
|
|
75
|
+
let anyViolation = false;
|
|
76
|
+
for (const combo of COMBOS) {
|
|
77
|
+
const holders = grants.filter((g) => {
|
|
78
|
+
const s = new Set(g.perms);
|
|
79
|
+
return combo.perms.every((p) => s.has(p));
|
|
80
|
+
});
|
|
81
|
+
if (holders.length === 0)
|
|
82
|
+
continue;
|
|
83
|
+
anyViolation = true;
|
|
84
|
+
findings.push({
|
|
85
|
+
id: `separation-of-duties-${combo.id}`,
|
|
86
|
+
category: this.category,
|
|
87
|
+
riskLevel: combo.risk,
|
|
88
|
+
title: `${holders.length} user(s) hold a toxic permission combination: ${combo.label}`,
|
|
89
|
+
detail: `${combo.why} Each permission may look acceptable in isolation, which is why combination review matters.`,
|
|
90
|
+
remediation: combo.fix,
|
|
91
|
+
affectedItems: holders.map((g) => ({
|
|
92
|
+
label: g.username,
|
|
93
|
+
url: setupUrl,
|
|
94
|
+
note: `Profile: ${g.profileName}, holds ${combo.label}`,
|
|
95
|
+
})),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (!anyViolation) {
|
|
99
|
+
findings.push({
|
|
100
|
+
id: 'separation-of-duties-ok',
|
|
101
|
+
category: this.category,
|
|
102
|
+
riskLevel: 'LOW',
|
|
103
|
+
passed: true,
|
|
104
|
+
title: 'No toxic permission combinations detected',
|
|
105
|
+
detail: grants.length === 0
|
|
106
|
+
? 'No active users hold catalogued high-risk permissions, so no separation-of-duties conflicts arise.'
|
|
107
|
+
: 'No active user holds a flagged combination of permissions that would violate separation of duties.',
|
|
108
|
+
remediation: 'Continue to separate user administration, code authorship, identity, and data-access duties across roles.',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return { findings };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=SeparationOfDutiesCheck.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AuditContext } from '../../context/AuditContext.js';
|
|
2
|
+
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
|
+
/**
|
|
4
|
+
* Re-slices the Health Check risk set (populated by HealthCheckCheck, so no extra
|
|
5
|
+
* API call) to the session / clickjack / CSRF / XSS hardening domain and gives
|
|
6
|
+
* targeted, per-setting remediation. HealthCheckCheck reports a flat count; this
|
|
7
|
+
* check tells you *which* browser-session protections deviate from Salesforce's
|
|
8
|
+
* baseline and how to fix each — the "enable secure config" surface.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SessionHardeningCheck implements SecurityCheck {
|
|
11
|
+
readonly id = "session-hardening";
|
|
12
|
+
readonly name = "Session & Clickjack Hardening";
|
|
13
|
+
readonly category = "Session Security";
|
|
14
|
+
readonly description = "Grades clickjack, CSRF, session-lock, and XSS-protection settings from Health Check and gives per-setting remediation";
|
|
15
|
+
readonly dependsOnCache: readonly ["healthCheckRisks"];
|
|
16
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
17
|
+
private static readonly FLAGS;
|
|
18
|
+
/** Authoritative evaluation from SecuritySettings metadata; null → fall back to the cache path. */
|
|
19
|
+
private evaluateFromMetadata;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=SessionHardeningCheck.d.ts.map
|