@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.
Files changed (142) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +135 -31
  3. package/lib/api/MetadataClient.d.ts +4 -0
  4. package/lib/api/MetadataClient.js +2 -0
  5. package/lib/api/MetadataClientImpl.d.ts +8 -0
  6. package/lib/api/MetadataClientImpl.js +22 -0
  7. package/lib/api/RestClient.d.ts +1 -0
  8. package/lib/api/RestClientImpl.d.ts +1 -0
  9. package/lib/api/RestClientImpl.js +6 -0
  10. package/lib/chains/CapabilityRegistry.js +19 -0
  11. package/lib/chains/namedChains.js +26 -4
  12. package/lib/checks/eventLogAccess.d.ts +14 -0
  13. package/lib/checks/eventLogAccess.js +33 -0
  14. package/lib/checks/impl/AnonymousApexAuditCheck.js +5 -5
  15. package/lib/checks/impl/ApexCrudFLSCheck.d.ts +1 -1
  16. package/lib/checks/impl/ApexCrudFLSCheck.js +4 -4
  17. package/lib/checks/impl/ApexLoggingCheck.js +10 -10
  18. package/lib/checks/impl/ApexRestEndpointCheck.js +5 -5
  19. package/lib/checks/impl/ApexSharingCheck.js +3 -3
  20. package/lib/checks/impl/ApiClientPermissionCheck.js +2 -2
  21. package/lib/checks/impl/AuthProvidersCheck.d.ts +17 -0
  22. package/lib/checks/impl/AuthProvidersCheck.js +88 -0
  23. package/lib/checks/impl/CertificateExpiryCheck.js +1 -1
  24. package/lib/checks/impl/ClassicSitesCheck.d.ts +17 -0
  25. package/lib/checks/impl/ClassicSitesCheck.js +65 -0
  26. package/lib/checks/impl/ConnectedAppInactivityCheck.d.ts +1 -1
  27. package/lib/checks/impl/ConnectedAppInactivityCheck.js +5 -5
  28. package/lib/checks/impl/ConnectedAppScopeCheck.d.ts +1 -1
  29. package/lib/checks/impl/ConnectedAppScopeCheck.js +4 -4
  30. package/lib/checks/impl/ConnectedAppsCheck.js +2 -2
  31. package/lib/checks/impl/ContentLinksCheck.js +6 -6
  32. package/lib/checks/impl/CorsAllowlistCheck.js +3 -3
  33. package/lib/checks/impl/CustomLabelsCredentialCheck.d.ts +1 -1
  34. package/lib/checks/impl/CustomLabelsCredentialCheck.js +7 -7
  35. package/lib/checks/impl/DataClassificationCheck.js +6 -6
  36. package/lib/checks/impl/DataExportAccessCheck.d.ts +19 -0
  37. package/lib/checks/impl/DataExportAccessCheck.js +79 -0
  38. package/lib/checks/impl/DebugLogAccessCheck.js +6 -6
  39. package/lib/checks/impl/DeploymentIdentityCheck.js +8 -8
  40. package/lib/checks/impl/EmailSecurityCheck.d.ts +10 -0
  41. package/lib/checks/impl/EmailSecurityCheck.js +117 -0
  42. package/lib/checks/impl/EncryptionCoverageCheck.d.ts +19 -0
  43. package/lib/checks/impl/EncryptionCoverageCheck.js +108 -0
  44. package/lib/checks/impl/EnhancedDomainsCheck.d.ts +1 -1
  45. package/lib/checks/impl/EnhancedDomainsCheck.js +6 -6
  46. package/lib/checks/impl/EscalationPermsCheck.js +2 -2
  47. package/lib/checks/impl/EventMonitoringCheck.js +14 -11
  48. package/lib/checks/impl/ExperienceCloudSiteCheck.js +3 -3
  49. package/lib/checks/impl/ExperienceCspCheck.d.ts +18 -0
  50. package/lib/checks/impl/ExperienceCspCheck.js +57 -0
  51. package/lib/checks/impl/ExternalCredentialsCheck.d.ts +17 -0
  52. package/lib/checks/impl/ExternalCredentialsCheck.js +74 -0
  53. package/lib/checks/impl/FailedLoginCheck.js +5 -5
  54. package/lib/checks/impl/FieldHistoryTrackingCheck.js +3 -3
  55. package/lib/checks/impl/FieldLevelSecurityCheck.js +2 -2
  56. package/lib/checks/impl/GuestApiAccessCheck.d.ts +19 -0
  57. package/lib/checks/impl/GuestApiAccessCheck.js +113 -0
  58. package/lib/checks/impl/GuestExecutableApexCheck.d.ts +1 -1
  59. package/lib/checks/impl/GuestExecutableApexCheck.js +5 -5
  60. package/lib/checks/impl/GuestObjectExposureCheck.d.ts +44 -0
  61. package/lib/checks/impl/GuestObjectExposureCheck.js +241 -0
  62. package/lib/checks/impl/GuestRecordAccessPolicyCheck.d.ts +34 -0
  63. package/lib/checks/impl/GuestRecordAccessPolicyCheck.js +120 -0
  64. package/lib/checks/impl/GuestSiteOptionsCheck.d.ts +18 -0
  65. package/lib/checks/impl/GuestSiteOptionsCheck.js +92 -0
  66. package/lib/checks/impl/GuestTrafficAnomalyCheck.d.ts +23 -0
  67. package/lib/checks/impl/GuestTrafficAnomalyCheck.js +343 -0
  68. package/lib/checks/impl/GuestUserAccessCheck.js +5 -5
  69. package/lib/checks/impl/HealthCheckCheck.js +2 -2
  70. package/lib/checks/impl/HighAssuranceSessionCheck.js +4 -4
  71. package/lib/checks/impl/InstalledPackagesCheck.js +5 -5
  72. package/lib/checks/impl/IntegrationUsersCheck.js +5 -5
  73. package/lib/checks/impl/InternalUserMfaCheck.js +2 -2
  74. package/lib/checks/impl/IpRestrictionsCheck.js +3 -3
  75. package/lib/checks/impl/LegacyApiVersionCheck.js +1 -1
  76. package/lib/checks/impl/LoginAccessPolicyCheck.d.ts +26 -0
  77. package/lib/checks/impl/LoginAccessPolicyCheck.js +117 -0
  78. package/lib/checks/impl/LoginAnomalyCheck.d.ts +17 -0
  79. package/lib/checks/impl/LoginAnomalyCheck.js +98 -0
  80. package/lib/checks/impl/MfaEnforcementCheck.js +3 -3
  81. package/lib/checks/impl/MfaMethodStrengthCheck.js +3 -3
  82. package/lib/checks/impl/MfaRegistrationCheck.js +2 -2
  83. package/lib/checks/impl/MyDomainLoginPolicyCheck.d.ts +1 -1
  84. package/lib/checks/impl/MyDomainLoginPolicyCheck.js +9 -9
  85. package/lib/checks/impl/NamedCredentialsCheck.js +3 -3
  86. package/lib/checks/impl/OutboundMessagesCheck.d.ts +10 -0
  87. package/lib/checks/impl/OutboundMessagesCheck.js +88 -0
  88. package/lib/checks/impl/PasswordSessionPolicyCheck.js +3 -3
  89. package/lib/checks/impl/PermissionsCheck.js +3 -3
  90. package/lib/checks/impl/PrivilegedAccessCheck.d.ts +11 -0
  91. package/lib/checks/impl/PrivilegedAccessCheck.js +111 -0
  92. package/lib/checks/impl/PublicContentExposureCheck.d.ts +10 -0
  93. package/lib/checks/impl/PublicContentExposureCheck.js +98 -0
  94. package/lib/checks/impl/PublicGroupSharingCheck.js +1 -1
  95. package/lib/checks/impl/ReleaseUpdatesCheck.js +2 -2
  96. package/lib/checks/impl/RemoteSitesCheck.js +1 -1
  97. package/lib/checks/impl/ReportFolderAccessCheck.d.ts +1 -1
  98. package/lib/checks/impl/ReportFolderAccessCheck.js +4 -4
  99. package/lib/checks/impl/SandboxDataMaskingCheck.d.ts +17 -0
  100. package/lib/checks/impl/SandboxDataMaskingCheck.js +85 -0
  101. package/lib/checks/impl/ScheduledApexCheck.js +1 -1
  102. package/lib/checks/impl/SeparationOfDutiesCheck.d.ts +11 -0
  103. package/lib/checks/impl/SeparationOfDutiesCheck.js +114 -0
  104. package/lib/checks/impl/SessionHardeningCheck.d.ts +21 -0
  105. package/lib/checks/impl/SessionHardeningCheck.js +134 -0
  106. package/lib/checks/impl/SharingModelCheck.d.ts +1 -1
  107. package/lib/checks/impl/SharingModelCheck.js +8 -8
  108. package/lib/checks/impl/SiemIntegrationCheck.js +4 -4
  109. package/lib/checks/impl/SsoEnforcementCheck.js +5 -5
  110. package/lib/checks/impl/StandardProfilesCheck.js +2 -2
  111. package/lib/checks/impl/ThreatDetectionCheck.d.ts +17 -0
  112. package/lib/checks/impl/ThreatDetectionCheck.js +91 -0
  113. package/lib/checks/impl/TransactionSecurityPolicyCheck.js +2 -2
  114. package/lib/checks/impl/TrustedIPRangesCheck.js +5 -5
  115. package/lib/checks/impl/VisualforceXssCheck.js +6 -6
  116. package/lib/checks/permCatalog.d.ts +15 -0
  117. package/lib/checks/permCatalog.js +42 -0
  118. package/lib/checks/registry.js +45 -0
  119. package/lib/commands/audit/diff.js +9 -5
  120. package/lib/commands/audit/events/pull.d.ts +17 -0
  121. package/lib/commands/audit/events/pull.js +88 -0
  122. package/lib/commands/audit/security.d.ts +4 -0
  123. package/lib/commands/audit/security.js +41 -17
  124. package/lib/compliance/mapping.js +34 -7
  125. package/lib/context/AuditCache.d.ts +12 -0
  126. package/lib/context/AuditContext.d.ts +2 -0
  127. package/lib/events/EventBaselineStore.d.ts +16 -0
  128. package/lib/events/EventBaselineStore.js +55 -0
  129. package/lib/events/eventLogQuery.d.ts +21 -0
  130. package/lib/events/eventLogQuery.js +34 -0
  131. package/lib/events/pullEventLogs.d.ts +51 -0
  132. package/lib/events/pullEventLogs.js +79 -0
  133. package/lib/findings/CheckMeta.js +24 -3
  134. package/lib/lib/wire.d.ts +2 -0
  135. package/lib/lib/wire.js +3 -0
  136. package/lib/renderers/ClientReportRenderer.js +4 -4
  137. package/lib/renderers/DiffHtmlRenderer.js +1 -1
  138. package/lib/renderers/HistoryRenderer.js +1 -1
  139. package/lib/renderers/HtmlRenderer.js +3 -3
  140. package/lib/renderers/MarkdownRenderer.js +2 -2
  141. package/messages/audit.security.md +30 -2
  142. package/package.json +14 -2
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Flags two Experience Cloud Network settings that widen the unauthenticated
3
+ * guest surface and are not covered by the self-registration / guest-user checks:
4
+ * - OptionsGuestFileAccessEnabled: guests can access public files (ContentVersion/
5
+ * Attachment), enabling file enumeration and download.
6
+ * - OptionsGuestMemberVisibility: guests can see other site members (User records),
7
+ * leaking member identities to unauthenticated visitors.
8
+ */
9
+ export class GuestSiteOptionsCheck {
10
+ id = 'guest-site-options';
11
+ name = 'Experience Cloud Guest Site Options';
12
+ category = 'Access Control';
13
+ description = 'Checks Experience Cloud sites for guest file access and guest member visibility, which expose files and member identities to unauthenticated visitors';
14
+ async run(ctx) {
15
+ const findings = [];
16
+ const baseUrl = ctx.orgInfo.instanceUrl;
17
+ const setupUrl = `${baseUrl}/lightning/setup/SetupNetworks/home`;
18
+ let networks;
19
+ try {
20
+ networks = await ctx.soql.queryAll(`SELECT Id, Name, Status, OptionsGuestFileAccessEnabled, OptionsGuestMemberVisibility FROM Network`);
21
+ }
22
+ catch {
23
+ findings.push({
24
+ id: 'guest-site-options-inaccessible',
25
+ category: this.category,
26
+ riskLevel: 'INFO',
27
+ inconclusive: true,
28
+ title: 'Experience Cloud site options could not be queried (insufficient access)',
29
+ detail: 'The Network query was not accessible. This may indicate no Experience Cloud licence or missing setup access.',
30
+ remediation: 'Grant the audit user View Setup and Configuration and re-run. If no Experience Cloud sites exist, this check is not applicable.',
31
+ });
32
+ return { findings };
33
+ }
34
+ if (networks.length === 0) {
35
+ findings.push({
36
+ id: 'guest-site-options-none',
37
+ category: this.category,
38
+ riskLevel: 'LOW',
39
+ passed: true,
40
+ title: 'No Experience Cloud sites found',
41
+ detail: 'No Experience Cloud (Network) sites are configured, so guest file access and member visibility are not a concern.',
42
+ remediation: 'If sites are added later, keep guest file access and member visibility disabled unless explicitly required.',
43
+ });
44
+ return { findings };
45
+ }
46
+ const fileSites = networks.filter((n) => n.OptionsGuestFileAccessEnabled);
47
+ const memberSites = networks.filter((n) => n.OptionsGuestMemberVisibility);
48
+ if (fileSites.length > 0) {
49
+ findings.push({
50
+ id: 'guest-site-options-file-access',
51
+ category: this.category,
52
+ riskLevel: 'HIGH',
53
+ title: `${fileSites.length} site(s) allow guest users to access files`,
54
+ detail: 'Guest file access lets unauthenticated visitors read public files (ContentVersion/ContentDocument/Attachment). Combined with the UI API, file IDs can be enumerated and content downloaded via the file servlet (/sfc/servlet.shepherd/version/download).',
55
+ remediation: 'Disable guest file access (Network setting "Let guest users access public files") unless a specific public file library is intended.',
56
+ affectedItems: fileSites.map((n) => ({
57
+ label: n.Name,
58
+ url: setupUrl,
59
+ note: `Status: ${n.Status}; guest file access enabled`,
60
+ })),
61
+ });
62
+ }
63
+ if (memberSites.length > 0) {
64
+ findings.push({
65
+ id: 'guest-site-options-member-visibility',
66
+ category: this.category,
67
+ riskLevel: 'MEDIUM',
68
+ title: `${memberSites.length} site(s) let guest users see other members`,
69
+ detail: 'Guest member visibility exposes other site members (User records, names, profile data) to unauthenticated visitors, leaking member identities and enabling enumeration.',
70
+ remediation: 'Disable "Let guest users see other members of this site" unless member directories must be public.',
71
+ affectedItems: memberSites.map((n) => ({
72
+ label: n.Name,
73
+ url: setupUrl,
74
+ note: `Status: ${n.Status}; guest member visibility enabled`,
75
+ })),
76
+ });
77
+ }
78
+ if (fileSites.length === 0 && memberSites.length === 0) {
79
+ findings.push({
80
+ id: 'guest-site-options-ok',
81
+ category: this.category,
82
+ riskLevel: 'LOW',
83
+ passed: true,
84
+ title: `${networks.length} Experience Cloud site(s): guest file access and member visibility disabled`,
85
+ detail: 'No site exposes files or member identities to guest users via these settings.',
86
+ remediation: 'Keep guest file access and member visibility disabled as sites are updated.',
87
+ });
88
+ }
89
+ return { findings };
90
+ }
91
+ }
92
+ //# sourceMappingURL=GuestSiteOptionsCheck.js.map
@@ -0,0 +1,23 @@
1
+ import type { AuditContext } from '../../context/AuditContext.js';
2
+ import type { SecurityCheck, CheckResult } from '../SecurityCheck.js';
3
+ export declare class GuestTrafficAnomalyCheck implements SecurityCheck {
4
+ readonly id = "guest-traffic-anomaly";
5
+ readonly name = "Guest Traffic Anomaly";
6
+ readonly category = "Threat Detection";
7
+ readonly description = "Scans recent EventLogFile guest requests for anonymizer/hosting source IPs, single-IP bursts, and GraphQL totalCount reconnaissance sweeps";
8
+ readonly dependsOnCache: readonly ["eventLogSummary"];
9
+ run(ctx: AuditContext): Promise<CheckResult>;
10
+ /** Parse an EventLogFile CSV, pushing guest-attributed rows into `out`. */
11
+ private parseGuestRows;
12
+ /** Minimal RFC-4180-ish CSV parser (handles quoted fields and embedded commas/quotes). */
13
+ private parseCsv;
14
+ private isHostingOrAnonymizer;
15
+ /** Object name from a UI-API GraphQL body: `uiapi { query { <Entity> ... } }`. */
16
+ private extractEntity;
17
+ private inconclusive;
18
+ /** Blind spot: EventLogFile unreadable — distinguishes "not enabled" from "no permission". */
19
+ private accessBlind;
20
+ /** Event Monitoring readable, but no guest blobs in the (short) retention window. */
21
+ private noLogs;
22
+ }
23
+ //# sourceMappingURL=GuestTrafficAnomalyCheck.d.ts.map
@@ -0,0 +1,343 @@
1
+ import { classifyEventLogAccessError } from '../eventLogAccess.js';
2
+ // EventLogFile types that carry unauthenticated guest request traffic. Sites is
3
+ // the primary guest-page channel; AuraRequest and GraphQlQueryExecution are the
4
+ // data-access vectors abused for recon and bulk read.
5
+ const GUEST_EVENT_TYPES = ['Sites', 'AuraRequest', 'GraphQlQueryExecution'];
6
+ // Illustrative seed of publicly-documented datacenter/hosting network prefixes.
7
+ // NON-EXHAUSTIVE and heuristic — this is a starting example, NOT a curated threat
8
+ // feed. Replace/extend it from your own IP-reputation source. The rationale:
9
+ // legitimate portal visitors browse from consumer ISPs, so guest *data* access
10
+ // from datacenter/VPN egress is a useful abuse signal. Matched by string prefix
11
+ // on CLIENT_IP. (Ranges below are well-known cloud provider blocks.)
12
+ const HOSTING_ANONYMIZER_PREFIXES = [
13
+ '2604:a880:', // DigitalOcean (IPv6)
14
+ '137.184.', // DigitalOcean
15
+ '146.190.', // DigitalOcean
16
+ '159.223.', // DigitalOcean
17
+ '165.227.', // DigitalOcean
18
+ ];
19
+ const MAX_FILES = 20; // cap blobs downloaded per run
20
+ const MAX_FILE_BYTES = 60 * 1024 * 1024; // skip individual blobs larger than this
21
+ const BURST_THRESHOLD = 100; // guest requests from a single IP in the window
22
+ const RECON_DISTINCT_ENTITIES = 5; // distinct objects totalCount-probed from one IP
23
+ export class GuestTrafficAnomalyCheck {
24
+ id = 'guest-traffic-anomaly';
25
+ name = 'Guest Traffic Anomaly';
26
+ category = 'Threat Detection';
27
+ description = 'Scans recent EventLogFile guest requests for anonymizer/hosting source IPs, single-IP bursts, and GraphQL totalCount reconnaissance sweeps';
28
+ // Reuse EventMonitoringCheck's EventLogFile probe (enabled? readable?) instead of re-querying.
29
+ dependsOnCache = ['eventLogSummary'];
30
+ async run(ctx) {
31
+ const findings = [];
32
+ const setupUrl = `${ctx.orgInfo.instanceUrl}/lightning/setup/EventLogFile/home`;
33
+ // Guest user ids — needed to attribute EventLogFile rows to guests.
34
+ let guests;
35
+ try {
36
+ guests = await ctx.soql.queryAll("SELECT Id FROM User WHERE UserType = 'Guest' AND IsActive = true");
37
+ }
38
+ catch {
39
+ findings.push(this.inconclusive('guest-traffic-anomaly-users-inaccessible', 'Guest users could not be queried'));
40
+ return { findings };
41
+ }
42
+ if (guests.length === 0) {
43
+ findings.push({
44
+ id: 'guest-traffic-anomaly-none',
45
+ category: this.category,
46
+ riskLevel: 'LOW',
47
+ passed: true,
48
+ title: 'No active guest users',
49
+ detail: 'There are no active guest users, so there is no guest request traffic to analyze.',
50
+ remediation: 'If a public site is added later, re-run to baseline guest traffic.',
51
+ });
52
+ return { findings };
53
+ }
54
+ // EventLogFile stores the 15- or 18-char id; compare on the 15-char prefix.
55
+ const guestIds = new Set(guests.map((g) => g.Id.slice(0, 15)));
56
+ // Reuse EventMonitoringCheck's cached EventLogFile probe (no extra API call):
57
+ // decide whether it is even worth downloading blobs, and phrase the blind spot
58
+ // precisely when Event Monitoring is off or the audit user can't read the logs.
59
+ const summary = ctx.cache.eventLogSummary;
60
+ if (summary && summary.accessible === false) {
61
+ findings.push(this.accessBlind(summary.accessError ?? 'unknown', setupUrl));
62
+ return { findings };
63
+ }
64
+ if (summary && summary.accessible === true) {
65
+ if (summary.totalFiles === 0) {
66
+ findings.push(this.noLogs('Event Monitoring is enabled but produced no EventLogFile blobs in the retention window.', setupUrl));
67
+ return { findings };
68
+ }
69
+ if (!summary.eventTypes.some((t) => GUEST_EVENT_TYPES.includes(t))) {
70
+ findings.push({
71
+ id: 'guest-traffic-anomaly-clean',
72
+ category: this.category,
73
+ riskLevel: 'LOW',
74
+ passed: true,
75
+ title: 'No guest request event types captured by Event Monitoring',
76
+ detail: `Event Monitoring is active but captured none of ${GUEST_EVENT_TYPES.join('/')} recently, so there is no guest request traffic to analyze.`,
77
+ remediation: 'Confirm the guest-facing site is live and that Sites/AuraRequest/GraphQlQueryExecution event types are captured.',
78
+ });
79
+ return { findings };
80
+ }
81
+ }
82
+ // Which guest event-log blobs exist in the retention window.
83
+ let files;
84
+ try {
85
+ const inList = GUEST_EVENT_TYPES.map((t) => `'${t}'`).join(', ');
86
+ files = await ctx.soql.queryAll(`SELECT Id, EventType, LogDate, LogFileLength FROM EventLogFile
87
+ WHERE EventType IN (${inList}) AND LogDate = LAST_N_DAYS:2 AND Interval = 'Daily'
88
+ ORDER BY LogDate DESC`);
89
+ }
90
+ catch (e) {
91
+ // Standalone path (EventMonitoringCheck not in this run): classify the failure
92
+ // so "is Event Monitoring enabled / does the user have permission?" is still answered.
93
+ findings.push(this.accessBlind(classifyEventLogAccessError(e), setupUrl));
94
+ return { findings };
95
+ }
96
+ if (files.length === 0) {
97
+ findings.push(this.noLogs('No Sites/AuraRequest/GraphQlQueryExecution EventLogFile blobs were found in the last 2 days. Without Event Monitoring, retention is ~1 day, so absence here is BLIND, not proof of no abuse.', setupUrl));
98
+ return { findings };
99
+ }
100
+ // Download + parse blobs (bounded), keeping only guest rows.
101
+ const reqs = [];
102
+ let parsedFiles = 0;
103
+ for (const f of files.slice(0, MAX_FILES)) {
104
+ if (f.LogFileLength > MAX_FILE_BYTES)
105
+ continue;
106
+ let csv;
107
+ try {
108
+ csv = await ctx.rest.get(`/sobjects/EventLogFile/${f.Id}/LogFile`);
109
+ }
110
+ catch {
111
+ continue;
112
+ }
113
+ if (typeof csv !== 'string' || csv.length === 0)
114
+ continue;
115
+ parsedFiles++;
116
+ this.parseGuestRows(csv, f.EventType, guestIds, reqs);
117
+ }
118
+ if (parsedFiles === 0) {
119
+ findings.push(this.inconclusive('guest-traffic-anomaly-blobs-unreadable', 'Guest event-log blobs could not be downloaded'));
120
+ return { findings };
121
+ }
122
+ if (reqs.length === 0) {
123
+ findings.push({
124
+ id: 'guest-traffic-anomaly-clean',
125
+ category: this.category,
126
+ riskLevel: 'LOW',
127
+ passed: true,
128
+ title: `No guest requests in ${parsedFiles} event-log file(s)`,
129
+ detail: 'The available guest event logs contained no rows attributable to an active guest user in the window.',
130
+ remediation: 'Continue forwarding guest event logs to a SIEM for anomaly alerting.',
131
+ });
132
+ return { findings };
133
+ }
134
+ // --- Aggregate per source IP ------------------------------------------------
135
+ const byIp = new Map();
136
+ for (const r of reqs) {
137
+ if (!r.ip)
138
+ continue;
139
+ const agg = byIp.get(r.ip) ?? { total: 0, reconEntities: new Set(), anonymizer: this.isHostingOrAnonymizer(r.ip) };
140
+ agg.total++;
141
+ if (r.eventType === 'GraphQlQueryExecution' && /totalcount/i.test(r.query)) {
142
+ const entity = this.extractEntity(r.query);
143
+ if (entity)
144
+ agg.reconEntities.add(entity);
145
+ }
146
+ byIp.set(r.ip, agg);
147
+ }
148
+ const reconIps = [...byIp.entries()].filter(([, a]) => a.reconEntities.size >= RECON_DISTINCT_ENTITIES);
149
+ const anonymizerIps = [...byIp.entries()].filter(([, a]) => a.anonymizer);
150
+ const burstIps = [...byIp.entries()].filter(([, a]) => a.total >= BURST_THRESHOLD);
151
+ if (reconIps.length > 0) {
152
+ findings.push({
153
+ id: 'guest-traffic-anomaly-recon',
154
+ category: this.category,
155
+ riskLevel: 'HIGH',
156
+ title: `${reconIps.length} source IP(s) ran a GraphQL object-enumeration (totalCount) sweep as a guest`,
157
+ detail: 'These unauthenticated source IPs issued GraphQL queries that request only totalCount across many distinct objects — the signature of reconnaissance that maps the guest-readable data surface before bulk extraction. This is exactly the pre-attack recon pattern seen through aura://RecordUiController/ACTION$executeGraphQL on Experience Cloud sites.',
158
+ remediation: 'Treat these IPs as hostile and block them at the WAF/CDN. Then close the surface they were mapping: set external OWD to Private, strip guest object read permissions, and enforce "Secure guest user record access". Enable Threat Detection storage and a Transaction Security Policy to catch this in real time.',
159
+ affectedItems: reconIps
160
+ .sort((a, b) => b[1].reconEntities.size - a[1].reconEntities.size)
161
+ .slice(0, 20)
162
+ .map(([ip, a]) => ({
163
+ label: `${ip} — probed ${a.reconEntities.size} objects (${a.total} requests)`,
164
+ note: [...a.reconEntities].slice(0, 12).join(', ') + (a.anonymizer ? ' [hosting/anonymizer IP]' : ''),
165
+ })),
166
+ });
167
+ }
168
+ if (anonymizerIps.length > 0) {
169
+ findings.push({
170
+ id: 'guest-traffic-anomaly-anonymizer',
171
+ category: this.category,
172
+ riskLevel: 'HIGH',
173
+ title: `${anonymizerIps.length} guest source IP(s) originate from hosting/anonymizer ranges`,
174
+ detail: 'Guest (unauthenticated) requests arrived from datacenter/VPN/anonymizer egress ranges. Legitimate portal visitors browse from consumer ISPs; automated scraping and exfiltration typically egress from hosting or VPN infrastructure. (The prefix list is a heuristic seed — corroborate against a full IP-reputation feed.)',
175
+ remediation: 'Correlate these IPs with what they accessed, block hostile ranges at the WAF/CDN, and consider geo/ASN restrictions for a geographically-bounded audience. Feed a maintained IP-reputation list into your SIEM alerting.',
176
+ affectedItems: anonymizerIps
177
+ .sort((a, b) => b[1].total - a[1].total)
178
+ .slice(0, 20)
179
+ .map(([ip, a]) => ({ label: `${ip} — ${a.total} guest request(s)`, note: a.reconEntities.size ? `also probed ${a.reconEntities.size} objects` : undefined })),
180
+ });
181
+ }
182
+ if (burstIps.length > 0) {
183
+ findings.push({
184
+ id: 'guest-traffic-anomaly-burst',
185
+ category: this.category,
186
+ riskLevel: 'MEDIUM',
187
+ title: `${burstIps.length} source IP(s) generated high-volume guest request bursts`,
188
+ detail: `A single source IP issued ${BURST_THRESHOLD}+ guest requests in the window, consistent with automated hammering (page/Aura endpoint flooding) rather than human browsing.`,
189
+ remediation: 'Rate-limit the Sites/Aura endpoints at the WAF/CDN and review whether these bursts correspond to scraping or a denial-of-service attempt.',
190
+ affectedItems: burstIps
191
+ .sort((a, b) => b[1].total - a[1].total)
192
+ .slice(0, 20)
193
+ .map(([ip, a]) => ({ label: `${ip} — ${a.total} guest request(s)`, note: a.anonymizer ? 'hosting/anonymizer IP' : undefined })),
194
+ });
195
+ }
196
+ if (findings.length === 0) {
197
+ findings.push({
198
+ id: 'guest-traffic-anomaly-clean',
199
+ category: this.category,
200
+ riskLevel: 'LOW',
201
+ passed: true,
202
+ title: `No anomalous guest traffic in ${reqs.length} request(s)`,
203
+ detail: `Analyzed ${reqs.length} guest request(s) across ${parsedFiles} event-log file(s): no hosting/anonymizer IPs, no totalCount recon sweeps, and no single-IP bursts above ${BURST_THRESHOLD}.`,
204
+ remediation: 'Continue forwarding guest event logs to a SIEM; EventLogFile retention is short (~1–30 days), so durable alerting must live outside the org.',
205
+ });
206
+ }
207
+ return { findings };
208
+ }
209
+ /** Parse an EventLogFile CSV, pushing guest-attributed rows into `out`. */
210
+ parseGuestRows(csv, eventType, guestIds, out) {
211
+ const rows = this.parseCsv(csv);
212
+ if (rows.length < 2)
213
+ return;
214
+ const header = rows[0];
215
+ const idx = (names) => names.map((n) => header.indexOf(n)).find((i) => i >= 0) ?? -1;
216
+ const iUser = idx(['USER_ID_DERIVED', 'USER_ID']);
217
+ const iIp = idx(['CLIENT_IP', 'SOURCE_IP']);
218
+ const iQuery = idx(['QUERY', 'SOQL_QUERY']);
219
+ if (iUser < 0)
220
+ return; // cannot attribute to a guest
221
+ for (let r = 1; r < rows.length; r++) {
222
+ const row = rows[r];
223
+ const uid = (row[iUser] ?? '').slice(0, 15);
224
+ if (!guestIds.has(uid))
225
+ continue;
226
+ out.push({
227
+ ip: iIp >= 0 ? row[iIp] ?? '' : '',
228
+ eventType,
229
+ query: iQuery >= 0 ? row[iQuery] ?? '' : '',
230
+ });
231
+ }
232
+ }
233
+ /** Minimal RFC-4180-ish CSV parser (handles quoted fields and embedded commas/quotes). */
234
+ parseCsv(text) {
235
+ const rows = [];
236
+ let field = '';
237
+ let row = [];
238
+ let inQuotes = false;
239
+ for (let i = 0; i < text.length; i++) {
240
+ const c = text[i];
241
+ if (inQuotes) {
242
+ if (c === '"') {
243
+ if (text[i + 1] === '"') {
244
+ field += '"';
245
+ i++;
246
+ }
247
+ else
248
+ inQuotes = false;
249
+ }
250
+ else
251
+ field += c;
252
+ }
253
+ else if (c === '"') {
254
+ inQuotes = true;
255
+ }
256
+ else if (c === ',') {
257
+ row.push(field);
258
+ field = '';
259
+ }
260
+ else if (c === '\n' || c === '\r') {
261
+ if (c === '\r' && text[i + 1] === '\n')
262
+ i++;
263
+ row.push(field);
264
+ field = '';
265
+ if (row.length > 1 || row[0] !== '')
266
+ rows.push(row);
267
+ row = [];
268
+ }
269
+ else
270
+ field += c;
271
+ }
272
+ if (field !== '' || row.length > 0) {
273
+ row.push(field);
274
+ rows.push(row);
275
+ }
276
+ return rows;
277
+ }
278
+ isHostingOrAnonymizer(ip) {
279
+ return HOSTING_ANONYMIZER_PREFIXES.some((p) => ip.startsWith(p));
280
+ }
281
+ /** Object name from a UI-API GraphQL body: `uiapi { query { <Entity> ... } }`. */
282
+ extractEntity(query) {
283
+ const m = query.match(/uiapi\s*\{\s*query\s*\{\s*(\w+)/i);
284
+ return m ? m[1] : null;
285
+ }
286
+ inconclusive(id, what) {
287
+ return {
288
+ id,
289
+ category: this.category,
290
+ riskLevel: 'INFO',
291
+ inconclusive: true,
292
+ title: `${what} (insufficient access)`,
293
+ detail: 'The audit user could not gather guest request logs. This may indicate Event Monitoring is not licensed or the audit user lacks "View Event Log Files".',
294
+ remediation: 'Grant "View Event Log Files" and ensure Event Monitoring is enabled, then re-run.',
295
+ };
296
+ }
297
+ /** Blind spot: EventLogFile unreadable — distinguishes "not enabled" from "no permission". */
298
+ accessBlind(reason, setupUrl) {
299
+ const base = {
300
+ id: 'guest-traffic-anomaly-inaccessible',
301
+ category: this.category,
302
+ riskLevel: 'INFO',
303
+ inconclusive: true,
304
+ affectedItems: [{ label: 'Event Monitoring', url: setupUrl }],
305
+ };
306
+ if (reason === 'not-enabled') {
307
+ return {
308
+ ...base,
309
+ title: 'Event Monitoring not enabled — guest traffic cannot be analyzed (BLIND)',
310
+ detail: 'EventLogFile is not accessible because Event Monitoring is not licensed/enabled in this org, so no guest request logs are captured. Anonymizer-IP, burst, and recon analysis cannot run — this is a blind spot, not an all-clear.',
311
+ remediation: 'License and enable Event Monitoring (Setup → Event Monitoring Settings), then forward guest event logs to a SIEM for durable retention and alerting.',
312
+ };
313
+ }
314
+ if (reason === 'no-permission') {
315
+ return {
316
+ ...base,
317
+ title: 'Audit user lacks "View Event Log Files" — guest traffic cannot be analyzed (BLIND)',
318
+ detail: 'Event Monitoring appears enabled, but the running audit user cannot read EventLogFile (missing the "View Event Log Files" permission). Guest request logs exist but are unreadable to this user, so the result is blind, not clean.',
319
+ remediation: 'Grant the audit user the "View Event Log Files" permission (plus "API Enabled"), then re-run.',
320
+ };
321
+ }
322
+ return {
323
+ ...base,
324
+ title: 'Guest request logs could not be read — analysis skipped (BLIND)',
325
+ detail: 'EventLogFile could not be queried, and the cause could not be attributed to a missing licence or a missing permission. The result is blind, not clean.',
326
+ remediation: 'Verify Event Monitoring is enabled and the audit user holds "View Event Log Files", then re-run.',
327
+ };
328
+ }
329
+ /** Event Monitoring readable, but no guest blobs in the (short) retention window. */
330
+ noLogs(detail, setupUrl) {
331
+ return {
332
+ id: 'guest-traffic-anomaly-no-logs',
333
+ category: this.category,
334
+ riskLevel: 'LOW',
335
+ passed: true,
336
+ title: 'No guest event logs in the retention window',
337
+ detail: `${detail} Stream logs to a SIEM for durable coverage.`,
338
+ remediation: 'Enable Event Monitoring and forward guest event logs to a SIEM so this analysis has a durable window.',
339
+ affectedItems: [{ label: 'Event Monitoring', url: setupUrl }],
340
+ };
341
+ }
342
+ }
343
+ //# sourceMappingURL=GuestTrafficAnomalyCheck.js.map
@@ -104,9 +104,9 @@ export class GuestUserAccessCheck {
104
104
  .filter(Boolean)
105
105
  .join('/');
106
106
  return {
107
- label: `${v.username} — ${v.sobjectType}`,
107
+ label: `${v.username}: ${v.sobjectType}`,
108
108
  url: `${baseUrl}/${v.userId}`,
109
- note: `Can ${actions} — remove immediately`,
109
+ note: `Can ${actions}: remove immediately`,
110
110
  };
111
111
  }),
112
112
  detail: 'Unauthenticated users (guests) with write access to standard objects represents a critical misconfiguration. SBS-CPORTAL-002 requires guest users have no access to business objects.',
@@ -121,9 +121,9 @@ export class GuestUserAccessCheck {
121
121
  riskLevel: 'HIGH',
122
122
  title: `${readViolations.length} object(s) grant read access to guest user(s)`,
123
123
  affectedItems: readViolations.map((v) => ({
124
- label: `${v.username} — ${v.sobjectType}`,
124
+ label: `${v.username}: ${v.sobjectType}`,
125
125
  url: `${baseUrl}/${v.userId}`,
126
- note: 'Read access — remove from guest profile; restrict to authenticated users only',
126
+ note: 'Read access: remove from guest profile; restrict to authenticated users only',
127
127
  })),
128
128
  detail: 'SBS-CPORTAL-002 requires guest users be limited to authentication flows only with no access to business objects. Read access exposes data to unauthenticated visitors.',
129
129
  remediation: 'Remove Read permissions on all business objects from guest user profiles. Data access should only be granted after authentication.',
@@ -139,7 +139,7 @@ export class GuestUserAccessCheck {
139
139
  affectedItems: sharingExposures.map((e) => ({
140
140
  label: e.shareTable,
141
141
  url: `${baseUrl}/lightning/setup/SecuritySharing/page`,
142
- note: `${e.count} sharing rule(s) — review and remove guest-targeting rules`,
142
+ note: `${e.count} sharing rule(s): review and remove guest-targeting rules`,
143
143
  })),
144
144
  detail: 'Sharing rules targeting guest users can expose internal records to unauthenticated visitors.',
145
145
  remediation: 'Review and remove sharing rules that grant guest users access to Salesforce records. Use Experience Cloud sites with explicit data access controls instead.',
@@ -39,7 +39,7 @@ export class HealthCheckCheck {
39
39
  affectedItems: highRisks.map((r) => ({
40
40
  label: r.Setting,
41
41
  url: healthCheckUrl,
42
- note: `Current: ${r.OrgValue} — Recommended: ${r.StandardValue}`,
42
+ note: `Current: ${r.OrgValue}. Recommended: ${r.StandardValue}`,
43
43
  })),
44
44
  });
45
45
  }
@@ -60,7 +60,7 @@ export class HealthCheckCheck {
60
60
  affectedItems: mediumRisks.map((r) => ({
61
61
  label: r.Setting,
62
62
  url: healthCheckUrl,
63
- note: `Current: ${r.OrgValue} — Recommended: ${r.StandardValue}`,
63
+ note: `Current: ${r.OrgValue}. Recommended: ${r.StandardValue}`,
64
64
  })),
65
65
  });
