@cclabsnz/sf-audit 1.0.0 → 1.1.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 +75 -0
- 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.js +6 -6
- 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/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/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 -54
- package/lib/renderers/MarkdownRenderer.js +35 -2
- package/package.json +12 -3
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// CI/CD and deployment tooling name patterns — presence in Connected App names signals
|
|
2
|
+
// a pipeline-based workflow exists (SBS-DEP-001 positive indicator)
|
|
3
|
+
const CI_CD_APP_PATTERNS = [
|
|
4
|
+
/jenkins/i, /github/i, /gitlab/i, /azure[\s-]*devops/i, /bitbucket/i,
|
|
5
|
+
/circleci/i, /travis/i, /copado/i, /gearset/i, /autorabit/i,
|
|
6
|
+
/flosum/i, /ownbackup/i, /metazoa/i, /pipeline/i, /deploy/i,
|
|
7
|
+
];
|
|
8
|
+
const ADMIN_PROFILE_RE = /admin|system administrator/i;
|
|
9
|
+
export class DeploymentIdentityCheck {
|
|
10
|
+
id = 'deployment-identity';
|
|
11
|
+
name = 'Deployment Identity';
|
|
12
|
+
category = 'Deployments';
|
|
13
|
+
description = 'SBS-DEP-001/003: checks for a designated deployment identity and monitors for uncontrolled deployment activity';
|
|
14
|
+
// connectedAppNames is written by ConnectedAppsCheck at zero extra cost
|
|
15
|
+
dependsOnCache = ['connectedAppNames'];
|
|
16
|
+
async run(ctx) {
|
|
17
|
+
const findings = [];
|
|
18
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
19
|
+
const auditUrl = `${baseUrl}/lightning/setup/AuditTrail/home`;
|
|
20
|
+
const connectedAppsUrl = `${baseUrl}/lightning/setup/ConnectedApplication/home`;
|
|
21
|
+
// Signal 1 (cache, zero cost): CI/CD-named Connected Apps indicate a pipeline exists.
|
|
22
|
+
const connectedAppNames = ctx.cache.connectedAppNames ?? [];
|
|
23
|
+
const ciCdApps = connectedAppNames.filter((name) => CI_CD_APP_PATTERNS.some((p) => p.test(name)));
|
|
24
|
+
if (ciCdApps.length > 0) {
|
|
25
|
+
findings.push({
|
|
26
|
+
id: 'deployment-cicd-apps-found',
|
|
27
|
+
category: this.category,
|
|
28
|
+
riskLevel: 'LOW',
|
|
29
|
+
passed: true,
|
|
30
|
+
title: `${ciCdApps.length} CI/CD-related Connected App(s) detected — pipeline deployment likely in use`,
|
|
31
|
+
detail: 'SBS-DEP-001 requires all deployments to be performed by a designated deployment identity, not individual admin accounts. Connected Apps with CI/CD tool names indicate pipeline-based deployments are in use, which is consistent with a controlled deployment process.',
|
|
32
|
+
remediation: 'Confirm each CI/CD app authenticates as a dedicated deployment service account (not a shared admin user). Document the deployment identity and its owner in the system of record.',
|
|
33
|
+
affectedItems: ciCdApps.map((name) => ({
|
|
34
|
+
label: name,
|
|
35
|
+
url: connectedAppsUrl,
|
|
36
|
+
note: 'CI/CD Connected App — verify it uses a named, dedicated deployment user',
|
|
37
|
+
})),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
// Signal 2 (1 query): SetupAuditTrail entries in deploy-related sections over 90 days.
|
|
41
|
+
// This reveals how many distinct users are performing deployment operations and whether
|
|
42
|
+
// those users are individual admins rather than a designated deployment identity.
|
|
43
|
+
let deployRecords;
|
|
44
|
+
try {
|
|
45
|
+
deployRecords = await ctx.soql.queryAll(`SELECT CreatedDate, CreatedBy.Id, CreatedBy.Username, CreatedBy.Profile.Name,
|
|
46
|
+
Section, Action, Display
|
|
47
|
+
FROM SetupAuditTrail
|
|
48
|
+
WHERE CreatedDate > LAST_N_DAYS:90
|
|
49
|
+
AND Section IN ('Change Sets', 'Developer Tools', 'Packages', 'Metadata')
|
|
50
|
+
ORDER BY CreatedDate DESC
|
|
51
|
+
LIMIT 300`);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
findings.push({
|
|
55
|
+
id: 'deployment-audit-trail-inaccessible',
|
|
56
|
+
category: this.category,
|
|
57
|
+
riskLevel: 'MEDIUM',
|
|
58
|
+
inconclusive: true,
|
|
59
|
+
title: 'Deployment audit trail could not be read — SBS-DEP-003 unverified',
|
|
60
|
+
detail: 'SetupAuditTrail was not accessible. Deployment activity from the past 90 days cannot be analyzed for unauthorized modifications. Without this data it is impossible to determine whether deployments are performed by a single designated identity.',
|
|
61
|
+
remediation: 'Grant "View Setup and Configuration" permission to the audit user to enable audit trail analysis.',
|
|
62
|
+
});
|
|
63
|
+
return { findings };
|
|
64
|
+
}
|
|
65
|
+
if (deployRecords.length === 0 && ciCdApps.length === 0) {
|
|
66
|
+
findings.push({
|
|
67
|
+
id: 'deployment-no-activity',
|
|
68
|
+
category: this.category,
|
|
69
|
+
riskLevel: 'INFO',
|
|
70
|
+
title: 'No deployment activity detected in the last 90 days — SBS-DEP-001/003',
|
|
71
|
+
detail: 'SBS-DEP-001 requires a designated deployment identity. No deployment-related SetupAuditTrail entries (Change Sets, Developer Tools, Packages, Metadata sections) and no CI/CD-named Connected Apps were found. Deployments via SF CLI JWT flow or Metadata API may not appear in the audit trail.',
|
|
72
|
+
remediation: 'Verify deployment processes are documented with a designated identity. If using SF CLI with JWT, confirm the authenticating user is a dedicated service account, not an individual admin.',
|
|
73
|
+
});
|
|
74
|
+
return { findings };
|
|
75
|
+
}
|
|
76
|
+
if (deployRecords.length > 0) {
|
|
77
|
+
// Group by user to find unique deployers
|
|
78
|
+
const byUser = new Map();
|
|
79
|
+
for (const r of deployRecords) {
|
|
80
|
+
const uid = r.CreatedBy.Id;
|
|
81
|
+
const existing = byUser.get(uid);
|
|
82
|
+
if (existing) {
|
|
83
|
+
existing.count++;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
byUser.set(uid, {
|
|
87
|
+
username: r.CreatedBy.Username,
|
|
88
|
+
profile: r.CreatedBy.Profile?.Name ?? 'Unknown',
|
|
89
|
+
count: 1,
|
|
90
|
+
latest: r.CreatedDate,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const uniqueDeployers = [...byUser.values()];
|
|
95
|
+
const adminDeployers = uniqueDeployers.filter((u) => ADMIN_PROFILE_RE.test(u.profile));
|
|
96
|
+
// SBS-DEP-001: all deployments should come from a single designated identity
|
|
97
|
+
if (uniqueDeployers.length > 1) {
|
|
98
|
+
findings.push({
|
|
99
|
+
id: 'deployment-multiple-identities',
|
|
100
|
+
category: this.category,
|
|
101
|
+
riskLevel: uniqueDeployers.length > 3 ? 'HIGH' : 'MEDIUM',
|
|
102
|
+
title: `${uniqueDeployers.length} distinct user(s) performed deployment actions in the last 90 days — SBS-DEP-001`,
|
|
103
|
+
detail: `SBS-DEP-001 requires all deployments to be performed by a single designated deployment identity, not individual user accounts. ${uniqueDeployers.length} distinct users were found in deployment-related audit trail entries (Change Sets, Developer Tools, Packages, Metadata) over the past 90 days. Multiple deployers make it harder to audit changes and bypass change-management controls.`,
|
|
104
|
+
remediation: 'Centralise deployments through a CI/CD pipeline that authenticates as a single named service account. Revoke direct deployment access from individual admin users.',
|
|
105
|
+
affectedItems: uniqueDeployers.map(({ username, profile, count, latest }) => ({
|
|
106
|
+
label: username,
|
|
107
|
+
url: auditUrl,
|
|
108
|
+
note: `${count} deployment action(s) | last: ${new Date(latest).toISOString().split('T')[0]} | profile: ${profile}`,
|
|
109
|
+
})),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
else if (uniqueDeployers.length === 1) {
|
|
113
|
+
const d = uniqueDeployers[0];
|
|
114
|
+
findings.push({
|
|
115
|
+
id: 'deployment-single-identity',
|
|
116
|
+
category: this.category,
|
|
117
|
+
riskLevel: 'LOW',
|
|
118
|
+
passed: true,
|
|
119
|
+
title: 'All deployment activity in the last 90 days came from a single identity — SBS-DEP-001',
|
|
120
|
+
detail: `SBS-DEP-001 requires a designated deployment identity. All ${deployRecords.length} deployment-related audit trail entries over 90 days originate from the same user: ${d.username} (${d.profile}).`,
|
|
121
|
+
remediation: 'Document this identity as the designated deployment user in your system of record. Verify it is a service account and not a personal admin account.',
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// SBS-DEP-003: admin-profile deployers are a monitoring risk (human, not CI accounts)
|
|
125
|
+
if (adminDeployers.length > 0) {
|
|
126
|
+
findings.push({
|
|
127
|
+
id: 'deployment-admin-accounts',
|
|
128
|
+
category: this.category,
|
|
129
|
+
riskLevel: 'MEDIUM',
|
|
130
|
+
title: `${adminDeployers.length} deployer(s) are admin-profile users — SBS-DEP-003`,
|
|
131
|
+
detail: 'SBS-DEP-003 requires monitoring for unauthorized deployment modifications. Deployments performed by administrator-profile users are harder to distinguish from emergency break-glass changes and are more likely to occur outside of a change-management window.',
|
|
132
|
+
remediation: 'Replace admin-user deployments with a CI/CD pipeline using a dedicated integration user with only deployment-required permissions. Reserve individual admin accounts for emergency use only, and document any emergency deployments in the system of record.',
|
|
133
|
+
affectedItems: adminDeployers.map(({ username, profile, count }) => ({
|
|
134
|
+
label: username,
|
|
135
|
+
url: auditUrl,
|
|
136
|
+
note: `${count} deployment action(s) | profile: ${profile} — replace with dedicated deployment service account`,
|
|
137
|
+
})),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return { findings };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=DeploymentIdentityCheck.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 EnhancedDomainsCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "enhanced-domains";
|
|
5
|
+
readonly name = "Enhanced Domains";
|
|
6
|
+
readonly category = "Authentication";
|
|
7
|
+
readonly description = "Verifies Enhanced Domains is enabled \u2014 prevents cross-org cookie leakage and enables org-specific URL isolation (required since Spring 2023)";
|
|
8
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=EnhancedDomainsCheck.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Enhanced Domains changes the URL format for Salesforce org pages, Experience Cloud sites,
|
|
2
|
+
// Visualforce pages, and Lightning apps. The new format uses org-specific subdomains
|
|
3
|
+
// that prevent cross-org cookie and credential leakage.
|
|
4
|
+
//
|
|
5
|
+
// Pre-Enhanced: org uses shared subdomains like force.com, visualforce.com, site.com
|
|
6
|
+
// Post-Enhanced: all pages served from *.my.salesforce.com and *.my.site.com subdomains
|
|
7
|
+
//
|
|
8
|
+
// We detect Enhanced Domains by checking:
|
|
9
|
+
// 1. My Domain exists (prerequisite)
|
|
10
|
+
// 2. The instance URL uses the enhanced domain format (contains .my.salesforce.com or .develop.my.salesforce.com)
|
|
11
|
+
// 3. Org is not still on a shared instance URL like na1.salesforce.com
|
|
12
|
+
const ENHANCED_DOMAIN_PATTERN = /\.my\.salesforce\.com|\.sandbox\.my\.salesforce\.com|\.develop\.my\.salesforce\.com|\.scratch\.my\.salesforce\.com/i;
|
|
13
|
+
const LEGACY_INSTANCE_PATTERN = /^https:\/\/[a-z]{2}\d+\.salesforce\.com/i;
|
|
14
|
+
export class EnhancedDomainsCheck {
|
|
15
|
+
id = 'enhanced-domains';
|
|
16
|
+
name = 'Enhanced Domains';
|
|
17
|
+
category = 'Authentication';
|
|
18
|
+
description = 'Verifies Enhanced Domains is enabled — prevents cross-org cookie leakage and enables org-specific URL isolation (required since Spring 2023)';
|
|
19
|
+
async run(ctx) {
|
|
20
|
+
const findings = [];
|
|
21
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
22
|
+
const domainSetupUrl = `${baseUrl}/lightning/setup/MyDomain/home`;
|
|
23
|
+
const orgResult = await ctx.soql.query(`SELECT MyDomain, IsSandbox, InstanceName FROM Organization LIMIT 1`);
|
|
24
|
+
const org = orgResult.records[0];
|
|
25
|
+
if (!org) {
|
|
26
|
+
findings.push({
|
|
27
|
+
id: 'enhanced-domains-org-unreadable',
|
|
28
|
+
category: this.category,
|
|
29
|
+
riskLevel: 'INFO',
|
|
30
|
+
inconclusive: true,
|
|
31
|
+
title: 'Organization settings could not be read',
|
|
32
|
+
detail: 'The Organization object query returned no results.',
|
|
33
|
+
remediation: 'Verify the audit user has read access to the Organization object.',
|
|
34
|
+
});
|
|
35
|
+
return { findings };
|
|
36
|
+
}
|
|
37
|
+
const { MyDomain: myDomain, IsSandbox: isSandbox } = org;
|
|
38
|
+
const instanceUrl = baseUrl;
|
|
39
|
+
// Check if Enhanced Domains is active based on the instance URL format
|
|
40
|
+
const hasEnhancedDomainUrl = ENHANCED_DOMAIN_PATTERN.test(instanceUrl);
|
|
41
|
+
const hasLegacyUrl = LEGACY_INSTANCE_PATTERN.test(instanceUrl);
|
|
42
|
+
const hasMyDomain = !!myDomain;
|
|
43
|
+
if (!hasMyDomain) {
|
|
44
|
+
findings.push({
|
|
45
|
+
id: 'enhanced-domains-no-my-domain',
|
|
46
|
+
category: this.category,
|
|
47
|
+
riskLevel: isSandbox ? 'MEDIUM' : 'HIGH',
|
|
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
|
+
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
|
+
affectedItems: [{ label: 'My Domain Setup', url: domainSetupUrl, note: 'Configure My Domain as a prerequisite for Enhanced Domains' }],
|
|
52
|
+
});
|
|
53
|
+
return { findings };
|
|
54
|
+
}
|
|
55
|
+
if (hasEnhancedDomainUrl) {
|
|
56
|
+
findings.push({
|
|
57
|
+
id: 'enhanced-domains-enabled',
|
|
58
|
+
category: this.category,
|
|
59
|
+
riskLevel: 'LOW',
|
|
60
|
+
passed: true,
|
|
61
|
+
title: `Enhanced Domains is active — org uses isolated subdomain (${myDomain})`,
|
|
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
|
+
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
|
+
});
|
|
65
|
+
}
|
|
66
|
+
else if (hasLegacyUrl || !hasEnhancedDomainUrl) {
|
|
67
|
+
findings.push({
|
|
68
|
+
id: 'enhanced-domains-not-detected',
|
|
69
|
+
category: this.category,
|
|
70
|
+
riskLevel: isSandbox ? 'LOW' : 'MEDIUM',
|
|
71
|
+
title: `Enhanced Domains may not be enabled — org URL appears to use a legacy format`,
|
|
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
|
+
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
|
+
affectedItems: [{
|
|
75
|
+
label: myDomain,
|
|
76
|
+
url: domainSetupUrl,
|
|
77
|
+
note: `Instance URL: ${instanceUrl} — expected *.my.salesforce.com format`,
|
|
78
|
+
}],
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return { findings };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=EnhancedDomainsCheck.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 EscalationPermsCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "escalation-perms";
|
|
5
|
+
readonly name = "Privilege Escalation Permissions";
|
|
6
|
+
readonly category = "Permissions";
|
|
7
|
+
readonly description = "Flags users holding lateral-movement/persistence permissions (Manage Internal Users, Assign Permission Sets, Modify Metadata, Manage Auth Providers, etc.)";
|
|
8
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=EscalationPermsCheck.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const PERMS = [
|
|
2
|
+
['PermissionsManageInternalUsers', 'Manage Internal Users'],
|
|
3
|
+
['PermissionsAssignPermissionSets', 'Assign Permission Sets'],
|
|
4
|
+
['PermissionsModifyMetadata', 'Modify Metadata'],
|
|
5
|
+
['PermissionsManageAuthProviders', 'Manage Auth. Providers'],
|
|
6
|
+
['PermissionsManageConnectedApps', 'Manage Connected Apps'],
|
|
7
|
+
['PermissionsManageSession', 'Manage Session Permission Set Activations'],
|
|
8
|
+
['PermissionsPasswordNeverExpires', 'Password Never Expires'],
|
|
9
|
+
['PermissionsViewAllUsers', 'View All Users'],
|
|
10
|
+
];
|
|
11
|
+
export class EscalationPermsCheck {
|
|
12
|
+
id = 'escalation-perms';
|
|
13
|
+
name = 'Privilege Escalation Permissions';
|
|
14
|
+
category = 'Permissions';
|
|
15
|
+
description = 'Flags users holding lateral-movement/persistence permissions (Manage Internal Users, Assign Permission Sets, Modify Metadata, Manage Auth Providers, etc.)';
|
|
16
|
+
async run(ctx) {
|
|
17
|
+
const findings = [];
|
|
18
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
19
|
+
const permFields = PERMS.map(([f]) => `PermissionSet.${f}`).join(', ');
|
|
20
|
+
const permWhere = PERMS.map(([f]) => `PermissionSet.${f} = true`).join(' OR ');
|
|
21
|
+
let rows;
|
|
22
|
+
try {
|
|
23
|
+
rows = await ctx.soql.queryAll(`SELECT AssigneeId, Assignee.Username, ${permFields}
|
|
24
|
+
FROM PermissionSetAssignment
|
|
25
|
+
WHERE (${permWhere}) AND Assignee.IsActive = true`);
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
29
|
+
findings.push({
|
|
30
|
+
id: 'escalation-perms-inaccessible',
|
|
31
|
+
category: this.category,
|
|
32
|
+
riskLevel: 'INFO',
|
|
33
|
+
inconclusive: true,
|
|
34
|
+
title: 'Privilege-escalation permission check could not be completed',
|
|
35
|
+
detail: `The PermissionSetAssignment query was not accessible: ${msg}`,
|
|
36
|
+
remediation: 'Grant the audit user "View Setup and Configuration", then re-run the audit.',
|
|
37
|
+
});
|
|
38
|
+
return { findings };
|
|
39
|
+
}
|
|
40
|
+
const affected = [];
|
|
41
|
+
for (const row of rows) {
|
|
42
|
+
for (const [field, label] of PERMS) {
|
|
43
|
+
if (row.PermissionSet[field]) {
|
|
44
|
+
affected.push({ username: row.Assignee?.Username ?? row.AssigneeId, userId: row.AssigneeId, perm: label });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (affected.length === 0) {
|
|
49
|
+
findings.push({
|
|
50
|
+
id: 'escalation-perms-ok',
|
|
51
|
+
category: this.category,
|
|
52
|
+
riskLevel: 'LOW',
|
|
53
|
+
passed: true,
|
|
54
|
+
title: 'No users hold privilege-escalation permissions',
|
|
55
|
+
detail: 'No active users were found holding lateral-movement or persistence permissions.',
|
|
56
|
+
remediation: 'Continue to review escalation permissions periodically.',
|
|
57
|
+
});
|
|
58
|
+
return { findings };
|
|
59
|
+
}
|
|
60
|
+
findings.push({
|
|
61
|
+
id: 'escalation-perms-found',
|
|
62
|
+
category: this.category,
|
|
63
|
+
riskLevel: 'HIGH',
|
|
64
|
+
title: `${affected.length} escalation-permission grant(s) across active users`,
|
|
65
|
+
detail: 'These permissions let a user create accounts, reset passwords, assign permission sets, modify metadata, ' +
|
|
66
|
+
'or register auth providers — the primitives an attacker uses for lateral movement and persistence after an initial foothold.',
|
|
67
|
+
remediation: 'Remove these permissions from non-administrator profiles/permission sets and document who legitimately needs each one.',
|
|
68
|
+
affectedItems: affected.map((a) => ({
|
|
69
|
+
label: `${a.username} — ${a.perm}`,
|
|
70
|
+
url: `${baseUrl}/${a.userId}`,
|
|
71
|
+
note: 'Review and remove if not essential',
|
|
72
|
+
})),
|
|
73
|
+
});
|
|
74
|
+
return { findings };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=EscalationPermsCheck.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AuditContext } from '../../context/AuditContext.js';
|
|
2
|
+
import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
|
|
3
|
+
export declare class EventMonitoringCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "event-monitoring";
|
|
5
|
+
readonly name = "Event Monitoring Storage";
|
|
6
|
+
readonly category = "Event Monitoring";
|
|
7
|
+
readonly description = "SBS-MON-001 / SBS-INT-004: verifies Event Monitoring is enabled and logs cover at least 30 days";
|
|
8
|
+
readonly populatesCache: readonly ["eventLogSummary"];
|
|
9
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=EventMonitoringCheck.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export class EventMonitoringCheck {
|
|
2
|
+
id = 'event-monitoring';
|
|
3
|
+
name = 'Event Monitoring Storage';
|
|
4
|
+
category = 'Event Monitoring';
|
|
5
|
+
description = 'SBS-MON-001 / SBS-INT-004: verifies Event Monitoring is enabled and logs cover at least 30 days';
|
|
6
|
+
populatesCache = ['eventLogSummary'];
|
|
7
|
+
async run(ctx) {
|
|
8
|
+
const findings = [];
|
|
9
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
10
|
+
const setupUrl = `${baseUrl}/lightning/setup/EventLogFile/home`;
|
|
11
|
+
try {
|
|
12
|
+
// Single aggregated query: one row per event type, with earliest log date and file count.
|
|
13
|
+
// Zero results means Event Monitoring is not enabled or not licensed.
|
|
14
|
+
const result = await ctx.soql.query(`SELECT EventType, COUNT(Id) fileCount, MIN(LogDate) earliestDate
|
|
15
|
+
FROM EventLogFile
|
|
16
|
+
WHERE LogDate > LAST_N_DAYS:35
|
|
17
|
+
GROUP BY EventType
|
|
18
|
+
ORDER BY COUNT(Id) DESC`);
|
|
19
|
+
const groups = result.records;
|
|
20
|
+
const totalFiles = groups.reduce((sum, r) => sum + (r.fileCount ?? 0), 0);
|
|
21
|
+
const eventTypes = groups.map((r) => r.EventType);
|
|
22
|
+
const earliestDate = groups.reduce((earliest, r) => {
|
|
23
|
+
if (!r.earliestDate)
|
|
24
|
+
return earliest;
|
|
25
|
+
if (!earliest)
|
|
26
|
+
return r.earliestDate;
|
|
27
|
+
return r.earliestDate < earliest ? r.earliestDate : earliest;
|
|
28
|
+
}, null);
|
|
29
|
+
// Populate cache for SiemIntegrationCheck at zero extra API cost
|
|
30
|
+
ctx.cache.eventLogSummary = { earliestDate, totalFiles, eventTypes };
|
|
31
|
+
if (totalFiles === 0) {
|
|
32
|
+
findings.push({
|
|
33
|
+
id: 'event-monitoring-disabled',
|
|
34
|
+
category: this.category,
|
|
35
|
+
riskLevel: 'HIGH',
|
|
36
|
+
title: 'No Event Monitoring log files found in the last 35 days — SBS-MON-001',
|
|
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 — SBS-MON-001 compliance requires it.',
|
|
39
|
+
affectedItems: [{ label: 'Event Monitoring Setup', url: setupUrl, note: 'Enable event log storage' }],
|
|
40
|
+
});
|
|
41
|
+
return { findings };
|
|
42
|
+
}
|
|
43
|
+
// SBS-MON-001: inventory of what is being captured
|
|
44
|
+
findings.push({
|
|
45
|
+
id: 'event-monitoring-enabled',
|
|
46
|
+
category: this.category,
|
|
47
|
+
riskLevel: 'LOW',
|
|
48
|
+
passed: true,
|
|
49
|
+
title: `Event Monitoring active — ${totalFiles} log file(s) across ${eventTypes.length} event type(s) — SBS-MON-001`,
|
|
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
|
+
remediation: 'Review the list of monitored event types and ensure Login, API, DataExport, and LightningInteraction events are included.',
|
|
52
|
+
});
|
|
53
|
+
// SBS-INT-004: API event logs must be retained for at least 30 days
|
|
54
|
+
if (earliestDate) {
|
|
55
|
+
const daysCovered = Math.ceil((Date.now() - new Date(earliestDate).getTime()) / 86_400_000);
|
|
56
|
+
if (daysCovered < 30) {
|
|
57
|
+
findings.push({
|
|
58
|
+
id: 'event-monitoring-retention-short',
|
|
59
|
+
category: this.category,
|
|
60
|
+
riskLevel: 'MEDIUM',
|
|
61
|
+
title: `Event logs cover only ${daysCovered} day(s) — SBS-INT-004 requires 30-day minimum`,
|
|
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
|
+
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
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// EventLogFile may not be accessible without Event Monitoring license
|
|
70
|
+
ctx.cache.eventLogSummary = { earliestDate: null, totalFiles: 0, eventTypes: [] };
|
|
71
|
+
findings.push({
|
|
72
|
+
id: 'event-monitoring-inaccessible',
|
|
73
|
+
category: this.category,
|
|
74
|
+
riskLevel: 'MEDIUM',
|
|
75
|
+
inconclusive: true,
|
|
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
|
+
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
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return { findings };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=EventMonitoringCheck.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 ExperienceCloudSiteCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "experience-cloud-site";
|
|
5
|
+
readonly name = "Experience Cloud Site Security";
|
|
6
|
+
readonly category = "Access Control";
|
|
7
|
+
readonly description = "Checks live Experience Cloud sites for self-registration enabled (attacker account creation) and guest user presence";
|
|
8
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ExperienceCloudSiteCheck.d.ts.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export class ExperienceCloudSiteCheck {
|
|
2
|
+
id = 'experience-cloud-site';
|
|
3
|
+
name = 'Experience Cloud Site Security';
|
|
4
|
+
category = 'Access Control';
|
|
5
|
+
description = 'Checks live Experience Cloud sites for self-registration enabled (attacker account creation) and guest user presence';
|
|
6
|
+
async run(ctx) {
|
|
7
|
+
const findings = [];
|
|
8
|
+
const baseUrl = ctx.orgInfo.instanceUrl;
|
|
9
|
+
const setupUrl = `${baseUrl}/lightning/setup/SetupNetworks/home`;
|
|
10
|
+
let networks;
|
|
11
|
+
try {
|
|
12
|
+
networks = await ctx.soql.queryAll(`SELECT Id, Name, Status, UrlPathPrefix, SelfRegProfileId, GuestUserId
|
|
13
|
+
FROM Network
|
|
14
|
+
WHERE Status = 'Live'`);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
findings.push({
|
|
18
|
+
id: 'experience-cloud-site-inaccessible',
|
|
19
|
+
category: this.category,
|
|
20
|
+
riskLevel: 'INFO',
|
|
21
|
+
inconclusive: true,
|
|
22
|
+
title: 'Experience Cloud site configuration could not be queried',
|
|
23
|
+
detail: 'The Network SOQL query was not accessible. This may indicate the audit user lacks access to Experience Cloud configuration or no sites are provisioned.',
|
|
24
|
+
remediation: 'Grant "View Setup and Configuration" to the audit user and re-run. If no Experience Cloud licence is active, this check is not applicable.',
|
|
25
|
+
});
|
|
26
|
+
return { findings };
|
|
27
|
+
}
|
|
28
|
+
if (networks.length === 0) {
|
|
29
|
+
findings.push({
|
|
30
|
+
id: 'experience-cloud-site-none',
|
|
31
|
+
category: this.category,
|
|
32
|
+
riskLevel: 'LOW',
|
|
33
|
+
passed: true,
|
|
34
|
+
title: 'No live Experience Cloud sites found',
|
|
35
|
+
detail: 'No publicly live Experience Cloud (Community/Portal) sites are configured in this org.',
|
|
36
|
+
remediation: 'If sites are added in the future, review self-registration settings and guest user permissions before going live.',
|
|
37
|
+
});
|
|
38
|
+
return { findings };
|
|
39
|
+
}
|
|
40
|
+
const selfRegSites = networks.filter((n) => n.SelfRegProfileId !== null);
|
|
41
|
+
const guestSites = networks.filter((n) => n.GuestUserId !== null);
|
|
42
|
+
if (selfRegSites.length > 0) {
|
|
43
|
+
findings.push({
|
|
44
|
+
id: 'experience-cloud-site-self-registration',
|
|
45
|
+
category: this.category,
|
|
46
|
+
riskLevel: 'HIGH',
|
|
47
|
+
title: `${selfRegSites.length} live Experience Cloud site(s) allow self-registration`,
|
|
48
|
+
detail: 'Self-registration allows anyone on the internet to create a portal account. Attackers exploit this to: (1) enumerate valid email addresses already registered; (2) create portal accounts to access any data exposed to authenticated portal users via OWD, sharing rules, or misconfigured permissions; (3) pivot from a portal user account to exploit object-level permission misconfigurations. If OWD for sensitive objects is set to Public Read or wider for external users, self-registration gives attackers direct data access without any approval step.',
|
|
49
|
+
remediation: 'Disable self-registration unless explicitly required (Setup → Digital Experiences → <site> → Administration → Registration). If required, implement email domain allow-listing, CAPTCHA, and manual approval workflows. Immediately audit external OWD settings and guest user permissions for sites with self-registration enabled.',
|
|
50
|
+
affectedItems: selfRegSites.map((n) => ({
|
|
51
|
+
label: n.Name,
|
|
52
|
+
url: `${baseUrl}/lightning/setup/SetupNetworks/home`,
|
|
53
|
+
note: `Self-registration enabled — SelfRegProfileId: ${n.SelfRegProfileId}`,
|
|
54
|
+
})),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (guestSites.length > 0) {
|
|
58
|
+
findings.push({
|
|
59
|
+
id: 'experience-cloud-site-guest-access',
|
|
60
|
+
category: this.category,
|
|
61
|
+
riskLevel: 'MEDIUM',
|
|
62
|
+
title: `${guestSites.length} live Experience Cloud site(s) have guest (unauthenticated) access enabled`,
|
|
63
|
+
detail: 'Sites with an active Guest User allow unauthenticated visitors to access the site without creating an account. Any Salesforce objects or records accessible to the Guest User profile are exposed to the entire internet. Misconfigurations in guest user object permissions or OWD external settings result in public data exposure.',
|
|
64
|
+
remediation: 'Review guest user object permissions for each site (Setup → Profiles → <Guest Profile> → Object Settings). Ensure external OWD is Private for all sensitive objects. Run the Guest User Access check for detailed permission findings.',
|
|
65
|
+
affectedItems: guestSites.map((n) => ({
|
|
66
|
+
label: n.Name,
|
|
67
|
+
url: setupUrl,
|
|
68
|
+
note: `Guest access enabled — verify Guest Profile permissions`,
|
|
69
|
+
})),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (selfRegSites.length === 0 && guestSites.length === 0) {
|
|
73
|
+
findings.push({
|
|
74
|
+
id: 'experience-cloud-site-ok',
|
|
75
|
+
category: this.category,
|
|
76
|
+
riskLevel: 'LOW',
|
|
77
|
+
passed: true,
|
|
78
|
+
title: `${networks.length} live Experience Cloud site(s) — no self-registration or open guest access`,
|
|
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
|
+
remediation: 'Continue to monitor site configuration as sites are updated. Review portal user object permissions periodically.',
|
|
81
|
+
affectedItems: networks.map((n) => ({
|
|
82
|
+
label: n.Name,
|
|
83
|
+
url: setupUrl,
|
|
84
|
+
note: `URL prefix: ${n.UrlPathPrefix ?? '(default)'}`,
|
|
85
|
+
})),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return { findings };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=ExperienceCloudSiteCheck.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 FailedLoginCheck implements SecurityCheck {
|
|
4
|
+
readonly id = "failed-login-detection";
|
|
5
|
+
readonly name = "Failed Login Detection";
|
|
6
|
+
readonly category = "Threat Detection";
|
|
7
|
+
readonly description = "Analyses LoginHistory to detect brute-force and credential stuffing patterns from the last 7 days";
|
|
8
|
+
run(ctx: AuditContext): Promise<CheckResult>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FailedLoginCheck.d.ts.map
|