@cclabsnz/sf-audit 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +228 -31
- package/lib/api/ToolingClientImpl.js +5 -2
- package/lib/chains/AttackChain.d.ts +20 -0
- package/lib/chains/AttackChain.js +2 -0
- package/lib/chains/Capability.d.ts +7 -0
- package/lib/chains/Capability.js +11 -0
- package/lib/chains/CapabilityRegistry.d.ts +18 -0
- package/lib/chains/CapabilityRegistry.js +53 -0
- package/lib/chains/ChainEngine.d.ts +13 -0
- package/lib/chains/ChainEngine.js +137 -0
- package/lib/chains/namedChains.d.ts +14 -0
- package/lib/chains/namedChains.js +99 -0
- package/lib/checks/CheckEngine.js +33 -5
- package/lib/checks/impl/AnonymousApexAuditCheck.d.ts +10 -0
- package/lib/checks/impl/AnonymousApexAuditCheck.js +106 -0
- package/lib/checks/impl/ApexCrudFLSCheck.d.ts +11 -0
- package/lib/checks/impl/ApexCrudFLSCheck.js +98 -0
- package/lib/checks/impl/ApexLoggingCheck.d.ts +11 -0
- package/lib/checks/impl/ApexLoggingCheck.js +124 -0
- package/lib/checks/impl/ApexRestEndpointCheck.d.ts +11 -0
- package/lib/checks/impl/ApexRestEndpointCheck.js +94 -0
- package/lib/checks/impl/ApexSharingCheck.js +29 -0
- package/lib/checks/impl/ApiClientPermissionCheck.d.ts +10 -0
- package/lib/checks/impl/ApiClientPermissionCheck.js +59 -0
- package/lib/checks/impl/AuditTrailCheck.js +29 -0
- package/lib/checks/impl/CertificateExpiryCheck.d.ts +10 -0
- package/lib/checks/impl/CertificateExpiryCheck.js +123 -0
- package/lib/checks/impl/CodeSecurityCheck.d.ts +2 -1
- package/lib/checks/impl/CodeSecurityCheck.js +46 -6
- package/lib/checks/impl/ConnectedAppInactivityCheck.d.ts +11 -0
- package/lib/checks/impl/ConnectedAppInactivityCheck.js +86 -0
- package/lib/checks/impl/ConnectedAppScopeCheck.d.ts +10 -0
- package/lib/checks/impl/ConnectedAppScopeCheck.js +125 -0
- package/lib/checks/impl/ConnectedAppsCheck.d.ts +1 -0
- package/lib/checks/impl/ConnectedAppsCheck.js +37 -2
- package/lib/checks/impl/ContentLinksCheck.d.ts +10 -0
- package/lib/checks/impl/ContentLinksCheck.js +115 -0
- package/lib/checks/impl/CorsAllowlistCheck.d.ts +10 -0
- package/lib/checks/impl/CorsAllowlistCheck.js +80 -0
- package/lib/checks/impl/CspTrustedSitesCheck.d.ts +10 -0
- package/lib/checks/impl/CspTrustedSitesCheck.js +55 -0
- package/lib/checks/impl/CustomLabelsCredentialCheck.d.ts +10 -0
- package/lib/checks/impl/CustomLabelsCredentialCheck.js +97 -0
- package/lib/checks/impl/DataClassificationCheck.d.ts +10 -0
- package/lib/checks/impl/DataClassificationCheck.js +112 -0
- package/lib/checks/impl/DebugLogAccessCheck.d.ts +10 -0
- package/lib/checks/impl/DebugLogAccessCheck.js +81 -0
- package/lib/checks/impl/DeploymentIdentityCheck.d.ts +11 -0
- package/lib/checks/impl/DeploymentIdentityCheck.js +144 -0
- package/lib/checks/impl/EnhancedDomainsCheck.d.ts +10 -0
- package/lib/checks/impl/EnhancedDomainsCheck.js +84 -0
- package/lib/checks/impl/EscalationPermsCheck.d.ts +10 -0
- package/lib/checks/impl/EscalationPermsCheck.js +77 -0
- package/lib/checks/impl/EventMonitoringCheck.d.ts +11 -0
- package/lib/checks/impl/EventMonitoringCheck.js +84 -0
- package/lib/checks/impl/ExperienceCloudSiteCheck.d.ts +10 -0
- package/lib/checks/impl/ExperienceCloudSiteCheck.js +91 -0
- package/lib/checks/impl/FailedLoginCheck.d.ts +10 -0
- package/lib/checks/impl/FailedLoginCheck.js +122 -0
- package/lib/checks/impl/FieldHistoryTrackingCheck.d.ts +10 -0
- package/lib/checks/impl/FieldHistoryTrackingCheck.js +70 -0
- package/lib/checks/impl/FieldLevelSecurityCheck.js +28 -18
- package/lib/checks/impl/GuestExecutableApexCheck.d.ts +11 -0
- package/lib/checks/impl/GuestExecutableApexCheck.js +93 -0
- package/lib/checks/impl/GuestUserAccessCheck.js +74 -66
- package/lib/checks/impl/HardcodedCredentialsCheck.js +2 -2
- package/lib/checks/impl/HighAssuranceSessionCheck.d.ts +10 -0
- package/lib/checks/impl/HighAssuranceSessionCheck.js +103 -0
- package/lib/checks/impl/InactiveUsersCheck.js +38 -19
- package/lib/checks/impl/InstalledPackagesCheck.d.ts +10 -0
- package/lib/checks/impl/InstalledPackagesCheck.js +94 -0
- package/lib/checks/impl/IntegrationUsersCheck.d.ts +10 -0
- package/lib/checks/impl/IntegrationUsersCheck.js +108 -0
- package/lib/checks/impl/InternalUserMfaCheck.d.ts +10 -0
- package/lib/checks/impl/InternalUserMfaCheck.js +81 -0
- package/lib/checks/impl/IpRestrictionsCheck.js +86 -23
- package/lib/checks/impl/LegacyApiVersionCheck.d.ts +10 -0
- package/lib/checks/impl/LegacyApiVersionCheck.js +91 -0
- package/lib/checks/impl/MfaEnforcementCheck.d.ts +10 -0
- package/lib/checks/impl/MfaEnforcementCheck.js +76 -0
- package/lib/checks/impl/MfaMethodStrengthCheck.d.ts +11 -0
- package/lib/checks/impl/MfaMethodStrengthCheck.js +116 -0
- package/lib/checks/impl/MfaRegistrationCheck.d.ts +11 -0
- package/lib/checks/impl/MfaRegistrationCheck.js +95 -0
- package/lib/checks/impl/MyDomainLoginPolicyCheck.d.ts +10 -0
- package/lib/checks/impl/MyDomainLoginPolicyCheck.js +105 -0
- package/lib/checks/impl/NamedCredentialsCheck.js +37 -2
- package/lib/checks/impl/PermissionsCheck.js +67 -14
- package/lib/checks/impl/PublicGroupSharingCheck.js +20 -9
- package/lib/checks/impl/ReleaseUpdatesCheck.d.ts +10 -0
- package/lib/checks/impl/ReleaseUpdatesCheck.js +106 -0
- package/lib/checks/impl/ReportFolderAccessCheck.d.ts +10 -0
- package/lib/checks/impl/ReportFolderAccessCheck.js +54 -0
- package/lib/checks/impl/ScheduledApexCheck.d.ts +1 -0
- package/lib/checks/impl/ScheduledApexCheck.js +3 -0
- package/lib/checks/impl/SharingModelCheck.d.ts +1 -1
- package/lib/checks/impl/SharingModelCheck.js +103 -32
- package/lib/checks/impl/SiemIntegrationCheck.d.ts +11 -0
- package/lib/checks/impl/SiemIntegrationCheck.js +102 -0
- package/lib/checks/impl/SsoEnforcementCheck.d.ts +10 -0
- package/lib/checks/impl/SsoEnforcementCheck.js +90 -0
- package/lib/checks/impl/StandardProfilesCheck.d.ts +10 -0
- package/lib/checks/impl/StandardProfilesCheck.js +68 -0
- package/lib/checks/impl/TransactionSecurityPolicyCheck.d.ts +10 -0
- package/lib/checks/impl/TransactionSecurityPolicyCheck.js +62 -0
- package/lib/checks/impl/TrustedIPRangesCheck.d.ts +10 -0
- package/lib/checks/impl/TrustedIPRangesCheck.js +106 -0
- package/lib/checks/impl/UsersAndAdminsCheck.js +50 -20
- package/lib/checks/impl/VisualforceXssCheck.d.ts +11 -0
- package/lib/checks/impl/VisualforceXssCheck.js +150 -0
- package/lib/checks/registry.js +97 -12
- package/lib/commands/audit/diff.d.ts +17 -0
- package/lib/commands/audit/diff.js +76 -0
- package/lib/commands/audit/history.d.ts +15 -0
- package/lib/commands/audit/history.js +59 -0
- package/lib/commands/audit/security.d.ts +5 -0
- package/lib/commands/audit/security.js +38 -9
- package/lib/compliance/catalogs/hiso10029.d.ts +3 -0
- package/lib/compliance/catalogs/hiso10029.js +35 -0
- package/lib/compliance/catalogs/index.d.ts +4 -0
- package/lib/compliance/catalogs/index.js +21 -0
- package/lib/compliance/catalogs/iso27001.d.ts +3 -0
- package/lib/compliance/catalogs/iso27001.js +39 -0
- package/lib/compliance/catalogs/nzism.d.ts +3 -0
- package/lib/compliance/catalogs/nzism.js +31 -0
- package/lib/compliance/catalogs/owasp.d.ts +3 -0
- package/lib/compliance/catalogs/owasp.js +37 -0
- package/lib/compliance/catalogs/privacyAct.d.ts +3 -0
- package/lib/compliance/catalogs/privacyAct.js +17 -0
- package/lib/compliance/catalogs/sbs.d.ts +3 -0
- package/lib/compliance/catalogs/sbs.js +61 -0
- package/lib/compliance/catalogs/soc2.d.ts +3 -0
- package/lib/compliance/catalogs/soc2.js +42 -0
- package/lib/compliance/mapping.d.ts +2 -0
- package/lib/compliance/mapping.js +111 -0
- package/lib/compliance/resolve.d.ts +12 -0
- package/lib/compliance/resolve.js +49 -0
- package/lib/compliance/types.d.ts +13 -0
- package/lib/compliance/types.js +2 -0
- package/lib/context/AuditCache.d.ts +20 -0
- package/lib/context/AuditContext.d.ts +0 -2
- package/lib/findings/AuditResult.d.ts +3 -0
- package/lib/findings/CheckMeta.d.ts +9 -0
- package/lib/findings/CheckMeta.js +67 -0
- package/lib/findings/ComplianceMapping.d.ts +3 -0
- package/lib/findings/ComplianceMapping.js +75 -0
- package/lib/findings/Finding.d.ts +20 -0
- package/lib/findings/loadScoringConfig.js +9 -2
- package/lib/findings/scoring.d.ts +2 -1
- package/lib/findings/scoring.js +20 -7
- package/lib/history/AuditDiff.d.ts +26 -0
- package/lib/history/AuditDiff.js +2 -0
- package/lib/history/DiffEngine.d.ts +4 -0
- package/lib/history/DiffEngine.js +61 -0
- package/lib/history/HistoryStore.d.ts +11 -0
- package/lib/history/HistoryStore.js +56 -0
- package/lib/history/metricMeta.d.ts +9 -0
- package/lib/history/metricMeta.js +28 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +2 -1
- package/lib/lib/wire.d.ts +1 -2
- package/lib/lib/wire.js +1 -2
- package/lib/renderers/AuditRenderer.d.ts +2 -0
- package/lib/renderers/ClientReportRenderer.d.ts +29 -0
- package/lib/renderers/ClientReportRenderer.js +205 -0
- package/lib/renderers/DiffHtmlRenderer.d.ts +8 -0
- package/lib/renderers/DiffHtmlRenderer.js +164 -0
- package/lib/renderers/DiffJsonRenderer.d.ts +8 -0
- package/lib/renderers/DiffJsonRenderer.js +8 -0
- package/lib/renderers/DiffRenderer.d.ts +7 -0
- package/lib/renderers/DiffRenderer.js +2 -0
- package/lib/renderers/HistoryRenderer.d.ts +6 -0
- package/lib/renderers/HistoryRenderer.js +140 -0
- package/lib/renderers/HtmlRenderer.d.ts +1 -0
- package/lib/renderers/HtmlRenderer.js +354 -60
- package/lib/renderers/MarkdownRenderer.js +34 -1
- package/lib/renderers/html-utils.d.ts +2 -0
- package/lib/renderers/html-utils.js +8 -0
- package/lib/report/ComplianceMatrix.d.ts +19 -0
- package/lib/report/ComplianceMatrix.js +47 -0
- package/lib/report/ExecutivePriorities.d.ts +8 -0
- package/lib/report/ExecutivePriorities.js +22 -0
- package/lib/report/RemediationRoadmap.d.ts +9 -0
- package/lib/report/RemediationRoadmap.js +18 -0
- package/lib/report/branding.d.ts +18 -0
- package/lib/report/branding.js +19 -0
- package/lib/report/fonts.d.ts +2 -0
- package/lib/report/fonts.js +22 -0
- package/package.json +4 -3
- package/src/assets/fonts/dm-sans-italic-latin.woff2 +0 -0
- package/src/assets/fonts/dm-sans-normal-latin.woff2 +0 -0
- package/src/assets/fonts/dm-serif-display-italic-latin.woff2 +0 -0
- package/src/assets/fonts/dm-serif-display-normal-latin.woff2 +0 -0
- package/config/queries/soql.json +0 -24
- package/config/queries/tooling.json +0 -28
- package/config/scoring.json +0 -17
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/commands/audit/history.ts
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
5
|
+
import { HistoryStore } from '../../history/HistoryStore.js';
|
|
6
|
+
import { HistoryRenderer } from '../../renderers/HistoryRenderer.js';
|
|
7
|
+
export default class AuditHistoryCommand extends SfCommand {
|
|
8
|
+
static summary = 'Show audit history for an org';
|
|
9
|
+
static description = 'Scans archived audit reports for the target org, prints a terminal table, and writes an HTML timeline.';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --target-org myOrg',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --target-org myOrg --reports-dir ./reports --limit 10',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
'target-org': Flags.requiredOrg(),
|
|
16
|
+
'reports-dir': Flags.string({
|
|
17
|
+
summary: 'Directory containing archived report files. Defaults to ~/.sf/audit-history/{orgId}.',
|
|
18
|
+
helpValue: './reports',
|
|
19
|
+
}),
|
|
20
|
+
output: Flags.string({
|
|
21
|
+
char: 'o',
|
|
22
|
+
summary: 'Directory to write the HTML timeline. Defaults to current directory.',
|
|
23
|
+
default: '.',
|
|
24
|
+
}),
|
|
25
|
+
limit: Flags.integer({
|
|
26
|
+
summary: 'Maximum number of most-recent runs to include.',
|
|
27
|
+
helpValue: '20',
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
async run() {
|
|
31
|
+
const { flags } = await this.parse(AuditHistoryCommand);
|
|
32
|
+
const orgId = flags['target-org'].getOrgId();
|
|
33
|
+
const store = new HistoryStore();
|
|
34
|
+
const reportsDir = flags['reports-dir'];
|
|
35
|
+
let results = store.list(orgId, reportsDir);
|
|
36
|
+
if (results.length < 2) {
|
|
37
|
+
if (results.length === 0) {
|
|
38
|
+
this.log(`No audit history found for org ${orgId}.`);
|
|
39
|
+
this.log(`Run 'sf audit security --target-org <alias>' to create the first report.`);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.log(`Only 1 audit run found for org ${orgId}. Run at least 2 audits to see trends.`);
|
|
43
|
+
}
|
|
44
|
+
return results;
|
|
45
|
+
}
|
|
46
|
+
if (flags.limit !== undefined) {
|
|
47
|
+
results = results.slice(-flags.limit);
|
|
48
|
+
}
|
|
49
|
+
const renderer = new HistoryRenderer();
|
|
50
|
+
this.log(renderer.renderTable(results));
|
|
51
|
+
const filename = `sf-audit-history-${orgId}-${Date.now()}.html`;
|
|
52
|
+
const outputPath = path.join(flags.output, filename);
|
|
53
|
+
fs.mkdirSync(flags.output, { recursive: true });
|
|
54
|
+
fs.writeFileSync(outputPath, renderer.renderHtml(results), 'utf-8');
|
|
55
|
+
this.log(`\nHistory report written: ${outputPath}`);
|
|
56
|
+
return results;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -11,8 +11,13 @@ export default class SecurityAuditCommand extends SfCommand<AuditResult> {
|
|
|
11
11
|
'fail-on': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
checks: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
'scoring-config': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'prepared-for': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
branding: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
top: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
frameworks: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
18
|
};
|
|
15
19
|
run(): Promise<AuditResult>;
|
|
20
|
+
private rendererFor;
|
|
16
21
|
private printSummary;
|
|
17
22
|
private handleFailOn;
|
|
18
23
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
3
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
5
|
-
import { QueryRegistry } from '../../queries/QueryRegistry.js';
|
|
6
4
|
import { CheckEngine } from '../../checks/CheckEngine.js';
|
|
7
5
|
import { CHECKS } from '../../checks/registry.js';
|
|
8
6
|
import { JsonRenderer } from '../../renderers/JsonRenderer.js';
|
|
9
7
|
import { HtmlRenderer } from '../../renderers/HtmlRenderer.js';
|
|
10
8
|
import { MarkdownRenderer } from '../../renderers/MarkdownRenderer.js';
|
|
9
|
+
import { ClientReportRenderer } from '../../renderers/ClientReportRenderer.js';
|
|
10
|
+
import { resolveBranding } from '../../report/branding.js';
|
|
11
|
+
import { resolveFrameworks } from '../../compliance/resolve.js';
|
|
11
12
|
import { buildAuditContext, resolveOrgInfo } from '../../lib/wire.js';
|
|
12
13
|
import { loadScoringConfig } from '../../findings/loadScoringConfig.js';
|
|
14
|
+
import { HistoryStore } from '../../history/HistoryStore.js';
|
|
13
15
|
const RENDERERS = {
|
|
14
16
|
html: new HtmlRenderer(),
|
|
15
17
|
md: new MarkdownRenderer(),
|
|
@@ -47,15 +49,27 @@ export default class SecurityAuditCommand extends SfCommand {
|
|
|
47
49
|
summary: 'Path to a custom scoring config JSON file. Merges with defaults.',
|
|
48
50
|
helpValue: './hnz-scoring.json',
|
|
49
51
|
}),
|
|
52
|
+
'prepared-for': Flags.string({
|
|
53
|
+
summary: 'Client name for the executive report cover line.',
|
|
54
|
+
}),
|
|
55
|
+
branding: Flags.string({
|
|
56
|
+
summary: 'Path to a report-branding.json to override CloudCounsel defaults (executive format).',
|
|
57
|
+
helpValue: './report-branding.json',
|
|
58
|
+
}),
|
|
59
|
+
top: Flags.integer({
|
|
60
|
+
summary: 'Number of executive priorities to highlight (executive format).',
|
|
61
|
+
default: 5,
|
|
62
|
+
}),
|
|
63
|
+
frameworks: Flags.string({
|
|
64
|
+
summary: 'Compliance frameworks for the executive matrix: universal | nz | all | a comma list (executive format).',
|
|
65
|
+
default: 'universal',
|
|
66
|
+
}),
|
|
50
67
|
};
|
|
51
68
|
async run() {
|
|
52
69
|
const { flags } = await this.parse(SecurityAuditCommand);
|
|
53
70
|
const conn = flags['target-org'].getConnection('62.0');
|
|
54
|
-
// Resolve plugin root from compiled file location (lib/commands/audit/security.js → 3 levels up)
|
|
55
|
-
const pluginRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../..');
|
|
56
|
-
const queries = QueryRegistry.load(pluginRoot);
|
|
57
71
|
const orgInfo = await resolveOrgInfo(conn);
|
|
58
|
-
const ctx = buildAuditContext(conn,
|
|
72
|
+
const ctx = buildAuditContext(conn, orgInfo);
|
|
59
73
|
const checksToRun = flags.checks
|
|
60
74
|
? (() => {
|
|
61
75
|
const ids = new Set(flags.checks.split(',').map((s) => s.trim()));
|
|
@@ -76,18 +90,23 @@ export default class SecurityAuditCommand extends SfCommand {
|
|
|
76
90
|
this.log(`[${String(current).padStart(2)}/${total}] ${checkName}`);
|
|
77
91
|
});
|
|
78
92
|
const formats = flags.format.split(',').map((f) => f.trim());
|
|
93
|
+
fs.mkdirSync(flags.output, { recursive: true });
|
|
79
94
|
for (const format of formats) {
|
|
80
|
-
const renderer =
|
|
95
|
+
const renderer = this.rendererFor(format, flags);
|
|
81
96
|
if (!renderer) {
|
|
82
|
-
this.warn(`Unknown format '${format}' — skipping. Valid formats: html, md, json`);
|
|
97
|
+
this.warn(`Unknown format '${format}' — skipping. Valid formats: html, md, json, executive`);
|
|
83
98
|
continue;
|
|
84
99
|
}
|
|
85
100
|
const output = renderer.render(result);
|
|
86
|
-
const
|
|
101
|
+
const prefix = renderer.filenamePrefix ?? 'sf-audit';
|
|
102
|
+
const filename = `${prefix}-${orgInfo.id}-${Date.now()}${renderer.fileExtension}`;
|
|
87
103
|
const outputPath = path.join(flags.output, filename);
|
|
88
104
|
fs.writeFileSync(outputPath, output, 'utf-8');
|
|
89
105
|
this.log(`\nReport written: ${outputPath}`);
|
|
90
106
|
}
|
|
107
|
+
// Auto-archive: silently save a copy for history tracking
|
|
108
|
+
const store = new HistoryStore();
|
|
109
|
+
store.archive(result);
|
|
91
110
|
this.log('');
|
|
92
111
|
this.printSummary(result);
|
|
93
112
|
if (flags['fail-on']) {
|
|
@@ -95,6 +114,16 @@ export default class SecurityAuditCommand extends SfCommand {
|
|
|
95
114
|
}
|
|
96
115
|
return result;
|
|
97
116
|
}
|
|
117
|
+
rendererFor(format, flags) {
|
|
118
|
+
if (format === 'executive') {
|
|
119
|
+
let overrides;
|
|
120
|
+
if (flags.branding)
|
|
121
|
+
overrides = JSON.parse(fs.readFileSync(flags.branding, 'utf-8'));
|
|
122
|
+
const branding = resolveBranding(overrides, flags['prepared-for']);
|
|
123
|
+
return new ClientReportRenderer({ branding, topN: flags.top, frameworks: resolveFrameworks(flags.frameworks) });
|
|
124
|
+
}
|
|
125
|
+
return RENDERERS[format];
|
|
126
|
+
}
|
|
98
127
|
printSummary(result) {
|
|
99
128
|
const levels = ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW'];
|
|
100
129
|
const counts = Object.fromEntries(levels.map((l) => [l, result.findings.filter((f) => f.riskLevel === l).length]));
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// HISO 10029:2022 — Health Information Security Framework (HISF), Health NZ / Te Whatu Ora.
|
|
2
|
+
// Basis VERIFIED 2026-06: HISF is explicitly built on AS/NZS ISO/IEC 27002 (confirmed via the
|
|
3
|
+
// framework and Te Whatu Ora cyber standards). These are DOMAIN-LEVEL controls mapped to the
|
|
4
|
+
// ISO 27002 control areas HISF adopts. `verified` = the framework basis and domain coverage are
|
|
5
|
+
// confirmed; exact HISF 2022 clause references are a later granularity pass needing the MoH document.
|
|
6
|
+
const V = 'HISO 10029:2022 (HISF)';
|
|
7
|
+
const URL = 'https://www.tewhatuora.govt.nz/health-services-and-programmes/cyber-hub/cyber-standards';
|
|
8
|
+
const ref = (domain) => `HISO 10029:2022 (HISF, AS/NZS ISO/IEC 27002-aligned), ${domain}`;
|
|
9
|
+
export const HISO10029_CONTROLS = [
|
|
10
|
+
{ id: 'HISO-AC', framework: 'HISO10029', version: V, title: 'Access control',
|
|
11
|
+
requirement: 'Access to health information and supporting systems is restricted to authorised users on a need-to-know, least-privilege basis.',
|
|
12
|
+
sourceRef: ref('Access Control'), url: URL, verified: true },
|
|
13
|
+
{ id: 'HISO-AUTH', framework: 'HISO10029', version: V, title: 'Identity and authentication',
|
|
14
|
+
requirement: 'Users are uniquely identified and strongly authenticated (including multi-factor) before accessing health information.',
|
|
15
|
+
sourceRef: ref('Authentication'), url: URL, verified: true },
|
|
16
|
+
{ id: 'HISO-CRYPTO', framework: 'HISO10029', version: V, title: 'Cryptography and key management',
|
|
17
|
+
requirement: 'Health information is protected using appropriate cryptographic controls in transit and at rest, with managed keys and credentials.',
|
|
18
|
+
sourceRef: ref('Cryptography'), url: URL, verified: true },
|
|
19
|
+
{ id: 'HISO-LOG', framework: 'HISO10029', version: V, title: 'Logging, monitoring and audit',
|
|
20
|
+
requirement: 'Security-relevant events affecting health information are logged, retained, and monitored to support detection and investigation.',
|
|
21
|
+
sourceRef: ref('Logging and Monitoring'), url: URL, verified: true },
|
|
22
|
+
{ id: 'HISO-DATA', framework: 'HISO10029', version: V, title: 'Information classification and handling',
|
|
23
|
+
requirement: 'Health information is classified and handled according to its sensitivity, including identification of personal and sensitive data.',
|
|
24
|
+
sourceRef: ref('Information Classification'), url: URL, verified: true },
|
|
25
|
+
{ id: 'HISO-DEV', framework: 'HISO10029', version: V, title: 'Secure development and change',
|
|
26
|
+
requirement: 'Application code and changes follow secure development practices that prevent introduction of vulnerabilities affecting health information.',
|
|
27
|
+
sourceRef: ref('Secure Development'), url: URL, verified: true },
|
|
28
|
+
{ id: 'HISO-COMM', framework: 'HISO10029', version: V, title: 'Communications and integration security',
|
|
29
|
+
requirement: 'Integrations and external communications carrying health information use secure, controlled, and authorised channels.',
|
|
30
|
+
sourceRef: ref('Communications Security'), url: URL, verified: true },
|
|
31
|
+
{ id: 'HISO-GOV', framework: 'HISO10029', version: V, title: 'Security configuration and governance',
|
|
32
|
+
requirement: 'Systems holding health information are securely configured, kept current, and governed against a defined security baseline.',
|
|
33
|
+
sourceRef: ref('Security Governance'), url: URL, verified: true },
|
|
34
|
+
];
|
|
35
|
+
//# sourceMappingURL=hiso10029.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OWASP_CONTROLS } from './owasp.js';
|
|
2
|
+
import { SOC2_CONTROLS } from './soc2.js';
|
|
3
|
+
import { ISO27001_CONTROLS } from './iso27001.js';
|
|
4
|
+
import { SBS_CONTROLS } from './sbs.js';
|
|
5
|
+
import { PRIVACY_ACT_CONTROLS } from './privacyAct.js';
|
|
6
|
+
import { HISO10029_CONTROLS } from './hiso10029.js';
|
|
7
|
+
import { NZISM_CONTROLS } from './nzism.js';
|
|
8
|
+
export const ALL_CONTROLS = [
|
|
9
|
+
...OWASP_CONTROLS,
|
|
10
|
+
...SOC2_CONTROLS,
|
|
11
|
+
...ISO27001_CONTROLS,
|
|
12
|
+
...SBS_CONTROLS,
|
|
13
|
+
...PRIVACY_ACT_CONTROLS,
|
|
14
|
+
...HISO10029_CONTROLS,
|
|
15
|
+
...NZISM_CONTROLS,
|
|
16
|
+
];
|
|
17
|
+
const BY_ID = new Map(ALL_CONTROLS.map((c) => [c.id, c]));
|
|
18
|
+
export function getControl(id) {
|
|
19
|
+
return BY_ID.get(id);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// ISO/IEC 27001:2022 Annex A. Control numbers + titles VERIFIED 2026-06 against an authoritative
|
|
2
|
+
// Annex A reference (isms.online). Remapped from the withdrawn 2013 Annex A numbering to the 2022
|
|
3
|
+
// structure (Organisational 5.x, People 6.x, Physical 7.x, Technological 8.x). `requirement` is a
|
|
4
|
+
// faithful paraphrase; verbatim control text is in the purchased standard.
|
|
5
|
+
const V = 'ISO/IEC 27001:2022';
|
|
6
|
+
const ref = (n) => `ISO/IEC 27001:2022, Annex A ${n}`;
|
|
7
|
+
export const ISO27001_CONTROLS = [
|
|
8
|
+
{ id: 'ISO-A.5.12', framework: 'ISO27001', version: V, title: 'Classification of information',
|
|
9
|
+
requirement: 'Information is classified according to its confidentiality, integrity, and availability needs and legal requirements.',
|
|
10
|
+
sourceRef: ref('A.5.12'), verified: true },
|
|
11
|
+
{ id: 'ISO-A.5.14', framework: 'ISO27001', version: V, title: 'Information transfer',
|
|
12
|
+
requirement: 'Information transfer is protected by rules, procedures, and agreements across all communication channels.',
|
|
13
|
+
sourceRef: ref('A.5.14'), verified: true },
|
|
14
|
+
{ id: 'ISO-A.5.18', framework: 'ISO27001', version: V, title: 'Access rights',
|
|
15
|
+
requirement: 'Access rights to information and assets are provisioned, reviewed, modified, and removed per the access control policy.',
|
|
16
|
+
sourceRef: ref('A.5.18'), verified: true },
|
|
17
|
+
{ id: 'ISO-A.8.3', framework: 'ISO27001', version: V, title: 'Information access restriction',
|
|
18
|
+
requirement: 'Access to information and application functions is restricted in line with the access control policy.',
|
|
19
|
+
sourceRef: ref('A.8.3'), verified: true },
|
|
20
|
+
{ id: 'ISO-A.8.8', framework: 'ISO27001', version: V, title: 'Management of technical vulnerabilities',
|
|
21
|
+
requirement: 'Technical vulnerabilities are identified, evaluated, and remediated in a timely manner.',
|
|
22
|
+
sourceRef: ref('A.8.8'), verified: true },
|
|
23
|
+
{ id: 'ISO-A.8.15', framework: 'ISO27001', version: V, title: 'Logging',
|
|
24
|
+
requirement: 'Logs recording activities, exceptions, faults, and security events are produced, stored, protected, and reviewed.',
|
|
25
|
+
sourceRef: ref('A.8.15'), verified: true },
|
|
26
|
+
{ id: 'ISO-A.8.24', framework: 'ISO27001', version: V, title: 'Use of cryptography',
|
|
27
|
+
requirement: 'Rules for the effective use of cryptography, including key management, protect information confidentiality and integrity.',
|
|
28
|
+
sourceRef: ref('A.8.24'), verified: true },
|
|
29
|
+
{ id: 'ISO-A.8.25', framework: 'ISO27001', version: V, title: 'Secure development life cycle',
|
|
30
|
+
requirement: 'Rules for the secure development of software and systems are established and applied.',
|
|
31
|
+
sourceRef: ref('A.8.25'), verified: true },
|
|
32
|
+
{ id: 'ISO-A.8.26', framework: 'ISO27001', version: V, title: 'Application security requirements',
|
|
33
|
+
requirement: 'Information security requirements are identified, specified, and approved when developing or acquiring applications.',
|
|
34
|
+
sourceRef: ref('A.8.26'), verified: true },
|
|
35
|
+
{ id: 'ISO-A.8.32', framework: 'ISO27001', version: V, title: 'Change management',
|
|
36
|
+
requirement: 'Changes to information processing facilities and systems are subject to change management procedures.',
|
|
37
|
+
sourceRef: ref('A.8.32'), verified: true },
|
|
38
|
+
];
|
|
39
|
+
//# sourceMappingURL=iso27001.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// New Zealand Information Security Manual (NZISM), GCSB/NCSC.
|
|
2
|
+
// Chapter references VERIFIED 2026-06 against the official manual (https://nzism.gcsb.govt.nz/ism-document),
|
|
3
|
+
// current version v3.8 (July 2025). These are CHAPTER/SECTION-level mappings; refining to individual
|
|
4
|
+
// NZISM control numbers (e.g. 16.1.35) is a future granularity pass. `verified` = the chapter reference
|
|
5
|
+
// is confirmed to exist with this title in the current NZISM.
|
|
6
|
+
const V = 'NZISM v3.8';
|
|
7
|
+
const URL = 'https://nzism.gcsb.govt.nz/ism-document';
|
|
8
|
+
export const NZISM_CONTROLS = [
|
|
9
|
+
{ id: 'NZISM-AC', framework: 'NZISM', version: V, title: 'Access control and privilege management',
|
|
10
|
+
requirement: 'Access to systems and information is granted on a least-privilege, need-to-know basis; privileged access is controlled and reviewed.',
|
|
11
|
+
sourceRef: 'NZISM v3.8, Ch.16 Authentication and Access Controls (16.2 System Access, 16.3 Privileged User Access)', url: URL, verified: true },
|
|
12
|
+
{ id: 'NZISM-AUTH', framework: 'NZISM', version: V, title: 'Identification, authentication and MFA',
|
|
13
|
+
requirement: 'Users and systems are uniquely identified and strongly authenticated, including multi-factor authentication.',
|
|
14
|
+
sourceRef: 'NZISM v3.8, Ch.16 Authentication and Access Controls (16.1 Identification, Authentication and Authorisation, 16.7 Multi-Factor Authentication)', url: URL, verified: true },
|
|
15
|
+
{ id: 'NZISM-LOG', framework: 'NZISM', version: V, title: 'Event monitoring, logging and auditing',
|
|
16
|
+
requirement: 'Security-relevant events are logged with sufficient detail and retention, and reviewed to detect and investigate incidents.',
|
|
17
|
+
sourceRef: 'NZISM v3.8, §16.6 Event Monitoring, Logging and Auditing', url: URL, verified: true },
|
|
18
|
+
{ id: 'NZISM-CRYPTO', framework: 'NZISM', version: V, title: 'Cryptography and key management',
|
|
19
|
+
requirement: 'Approved cryptographic algorithms, protocols, and key management protect information in transit and at rest.',
|
|
20
|
+
sourceRef: 'NZISM v3.8, Ch.17 Cryptography', url: URL, verified: true },
|
|
21
|
+
{ id: 'NZISM-SW', framework: 'NZISM', version: V, title: 'Software and application security',
|
|
22
|
+
requirement: 'Applications are developed and configured securely, mitigating common code-level vulnerabilities and unsafe execution.',
|
|
23
|
+
sourceRef: 'NZISM v3.8, Ch.14 Software Security', url: URL, verified: true },
|
|
24
|
+
{ id: 'NZISM-NET', framework: 'NZISM', version: V, title: 'Network security and gateways',
|
|
25
|
+
requirement: 'Network connections, gateways, and external integrations are restricted to authorised, secured endpoints.',
|
|
26
|
+
sourceRef: 'NZISM v3.8, Ch.18 Network Security / Ch.19 Gateway Security', url: URL, verified: true },
|
|
27
|
+
{ id: 'NZISM-CONFIG', framework: 'NZISM', version: V, title: 'System hardening and configuration',
|
|
28
|
+
requirement: 'Systems are hardened to a secure baseline, kept current with security updates, and unnecessary functionality is disabled.',
|
|
29
|
+
sourceRef: 'NZISM v3.8, Ch.12 Product Security (configuration and patching)', url: URL, verified: true },
|
|
30
|
+
];
|
|
31
|
+
//# sourceMappingURL=nzism.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Verified 2026-06 against the official source: https://owasp.org/Top10/2021/
|
|
2
|
+
// (OWASP Top 10:2025 now exists; this catalog pins the 2021 edition as a stable citation.)
|
|
3
|
+
const V = 'OWASP Top 10:2021';
|
|
4
|
+
export const OWASP_CONTROLS = [
|
|
5
|
+
{ id: 'OWASP-A01', framework: 'OWASP', version: V, title: 'Broken Access Control',
|
|
6
|
+
requirement: 'Access control enforces policy so users cannot act outside their intended permissions; deny by default, enforce record/field ownership.',
|
|
7
|
+
sourceRef: 'OWASP Top 10:2021 A01', verified: true },
|
|
8
|
+
{ id: 'OWASP-A02', framework: 'OWASP', version: V, title: 'Cryptographic Failures',
|
|
9
|
+
requirement: 'Sensitive data (credentials, secrets, PII) is protected in transit and at rest; secrets are not hardcoded or exposed.',
|
|
10
|
+
sourceRef: 'OWASP Top 10:2021 A02', verified: true },
|
|
11
|
+
{ id: 'OWASP-A03', framework: 'OWASP', version: V, title: 'Injection',
|
|
12
|
+
requirement: 'Untrusted input is validated/escaped so it cannot alter queries, markup, or commands (SOQL injection, XSS).',
|
|
13
|
+
sourceRef: 'OWASP Top 10:2021 A03', verified: true },
|
|
14
|
+
{ id: 'OWASP-A05', framework: 'OWASP', version: V, title: 'Security Misconfiguration',
|
|
15
|
+
requirement: 'Platform and application security settings are hardened and reviewed; unnecessary features and exposure are removed.',
|
|
16
|
+
sourceRef: 'OWASP Top 10:2021 A05', verified: true },
|
|
17
|
+
{ id: 'OWASP-A06', framework: 'OWASP', version: V, title: 'Vulnerable and Outdated Components',
|
|
18
|
+
requirement: 'Installed packages and platform components are inventoried and kept current; outdated/unsupported components are flagged.',
|
|
19
|
+
sourceRef: 'OWASP Top 10:2021 A06', verified: true },
|
|
20
|
+
{ id: 'OWASP-A07', framework: 'OWASP', version: V, title: 'Identification and Authentication Failures',
|
|
21
|
+
requirement: 'Authentication is strong (MFA, session controls, IP/login policy) and resistant to credential stuffing and session abuse.',
|
|
22
|
+
sourceRef: 'OWASP Top 10:2021 A07', verified: true },
|
|
23
|
+
{ id: 'OWASP-A08', framework: 'OWASP', version: V, title: 'Software and Data Integrity Failures',
|
|
24
|
+
requirement: 'Software, packages, and deployments originate from trusted sources with integrity controls; unmanaged/unverified components and uncontrolled deployment activity are flagged.',
|
|
25
|
+
sourceRef: 'OWASP Top 10:2021 A08', verified: true },
|
|
26
|
+
{ id: 'OWASP-A09', framework: 'OWASP', version: V, title: 'Security Logging and Monitoring Failures',
|
|
27
|
+
requirement: 'Security-relevant events are logged, retained, and monitored so incidents can be detected and investigated.',
|
|
28
|
+
sourceRef: 'OWASP Top 10:2021 A09', verified: true },
|
|
29
|
+
{ id: 'OWASP-A10', framework: 'OWASP', version: V, title: 'Server-Side Request Forgery (SSRF)',
|
|
30
|
+
requirement: 'Server-side requests (Apex callouts, remote sites, integrations) are restricted to trusted, explicitly allowlisted endpoints to prevent forged requests to internal or unintended targets.',
|
|
31
|
+
sourceRef: 'OWASP Top 10:2021 A10', verified: true },
|
|
32
|
+
];
|
|
33
|
+
// Note: OWASP-A04 (Insecure Design) is intentionally NOT catalogued. It concerns
|
|
34
|
+
// design-level flaws, not org configuration, so no read-only config check maps to it.
|
|
35
|
+
// The executive report's scope section declares A04 as out of assessment scope rather
|
|
36
|
+
// than forcing a weak mapping.
|
|
37
|
+
//# sourceMappingURL=owasp.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// New Zealand Privacy Act 2020 — Information Privacy Principles (IPPs).
|
|
2
|
+
// IPP titles verified 2026-06 against the Office of the Privacy Commissioner
|
|
3
|
+
// (https://privacy.org.nz/privacy-act-2020/privacy-principles/). Requirement text is a close
|
|
4
|
+
// paraphrase of the statute; the legislation site (legislation.govt.nz) is the primary source.
|
|
5
|
+
const V = 'NZ Privacy Act 2020 (IPPs)';
|
|
6
|
+
export const PRIVACY_ACT_CONTROLS = [
|
|
7
|
+
{ id: 'PRIVACY-IPP5', framework: 'PRIVACY_ACT', version: V, title: 'IPP 5 — Storage and security of personal information',
|
|
8
|
+
requirement: 'An agency holding personal information must ensure it is protected by such security safeguards as are reasonable to prevent loss, misuse, and unauthorised access, use, modification, or disclosure.',
|
|
9
|
+
sourceRef: 'Privacy Act 2020, IPP 5', url: 'https://www.legislation.govt.nz/act/public/2020/0031/latest/LMS23342.html', verified: true },
|
|
10
|
+
{ id: 'PRIVACY-IPP9', framework: 'PRIVACY_ACT', version: V, title: 'IPP 9 — Retention of personal information',
|
|
11
|
+
requirement: 'An agency must not keep personal information for longer than is required for the purposes for which it may lawfully be used.',
|
|
12
|
+
sourceRef: 'Privacy Act 2020, IPP 9', verified: true },
|
|
13
|
+
{ id: 'PRIVACY-IPP12', framework: 'PRIVACY_ACT', version: V, title: 'IPP 12 — Disclosure of personal information outside New Zealand',
|
|
14
|
+
requirement: 'An agency may disclose personal information to a foreign person or entity only where comparable safeguards (or specified exceptions) apply.',
|
|
15
|
+
sourceRef: 'Privacy Act 2020, IPP 12', verified: true },
|
|
16
|
+
];
|
|
17
|
+
//# sourceMappingURL=privacyAct.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Security Benchmark for Salesforce (SBS) — an independent, public Salesforce security standard.
|
|
2
|
+
// Titles VERIFIED 2026-06 against the official catalog: https://docs.securitybenchmark.org/controls-at-a-glance.html
|
|
3
|
+
// `title` is the verbatim official control statement; `requirement` is a faithful one-line summary.
|
|
4
|
+
const V = 'Security Benchmark for Salesforce (SBS)';
|
|
5
|
+
const ref = (id) => `Security Benchmark for Salesforce, ${id}`;
|
|
6
|
+
const URL = 'https://docs.securitybenchmark.org/controls-at-a-glance.html';
|
|
7
|
+
export const SBS_CONTROLS = [
|
|
8
|
+
// Access Controls
|
|
9
|
+
{ id: 'SBS-ACS-002', framework: 'SBS', version: V, title: 'Documented Justification for All API-Enabled Authorizations', requirement: 'Every grant of the API Enabled permission is justified and documented.', sourceRef: ref('SBS-ACS-002'), url: URL, verified: true },
|
|
10
|
+
{ id: 'SBS-ACS-004', framework: 'SBS', version: V, title: 'Documented Justification for All Super Admin–Equivalent Users', requirement: 'Users with super-admin-equivalent permissions (Modify All Data, etc.) are justified and documented.', sourceRef: ref('SBS-ACS-004'), url: URL, verified: true },
|
|
11
|
+
{ id: 'SBS-ACS-005', framework: 'SBS', version: V, title: 'Only Use Custom Profiles for Active Users', requirement: 'Active users are assigned least-privilege custom profiles, not standard profiles.', sourceRef: ref('SBS-ACS-005'), url: URL, verified: true },
|
|
12
|
+
{ id: 'SBS-ACS-006', framework: 'SBS', version: V, title: 'Documented Justification for Use Any API Client Permission', requirement: 'Every grant of the "Use Any API Client" permission is justified and documented.', sourceRef: ref('SBS-ACS-006'), url: URL, verified: true },
|
|
13
|
+
{ id: 'SBS-ACS-007', framework: 'SBS', version: V, title: 'Maintain Inventory of Non-Human Identities', requirement: 'A current inventory of non-human/integration identities is maintained.', sourceRef: ref('SBS-ACS-007'), url: URL, verified: true },
|
|
14
|
+
{ id: 'SBS-ACS-008', framework: 'SBS', version: V, title: 'Restrict Broad Privileges for Non-Human Identities', requirement: 'Non-human identities are not granted broad or excessive privileges.', sourceRef: ref('SBS-ACS-008'), url: URL, verified: true },
|
|
15
|
+
{ id: 'SBS-ACS-009', framework: 'SBS', version: V, title: 'Implement Compensating Controls for Privileged Non-Human Identities', requirement: 'Privileged non-human identities have compensating controls (IP restriction, monitoring).', sourceRef: ref('SBS-ACS-009'), url: URL, verified: true },
|
|
16
|
+
// Authentication
|
|
17
|
+
{ id: 'SBS-AUTH-001', framework: 'SBS', version: V, title: 'Enable Organization-Wide SSO Enforcement Setting', requirement: 'Org-wide single sign-on enforcement is enabled.', sourceRef: ref('SBS-AUTH-001'), url: URL, verified: true },
|
|
18
|
+
{ id: 'SBS-AUTH-002', framework: 'SBS', version: V, title: 'Govern and Document All Users Permitted to Bypass Single Sign-On', requirement: 'Users allowed to bypass SSO are governed and documented.', sourceRef: ref('SBS-AUTH-002'), url: URL, verified: true },
|
|
19
|
+
{ id: 'SBS-AUTH-003', framework: 'SBS', version: V, title: 'Prohibit Broad or Unrestricted Profile Login IP Ranges', requirement: 'Profile login IP ranges are not broad or unrestricted (which would bypass MFA).', sourceRef: ref('SBS-AUTH-003'), url: URL, verified: true },
|
|
20
|
+
{ id: 'SBS-AUTH-004', framework: 'SBS', version: V, title: 'Enforce Strong Multi-Factor Authentication for External Users', requirement: 'Strong MFA is enforced for external/portal users.', sourceRef: ref('SBS-AUTH-004'), url: URL, verified: true },
|
|
21
|
+
// Code Security
|
|
22
|
+
{ id: 'SBS-CODE-002', framework: 'SBS', version: V, title: 'Pre-Merge Static Code Analysis for Apex and LWC', requirement: 'Static code analysis runs on Apex and LWC before merge.', sourceRef: ref('SBS-CODE-002'), url: URL, verified: true },
|
|
23
|
+
{ id: 'SBS-CODE-003', framework: 'SBS', version: V, title: 'Implement Persistent Apex Application Logging', requirement: 'A persistent Apex application logging framework is in place.', sourceRef: ref('SBS-CODE-003'), url: URL, verified: true },
|
|
24
|
+
{ id: 'SBS-CODE-004', framework: 'SBS', version: V, title: 'Prevent Sensitive Data in Application Logs', requirement: 'Application logs do not capture sensitive data.', sourceRef: ref('SBS-CODE-004'), url: URL, verified: true },
|
|
25
|
+
// Customer Portals
|
|
26
|
+
{ id: 'SBS-CPORTAL-001', framework: 'SBS', version: V, title: 'Prevent Parameter-Based Record Access in Portal Apex', requirement: 'Portal-reachable Apex does not allow parameter-based record access bypassing sharing.', sourceRef: ref('SBS-CPORTAL-001'), url: URL, verified: true },
|
|
27
|
+
{ id: 'SBS-CPORTAL-002', framework: 'SBS', version: V, title: 'Restrict Guest User Record Access', requirement: 'Guest user record access is restricted to the minimum necessary.', sourceRef: ref('SBS-CPORTAL-002'), url: URL, verified: true },
|
|
28
|
+
{ id: 'SBS-CPORTAL-003', framework: 'SBS', version: V, title: 'Inventory Portal-Exposed Apex Classes and Flows', requirement: 'Portal-exposed Apex classes and flows are inventoried.', sourceRef: ref('SBS-CPORTAL-003'), url: URL, verified: true },
|
|
29
|
+
{ id: 'SBS-CPORTAL-004', framework: 'SBS', version: V, title: 'Prevent Parameter-Based Record Access in Portal-Exposed Flows', requirement: 'Portal-exposed flows do not allow parameter-based record access bypassing sharing.', sourceRef: ref('SBS-CPORTAL-004'), url: URL, verified: true },
|
|
30
|
+
// Data Security
|
|
31
|
+
{ id: 'SBS-DATA-001', framework: 'SBS', version: V, title: 'Implement Mechanisms to Detect Regulated Data in Long Text Fields', requirement: 'Mechanisms detect regulated data stored in long text fields.', sourceRef: ref('SBS-DATA-001'), url: URL, verified: true },
|
|
32
|
+
{ id: 'SBS-DATA-002', framework: 'SBS', version: V, title: 'Maintain an Inventory of Long Text Area Fields Containing Data', requirement: 'An inventory of long text area fields containing data is maintained.', sourceRef: ref('SBS-DATA-002'), url: URL, verified: true },
|
|
33
|
+
{ id: 'SBS-DATA-003', framework: 'SBS', version: V, title: 'Maintain Tested Backup and Recovery for Salesforce Data', requirement: 'Tested backup and recovery is maintained for Salesforce data.', sourceRef: ref('SBS-DATA-003'), url: URL, verified: true },
|
|
34
|
+
{ id: 'SBS-DATA-004', framework: 'SBS', version: V, title: 'Require Field History Tracking for Sensitive Fields', requirement: 'Field history tracking is enabled for sensitive fields.', sourceRef: ref('SBS-DATA-004'), url: URL, verified: true },
|
|
35
|
+
// Deployments
|
|
36
|
+
{ id: 'SBS-DEP-001', framework: 'SBS', version: V, title: 'Require a Designated Deployment Identity for Metadata Changes', requirement: 'Metadata changes deploy under a designated deployment identity.', sourceRef: ref('SBS-DEP-001'), url: URL, verified: true },
|
|
37
|
+
{ id: 'SBS-DEP-003', framework: 'SBS', version: V, title: 'Monitor and Alert on Unauthorized Modifications to High-Risk Metadata', requirement: 'Unauthorized changes to high-risk metadata are monitored and alerted.', sourceRef: ref('SBS-DEP-003'), url: URL, verified: true },
|
|
38
|
+
{ id: 'SBS-DEP-005', framework: 'SBS', version: V, title: 'Implement Secret Scanning for Salesforce Source Repositories', requirement: 'Secret scanning runs on Salesforce source repositories.', sourceRef: ref('SBS-DEP-005'), url: URL, verified: true },
|
|
39
|
+
{ id: 'SBS-DEP-006', framework: 'SBS', version: V, title: 'Configure Salesforce CLI Connected App with Token Expiration', requirement: 'The Salesforce CLI connected app is configured with token expiration.', sourceRef: ref('SBS-DEP-006'), url: URL, verified: true },
|
|
40
|
+
// File Security
|
|
41
|
+
{ id: 'SBS-FILE-001', framework: 'SBS', version: V, title: 'Require Expiry Dates on Public Content Links', requirement: 'Public content links require expiry dates.', sourceRef: ref('SBS-FILE-001'), url: URL, verified: true },
|
|
42
|
+
{ id: 'SBS-FILE-002', framework: 'SBS', version: V, title: 'Require Passwords on Public Content Links for Sensitive Content', requirement: 'Public content links for sensitive content require passwords.', sourceRef: ref('SBS-FILE-002'), url: URL, verified: true },
|
|
43
|
+
{ id: 'SBS-FILE-003', framework: 'SBS', version: V, title: 'Periodic Review and Cleanup of Public Content Links', requirement: 'Public content links are periodically reviewed and cleaned up.', sourceRef: ref('SBS-FILE-003'), url: URL, verified: true },
|
|
44
|
+
// Integrations
|
|
45
|
+
{ id: 'SBS-INT-002', framework: 'SBS', version: V, title: 'Inventory and Justification of Remote Site Settings', requirement: 'Remote site settings are inventoried and justified.', sourceRef: ref('SBS-INT-002'), url: URL, verified: true },
|
|
46
|
+
{ id: 'SBS-INT-003', framework: 'SBS', version: V, title: 'Inventory and Justification of Named Credentials', requirement: 'Named credentials are inventoried and justified.', sourceRef: ref('SBS-INT-003'), url: URL, verified: true },
|
|
47
|
+
{ id: 'SBS-INT-004', framework: 'SBS', version: V, title: 'Retain API Total Usage Event Logs for 30 Days', requirement: 'API Total Usage event logs are retained for at least 30 days.', sourceRef: ref('SBS-INT-004'), url: URL, verified: true },
|
|
48
|
+
// Event Monitoring
|
|
49
|
+
{ id: 'SBS-MON-001', framework: 'SBS', version: V, title: 'Enable Event Monitoring Log Storage', requirement: 'Event Monitoring log storage is enabled.', sourceRef: ref('SBS-MON-001'), url: URL, verified: true },
|
|
50
|
+
{ id: 'SBS-MON-002', framework: 'SBS', version: V, title: 'Retaining Event Logs', requirement: 'Event logs are retained for an adequate period.', sourceRef: ref('SBS-MON-002'), url: URL, verified: true },
|
|
51
|
+
{ id: 'SBS-MON-003', framework: 'SBS', version: V, title: 'Monitor for Suspicious Logins', requirement: 'Suspicious logins are monitored and alerted.', sourceRef: ref('SBS-MON-003'), url: URL, verified: true },
|
|
52
|
+
{ id: 'SBS-MON-004', framework: 'SBS', version: V, title: 'Monitor for Suspicious API Activity', requirement: 'Suspicious API activity is monitored and alerted.', sourceRef: ref('SBS-MON-004'), url: URL, verified: true },
|
|
53
|
+
{ id: 'SBS-MON-005', framework: 'SBS', version: V, title: 'Monitor API Usage Against Limits', requirement: 'API usage is monitored against daily and concurrent limits.', sourceRef: ref('SBS-MON-005'), url: URL, verified: true },
|
|
54
|
+
// OAuth Security
|
|
55
|
+
{ id: 'SBS-OAUTH-001', framework: 'SBS', version: V, title: 'Require Formal Installation of Connected Apps', requirement: 'Connected apps require formal installation.', sourceRef: ref('SBS-OAUTH-001'), url: URL, verified: true },
|
|
56
|
+
{ id: 'SBS-OAUTH-002', framework: 'SBS', version: V, title: 'Require Profile or Permission Set Access Control for Connected Apps', requirement: 'Connected apps require profile or permission-set access control (admin-approved users).', sourceRef: ref('SBS-OAUTH-002'), url: URL, verified: true },
|
|
57
|
+
// Security Configuration
|
|
58
|
+
{ id: 'SBS-SECCONF-001', framework: 'SBS', version: V, title: 'Establish a Salesforce Health Check Baseline', requirement: 'A Salesforce Health Check baseline is established.', sourceRef: ref('SBS-SECCONF-001'), url: URL, verified: true },
|
|
59
|
+
{ id: 'SBS-SECCONF-002', framework: 'SBS', version: V, title: 'Review and Remediate Salesforce Health Check Deviations', requirement: 'Health Check deviations from baseline are reviewed and remediated.', sourceRef: ref('SBS-SECCONF-002'), url: URL, verified: true },
|
|
60
|
+
];
|
|
61
|
+
//# sourceMappingURL=sbs.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// SOC 2 Common Criteria (AICPA Trust Services Criteria, 2017 with 2022 revised points of focus).
|
|
2
|
+
// Titles/intent confirmed 2026-06 against the AICPA TSC structure via authoritative secondary
|
|
3
|
+
// sources; the primary AICPA TSC document is the canonical reference. `requirement` is a faithful
|
|
4
|
+
// paraphrase of each criterion.
|
|
5
|
+
const V = 'AICPA TSC 2017 (Common Criteria)';
|
|
6
|
+
const ref = (cc) => `AICPA Trust Services Criteria 2017, ${cc}`;
|
|
7
|
+
export const SOC2_CONTROLS = [
|
|
8
|
+
{ id: 'SOC2-CC6.1', framework: 'SOC2', version: V, title: 'Logical access controls',
|
|
9
|
+
requirement: 'The entity implements logical access security software, infrastructure, and architectures over protected information assets to protect them from security events.',
|
|
10
|
+
sourceRef: ref('CC6.1'), verified: true },
|
|
11
|
+
{ id: 'SOC2-CC6.2', framework: 'SOC2', version: V, title: 'Registration and de-provisioning of users',
|
|
12
|
+
requirement: 'New internal and external users are registered and authorized before being issued credentials; credentials are removed when access is no longer required.',
|
|
13
|
+
sourceRef: ref('CC6.2'), verified: true },
|
|
14
|
+
{ id: 'SOC2-CC6.3', framework: 'SOC2', version: V, title: 'Role-based access and least privilege',
|
|
15
|
+
requirement: 'Access to information assets is authorized and modified based on roles, least privilege, and segregation of duties.',
|
|
16
|
+
sourceRef: ref('CC6.3'), verified: true },
|
|
17
|
+
{ id: 'SOC2-CC6.4', framework: 'SOC2', version: V, title: 'Physical access controls',
|
|
18
|
+
requirement: 'The entity restricts physical access to facilities and protected information assets to authorized personnel. (Generally a data-centre control, not org configuration.)',
|
|
19
|
+
sourceRef: ref('CC6.4'), verified: true },
|
|
20
|
+
{ id: 'SOC2-CC6.6', framework: 'SOC2', version: V, title: 'Boundary protection against external threats',
|
|
21
|
+
requirement: 'The entity implements logical access security measures to protect against threats from sources outside its system boundaries.',
|
|
22
|
+
sourceRef: ref('CC6.6'), verified: true },
|
|
23
|
+
{ id: 'SOC2-CC6.7', framework: 'SOC2', version: V, title: 'Restriction of information transmission and movement',
|
|
24
|
+
requirement: 'The entity restricts the transmission, movement, and removal of information to authorized users and processes, and protects it during transmission.',
|
|
25
|
+
sourceRef: ref('CC6.7'), verified: true },
|
|
26
|
+
{ id: 'SOC2-CC7.1', framework: 'SOC2', version: V, title: 'Detection of configuration changes and vulnerabilities',
|
|
27
|
+
requirement: 'The entity uses detection and monitoring procedures to identify configuration changes and susceptibility to newly discovered vulnerabilities.',
|
|
28
|
+
sourceRef: ref('CC7.1'), verified: true },
|
|
29
|
+
{ id: 'SOC2-CC7.2', framework: 'SOC2', version: V, title: 'Monitoring for anomalies and security events',
|
|
30
|
+
requirement: 'The entity monitors system components for anomalies indicative of malicious acts, errors, or other security events.',
|
|
31
|
+
sourceRef: ref('CC7.2'), verified: true },
|
|
32
|
+
{ id: 'SOC2-CC8.1', framework: 'SOC2', version: V, title: 'Change management',
|
|
33
|
+
requirement: 'Changes to infrastructure, data, software, and procedures are authorized, designed, tested, approved, and implemented under a controlled process.',
|
|
34
|
+
sourceRef: ref('CC8.1'), verified: true },
|
|
35
|
+
{ id: 'SOC2-CC9.1', framework: 'SOC2', version: V, title: 'Risk mitigation for business disruptions',
|
|
36
|
+
requirement: 'The entity identifies, selects, and develops risk mitigation activities for risks arising from potential business disruptions.',
|
|
37
|
+
sourceRef: ref('CC9.1'), verified: true },
|
|
38
|
+
{ id: 'SOC2-CC9.2', framework: 'SOC2', version: V, title: 'Vendor and third-party risk management',
|
|
39
|
+
requirement: 'The entity assesses and manages risks associated with vendors and business partners.',
|
|
40
|
+
sourceRef: ref('CC9.2'), verified: true },
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=soc2.js.map
|