66
66
  }
@@ -38,7 +38,7 @@ export class HighAssuranceSessionCheck {
38
38
  category: this.category,
39
39
  riskLevel: 'LOW',
40
40
  passed: true,
41
- title: 'No connected apps found — session policy check not applicable',
41
+ title: 'No connected apps found: session policy check not applicable',
42
42
  detail: 'No connected apps are configured in this org.',
43
43
  remediation: 'Continue monitoring as connected apps are added.',
44
44
  });
@@ -66,8 +66,8 @@ export class HighAssuranceSessionCheck {
66
66
  label: a.Name,
67
67
  url: setupUrl,
68
68
  note: a.SessionTimeout === null || a.SessionTimeout === 0
69
- ? 'No session timeout — sessions never expire'
70
- : `Session timeout: ${Math.round(a.SessionTimeout / 3600)}h — reduce to ≤2h`,
69
+ ? 'No session timeout: sessions never expire'
70
+ : `Session timeout: ${Math.round(a.SessionTimeout / 3600)}h, reduce to ≤2h`,
71
71
  })),
72
72
  });
73
73
  }
@@ -82,7 +82,7 @@ export class HighAssuranceSessionCheck {
82
82
  affectedItems: noTimeout.slice(0, 20).map((a) => ({
83
83
  label: a.Name,
84
84
  url: setupUrl,
85
- note: 'No session timeout — configure a timeout in Connected App policies',
85
+ note: 'No session timeout: configure a timeout in Connected App policies',
86
86
  })),
87
87
  });
88
88
  }
@@ -50,13 +50,13 @@ export class InstalledPackagesCheck {
50
50
  id: 'installed-packages-unmanaged',
51
51
  category: this.category,
52
52
  riskLevel: 'HIGH',
53
- title: `${unmanagedPackages.length} unmanaged package(s) installed — code is editable and bypasses AppExchange security review`,
53
+ title: `${unmanagedPackages.length} unmanaged package(s) installed: code is editable and bypasses AppExchange security review`,
54
54
  detail: 'Unmanaged packages contain Apex code, Visualforce pages, and other metadata that can be edited directly in the target org. Unlike managed packages, unmanaged packages are not subject to the Salesforce AppExchange security review process. Installed unmanaged code should be treated as untrusted third-party code and reviewed manually for data access, SOQL injection vulnerabilities, and hardcoded credentials.',
55
55
  remediation: 'Review the code in each unmanaged package. Remove any unmanaged packages that are no longer required. For required packages, conduct a manual security review of the included Apex code and ensure it follows Salesforce security best practices. Consider migrating functionality to managed packages or native platform features.',
56
56
  affectedItems: unmanagedPackages.map((p) => ({
57
57
  label: p.SubscriberPackage.Name,
58
58
  url: setupUrl,
59
- note: `no namespace — unmanaged — publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'} — version: ${versionString(p)}`,
59
+ note: `no namespace | unmanaged | publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'} | version: ${versionString(p)}`,
60
60
  })),
61
61
  });
62
62
  }
@@ -71,7 +71,7 @@ export class InstalledPackagesCheck {
71
71
  affectedItems: betaPackages.map((p) => ({
72
72
  label: p.SubscriberPackage.Name,
73
73
  url: setupUrl,
74
- note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'none'} — state: Beta — version: ${versionString(p)} — publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'}`,
74
+ note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'none'} | state: Beta | version: ${versionString(p)} | publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'}`,
75
75
  })),
76
76
  });
77
77
  }
@@ -79,13 +79,13 @@ export class InstalledPackagesCheck {
79
79
  id: 'installed-packages-inventory',
80
80
  category: this.category,
81
81
  riskLevel: 'INFO',
82
- title: `${packages.length} package(s) installed — full inventory`,
82
+ title: `${packages.length} package(s) installed: full inventory`,
83
83
  detail: `${packages.length} installed package(s) found. All installed packages should be reviewed periodically to confirm they are still required, up to date, and from trusted publishers. Packages with elevated data access permissions should be audited for field-level security and sharing configurations.`,
84
84
  remediation: 'Review the package inventory at least annually. Remove packages that are no longer in use. Ensure all packages are updated to their latest GA versions to receive security patches.',
85
85
  affectedItems: packages.map((p) => ({
86
86
  label: p.SubscriberPackage.Name,
87
87
  url: setupUrl,
88
- note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'no namespace — unmanaged'} — version: ${versionString(p)} — publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'} — state: ${p.SubscriberPackageVersion.ReleaseState}`,
88
+ note: `namespace: ${p.SubscriberPackage.NamespacePrefix ?? 'no namespace (unmanaged)'} | version: ${versionString(p)} | publisher: ${p.SubscriberPackageVersion.PublisherName ?? 'unknown'} | state: ${p.SubscriberPackageVersion.ReleaseState}`,
89
89
  })),
90
90
  });
91
91
  return { findings };
@@ -48,7 +48,7 @@ export class IntegrationUsersCheck {
48
48
  category: this.category,
49
49
  riskLevel: 'LOW',
50
50
  passed: true,
51
- title: 'No candidate non-human identities found — SBS-ACS-007',
51
+ title: 'No candidate non-human identities found: SBS-ACS-007',
52
52
  detail: 'SBS-ACS-007 requires all non-human identities to be inventoried and documented. No standard users matching common service account patterns (by username) or never-logged-in users were found.',
53
53
  remediation: 'As integration accounts are created, ensure they are documented with a named owner, stated purpose, and review date.',
54
54
  });
@@ -59,7 +59,7 @@ export class IntegrationUsersCheck {
59
59
  id: 'integration-users-inventory',
60
60
  category: this.category,
61
61
  riskLevel: 'INFO',
62
- title: `${candidates.length} candidate non-human identity/identities found — SBS-ACS-007`,
62
+ title: `${candidates.length} candidate non-human identity/identities found: SBS-ACS-007`,
63
63
  detail: 'SBS-ACS-007 requires all non-human identities (integration accounts, service users, automation users) to be inventoried and documented with a named owner, stated purpose, and review date. These users were identified by never having a UI login (and being more than 30 days old) or matching common service-account username patterns.',
64
64
  remediation: 'Verify that each listed user is a known, documented non-human identity. Any undocumented account should be reviewed and either documented or deactivated. Maintain a register of all integration identities with their owner and purpose.',
65
65
  affectedItems: candidates.map((u) => ({
@@ -92,13 +92,13 @@ export class IntegrationUsersCheck {
92
92
  id: 'integration-users-broad-permissions',
93
93
  category: this.category,
94
94
  riskLevel: modifyAll.length > 0 ? 'HIGH' : 'MEDIUM',
95
- title: `${broadPermUsers.length} service account(s) hold Modify All / View All Data — 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.`,
95
+ title: `${broadPermUsers.length} service account(s) hold Modify All / View All Data: SBS-ACS-008`,
96
+ detail: `SBS-ACS-008 requires non-human identities to hold only the minimum permissions necessary for their function. ${modifyAll.length} account(s) have "Modify All Data" and ${viewAll.length} have "View All Data". These are org-wide permissions exposing all records and should never be granted to integration accounts without explicit documented justification.`,
97
97
  remediation: `Replace broad data permissions with object- and field-specific permissions scoped to the integration's actual data needs. Use a dedicated permission set that grants only the objects and operations the integration requires.`,
98
98
  affectedItems: broadPermUsers.map((r) => ({
99
99
  label: r.Assignee.Username,
100
100
  url: `${baseUrl}/${r.Assignee.Id}`,
101
- note: `via: ${r.PermissionSet.Name} — ${r.PermissionSet.PermissionsModifyAllData ? 'Modify All Data' : 'View All Data'}`,
101
+ note: `via: ${r.PermissionSet.Name}: ${r.PermissionSet.PermissionsModifyAllData ? 'Modify All Data' : 'View All Data'}`,
102
102
  })),
103
103
  });
104
104
  }
@@ -67,12 +67,12 @@ export class InternalUserMfaCheck {
67
67
  category: this.category,
68
68
  riskLevel,
69
69
  title: `${usersWithoutMfa.length} of ${users.length} active internal user(s) lack explicit MFA enforcement permission`,
70
- detail: `${usersWithoutMfa.length} active standard users do not have the PermissionsMultiFactorForUiLogins permission assigned. Salesforce auto-enforced MFA at the system level in Spring 2023, but the explicit permission provides belt-and-suspenders assurance — 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.`,
70
+ detail: `${usersWithoutMfa.length} active standard users do not have the PermissionsMultiFactorForUiLogins permission assigned. Salesforce auto-enforced MFA at the system level in Spring 2023, but the explicit permission provides belt-and-suspenders assurance. Users without it rely solely on system-level enforcement, which can have edge cases in API-heavy or SSO-integrated environments. Users without the explicit permission should be reviewed to confirm they are subject to effective MFA controls.`,
71
71
  remediation: 'Assign the "Multi-Factor Authentication for User Interface Logins" permission to all internal standard users via their profile or a permission set. This ensures MFA is explicitly enforced regardless of system-level settings. Prioritise users with privileged access or access to sensitive data.',
72
72
  affectedItems: usersWithoutMfa.slice(0, 50).map((u) => ({
73
73
  label: u.Username,
74
74
  url: `${baseUrl}/${u.Id}`,
75
- note: `profile: ${u.Profile?.Name ?? 'unknown'} — last login: ${u.LastLoginDate ? new Date(u.LastLoginDate).toISOString().split('T')[0] : 'never'}`,
75
+ note: `profile: ${u.Profile?.Name ?? 'unknown'} | last login: ${u.LastLoginDate ? new Date(u.LastLoginDate).toISOString().split('T')[0] : 'never'}`,
76
76
  })),
77
77
  });
78
78
  return { findings };