@cclabsnz/sf-audit 1.3.0 → 1.6.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 +193 -12
- package/lib/api/MetadataClient.d.ts +4 -0
- package/lib/api/MetadataClient.js +2 -0
- package/lib/api/MetadataClientImpl.d.ts +8 -0
- package/lib/api/MetadataClientImpl.js +22 -0
- package/lib/api/RestClient.d.ts +2 -0
- package/lib/api/RestClientImpl.d.ts +2 -0
- package/lib/api/RestClientImpl.js +33 -0
- package/lib/apps/analyzeApps.d.ts +8 -0
- package/lib/apps/analyzeApps.js +19 -0
- package/lib/apps/appResolver.d.ts +4 -0
- package/lib/apps/appResolver.js +50 -0
- package/lib/apps/grantedAccess.d.ts +4 -0
- package/lib/apps/grantedAccess.js +36 -0
- package/lib/apps/leastPrivilege.d.ts +6 -0
- package/lib/apps/leastPrivilege.js +47 -0
- package/lib/apps/renderApps.d.ts +5 -0
- package/lib/apps/renderApps.js +23 -0
- package/lib/apps/standardAppCatalog.d.ts +11 -0
- package/lib/apps/standardAppCatalog.js +14 -0
- package/lib/apps/types.d.ts +64 -0
- package/lib/apps/types.js +2 -0
- package/lib/apps/usageCollector.d.ts +9 -0
- package/lib/apps/usageCollector.js +104 -0
- package/lib/chains/CapabilityRegistry.js +19 -0
- package/lib/chains/namedChains.js +67 -0
- package/lib/checks/eventLogAccess.d.ts +14 -0
- package/lib/checks/eventLogAccess.js +33 -0
- package/lib/checks/impl/AgentActionSurfaceCheck.d.ts +13 -0
- package/lib/checks/impl/AgentActionSurfaceCheck.js +125 -0
- package/lib/checks/impl/AgentChannelExposureCheck.d.ts +15 -0
- package/lib/checks/impl/AgentChannelExposureCheck.js +223 -0
- package/lib/checks/impl/AgentInventoryCheck.d.ts +15 -0
- package/lib/checks/impl/AgentInventoryCheck.js +228 -0
- package/lib/checks/impl/AgentMonitoringCoverageCheck.d.ts +12 -0
- package/lib/checks/impl/AgentMonitoringCoverageCheck.js +97 -0
- package/lib/checks/impl/AgentUserPrivilegeCheck.d.ts +13 -0
- package/lib/checks/impl/AgentUserPrivilegeCheck.js +204 -0
- package/lib/checks/impl/AuthProvidersCheck.d.ts +17 -0
- package/lib/checks/impl/AuthProvidersCheck.js +88 -0
- package/lib/checks/impl/ClassicSitesCheck.d.ts +17 -0
- package/lib/checks/impl/ClassicSitesCheck.js +65 -0
- package/lib/checks/impl/CspTrustedSitesCheck.d.ts +1 -0
- package/lib/checks/impl/CspTrustedSitesCheck.js +10 -1
- package/lib/checks/impl/DataExportAccessCheck.d.ts +19 -0
- package/lib/checks/impl/DataExportAccessCheck.js +79 -0
- package/lib/checks/impl/EncryptionCoverageCheck.d.ts +19 -0
- package/lib/checks/impl/EncryptionCoverageCheck.js +108 -0
- package/lib/checks/impl/EventMonitoringCheck.js +8 -5
- package/lib/checks/impl/ExperienceCspCheck.d.ts +18 -0
- package/lib/checks/impl/ExperienceCspCheck.js +57 -0
- package/lib/checks/impl/ExternalCredentialsCheck.d.ts +17 -0
- package/lib/checks/impl/ExternalCredentialsCheck.js +74 -0
- package/lib/checks/impl/GuestApiAccessCheck.d.ts +19 -0
- package/lib/checks/impl/GuestApiAccessCheck.js +113 -0
- package/lib/checks/impl/GuestObjectExposureCheck.d.ts +44 -0
- package/lib/checks/impl/GuestObjectExposureCheck.js +241 -0
- package/lib/checks/impl/GuestRecordAccessPolicyCheck.d.ts +34 -0
- package/lib/checks/impl/GuestRecordAccessPolicyCheck.js +120 -0
- package/lib/checks/impl/GuestSiteOptionsCheck.d.ts +18 -0
- package/lib/checks/impl/GuestSiteOptionsCheck.js +92 -0
- package/lib/checks/impl/GuestTrafficAnomalyCheck.d.ts +23 -0
- package/lib/checks/impl/GuestTrafficAnomalyCheck.js +343 -0
- package/lib/checks/impl/LoginAccessPolicyCheck.d.ts +26 -0
- package/lib/checks/impl/LoginAccessPolicyCheck.js +117 -0
- package/lib/checks/impl/LoginAnomalyCheck.d.ts +17 -0
- package/lib/checks/impl/LoginAnomalyCheck.js +98 -0
- package/lib/checks/impl/SandboxDataMaskingCheck.d.ts +17 -0
- package/lib/checks/impl/SandboxDataMaskingCheck.js +85 -0
- package/lib/checks/impl/SessionHardeningCheck.d.ts +21 -0
- package/lib/checks/impl/SessionHardeningCheck.js +134 -0
- package/lib/checks/impl/ThreatDetectionCheck.d.ts +17 -0
- package/lib/checks/impl/ThreatDetectionCheck.js +91 -0
- package/lib/checks/impl/TrustedUrlHygieneCheck.d.ts +16 -0
- package/lib/checks/impl/TrustedUrlHygieneCheck.js +198 -0
- package/lib/checks/registry.js +52 -0
- package/lib/commands/audit/apps.d.ts +16 -0
- package/lib/commands/audit/apps.js +64 -0
- package/lib/commands/audit/diff.js +9 -5
- package/lib/commands/audit/events/pull.d.ts +17 -0
- package/lib/commands/audit/events/pull.js +88 -0
- package/lib/commands/audit/security.d.ts +5 -0
- package/lib/commands/audit/security.js +47 -17
- package/lib/compliance/catalogs/index.js +2 -0
- package/lib/compliance/catalogs/owaspLlm.d.ts +3 -0
- package/lib/compliance/catalogs/owaspLlm.js +34 -0
- package/lib/compliance/mapping.js +46 -7
- package/lib/compliance/resolve.js +4 -3
- package/lib/compliance/types.d.ts +1 -1
- package/lib/context/AuditCache.d.ts +31 -0
- package/lib/context/AuditContext.d.ts +6 -0
- package/lib/events/EventBaselineStore.d.ts +16 -0
- package/lib/events/EventBaselineStore.js +55 -0
- package/lib/events/eventLogQuery.d.ts +21 -0
- package/lib/events/eventLogQuery.js +34 -0
- package/lib/events/pullEventLogs.d.ts +51 -0
- package/lib/events/pullEventLogs.js +79 -0
- package/lib/findings/CheckMeta.js +22 -0
- package/lib/lib/wire.d.ts +4 -2
- package/lib/lib/wire.js +5 -1
- package/lib/renderers/ClientReportRenderer.js +1 -1
- package/package.json +16 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import type { AppFinding } from '../../apps/types.js';
|
|
3
|
+
export default class AuditAppsCommand extends SfCommand<AppFinding[]> {
|
|
4
|
+
static summary: string;
|
|
5
|
+
static description: string;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static flags: {
|
|
8
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
since: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
from: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
soak: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<AppFinding[]>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { readFileSync, readdirSync, unlinkSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
4
|
+
import { resolveOrgInfo, buildAuditContext } from '../../lib/wire.js';
|
|
5
|
+
import { analyzeApps } from '../../apps/analyzeApps.js';
|
|
6
|
+
import { renderJson, renderMarkdown, renderTable } from '../../apps/renderApps.js';
|
|
7
|
+
export default class AuditAppsCommand extends SfCommand {
|
|
8
|
+
static summary = 'Report connected apps that are granted more access than they use';
|
|
9
|
+
static description = 'Reads the RestApi EventLogFile to see which objects each connected app actually touches, compares that ' +
|
|
10
|
+
'against the access its run-as user is granted, and reports the over-grant per object and read/write bit, ' +
|
|
11
|
+
'plus a suggested least-privilege permission set. Read-only. "Used" is a lower bound (RestApi attributes ' +
|
|
12
|
+
'roughly half of API traffic), so revoke recommendations are suppressed below a soak window.';
|
|
13
|
+
static examples = [
|
|
14
|
+
'<%= config.bin %> <%= command.id %> --target-org myOrg --since 7',
|
|
15
|
+
'<%= config.bin %> <%= command.id %> --target-org myOrg --from ~/.sf/event-baseline/00Dxxx',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> --target-org myOrg --format json',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
'target-org': Flags.requiredOrg(),
|
|
20
|
+
since: Flags.integer({ summary: 'Days of RestApi log to analyze.', default: 7, helpValue: '7' }),
|
|
21
|
+
from: Flags.string({ summary: 'Read RestApi CSVs from a local events-pull baseline dir instead of downloading.', helpValue: './baseline' }),
|
|
22
|
+
soak: Flags.integer({ summary: 'Minimum window (days) before asserting revoke recommendations.', default: 7 }),
|
|
23
|
+
format: Flags.string({ summary: 'Output format.', options: ['table', 'json', 'md'], default: 'table' }),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
const { flags } = await this.parse(AuditAppsCommand);
|
|
27
|
+
const conn = flags['target-org'].getConnection('62.0');
|
|
28
|
+
const orgInfo = await resolveOrgInfo(conn);
|
|
29
|
+
const ctx = buildAuditContext(conn, orgInfo);
|
|
30
|
+
let restApiCsv = '';
|
|
31
|
+
if (flags.from) {
|
|
32
|
+
// Concatenate any RestApi CSVs found under the baseline dir.
|
|
33
|
+
const dir = join(flags.from, 'RestApi');
|
|
34
|
+
try {
|
|
35
|
+
restApiCsv = readdirSync(dir).filter((f) => f.endsWith('.csv')).map((f) => readFileSync(join(dir, f), 'utf-8')).join('\n');
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
this.error(`No RestApi logs under ${dir}. Run "sf audit events pull" first, or drop --from to download.`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const rows = await ctx.soql.queryAll(`SELECT Id FROM EventLogFile WHERE EventType = 'RestApi' AND LogDate = LAST_N_DAYS:${flags.since} ORDER BY LogDate DESC`);
|
|
43
|
+
for (const r of rows) {
|
|
44
|
+
// Stream each RestApi log to a temp file and read it back (getRawToFile never buffers the body).
|
|
45
|
+
const tmp = join(process.env.TMPDIR ?? '/tmp', `sfaudit-restapi-${r.Id}.csv`);
|
|
46
|
+
await ctx.rest.getRawToFile(`/sobjects/EventLogFile/${r.Id}/LogFile`, tmp);
|
|
47
|
+
try {
|
|
48
|
+
restApiCsv += '\n' + readFileSync(tmp, 'utf-8');
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
try {
|
|
52
|
+
unlinkSync(tmp);
|
|
53
|
+
}
|
|
54
|
+
catch { /* ignore if already gone */ }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const findings = await analyzeApps(restApiCsv, ctx.soql, { since: flags.since, soakDays: flags.soak });
|
|
59
|
+
const out = flags.format === 'json' ? renderJson(findings) : flags.format === 'md' ? renderMarkdown(findings) : renderTable(findings);
|
|
60
|
+
this.log(out);
|
|
61
|
+
return findings;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=apps.js.map
|
|
@@ -43,16 +43,20 @@ export default class AuditDiffCommand extends SfCommand {
|
|
|
43
43
|
this.warn(`Org IDs differ: baseline=${baseline.orgId}, current=${current.orgId}. Continuing anyway.`);
|
|
44
44
|
}
|
|
45
45
|
const diff = computeDiff(baseline, current);
|
|
46
|
-
const formats = flags.format.split(',').map((f) => f.trim());
|
|
46
|
+
const formats = flags.format.split(',').map((f) => f.trim()).filter(Boolean);
|
|
47
|
+
const bad = formats.filter((f) => !DIFF_RENDERERS[f]);
|
|
48
|
+
if (bad.length > 0 || formats.length === 0) {
|
|
49
|
+
this.error(bad.length > 0 ? `Unknown output format(s): ${bad.join(', ')}` : 'No output format specified.', {
|
|
50
|
+
suggestions: ['Valid formats: html, json'],
|
|
51
|
+
});
|
|
52
|
+
}
|
|
47
53
|
const baseTs = baseline.generatedAt.getTime();
|
|
48
54
|
const curTs = current.generatedAt.getTime();
|
|
49
55
|
fs.mkdirSync(flags.output, { recursive: true });
|
|
50
56
|
for (const format of formats) {
|
|
51
57
|
const renderer = DIFF_RENDERERS[format];
|
|
52
|
-
if (!renderer)
|
|
53
|
-
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
58
|
+
if (!renderer)
|
|
59
|
+
continue; // unreachable: validated above
|
|
56
60
|
const filename = `sf-audit-diff-${baseline.orgId}-${baseTs}-vs-${curTs}${renderer.fileExtension}`;
|
|
57
61
|
const outputPath = path.join(flags.output, filename);
|
|
58
62
|
fs.writeFileSync(outputPath, renderer.render(diff), 'utf-8');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type EventsPullResult } from '../../../events/pullEventLogs.js';
|
|
3
|
+
export default class AuditEventsPullCommand extends SfCommand<EventsPullResult> {
|
|
4
|
+
static summary: string;
|
|
5
|
+
static description: string;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static flags: {
|
|
8
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
since: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
types: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<EventsPullResult>;
|
|
14
|
+
private accessMessage;
|
|
15
|
+
private printSummary;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=pull.d.ts.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// src/commands/audit/events/pull.ts
|
|
2
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { buildAuditContext, resolveOrgInfo } from '../../../lib/wire.js';
|
|
4
|
+
import { EventBaselineStore } from '../../../events/EventBaselineStore.js';
|
|
5
|
+
import { pullEventLogs } from '../../../events/pullEventLogs.js';
|
|
6
|
+
import { sanitizeTypes } from '../../../events/eventLogQuery.js';
|
|
7
|
+
export default class AuditEventsPullCommand extends SfCommand {
|
|
8
|
+
static summary = 'Capture free EventLogFile daily logs to local disk';
|
|
9
|
+
static description = 'Downloads the org\'s free (Daily-interval) EventLogFile CSV logs to ~/.sf/event-baseline/{orgId} so they ' +
|
|
10
|
+
'survive the free tier\'s ~1-day retention window. Read-only (GET only). Idempotent: rows already saved are ' +
|
|
11
|
+
'skipped, so it is safe to run daily via cron or a scheduled GitHub Action to build a rolling local baseline ' +
|
|
12
|
+
'of login, API, and error activity without the paid Event Monitoring / Shield add-on.';
|
|
13
|
+
static examples = [
|
|
14
|
+
'<%= config.bin %> <%= command.id %> --target-org myOrg',
|
|
15
|
+
'<%= config.bin %> <%= command.id %> --target-org myOrg --since 3',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> --target-org myOrg --types Login,ApiTotalUsage',
|
|
17
|
+
'<%= config.bin %> <%= command.id %> --target-org myOrg --output ./event-baseline',
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
'target-org': Flags.requiredOrg(),
|
|
21
|
+
since: Flags.integer({
|
|
22
|
+
summary: 'Number of days of LogDate to request (LAST_N_DAYS window).',
|
|
23
|
+
default: 1,
|
|
24
|
+
helpValue: '1',
|
|
25
|
+
}),
|
|
26
|
+
types: Flags.string({
|
|
27
|
+
summary: 'Restrict to specific EventTypes (comma-separated). Omit to pull every available type.',
|
|
28
|
+
helpValue: 'Login,ApiTotalUsage',
|
|
29
|
+
}),
|
|
30
|
+
output: Flags.string({
|
|
31
|
+
char: 'o',
|
|
32
|
+
summary: 'Base directory to store logs under. Defaults to ~/.sf/event-baseline.',
|
|
33
|
+
helpValue: './event-baseline',
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
async run() {
|
|
37
|
+
const { flags } = await this.parse(AuditEventsPullCommand);
|
|
38
|
+
const conn = flags['target-org'].getConnection('62.0');
|
|
39
|
+
const orgInfo = await resolveOrgInfo(conn);
|
|
40
|
+
const ctx = buildAuditContext(conn, orgInfo);
|
|
41
|
+
const store = new EventBaselineStore(flags.output);
|
|
42
|
+
const types = sanitizeTypes(flags.types);
|
|
43
|
+
this.log(`Pulling free EventLogFile logs for org: ${orgInfo.name} (${orgInfo.id})`);
|
|
44
|
+
if (types.length > 0)
|
|
45
|
+
this.log(`Restricting to event type(s): ${types.join(', ')}`);
|
|
46
|
+
const result = await pullEventLogs({ soql: ctx.soql, rest: ctx.rest, store, orgId: orgInfo.id }, { since: flags.since, types, warn: (msg) => this.warn(msg) });
|
|
47
|
+
if (result.accessError) {
|
|
48
|
+
this.warn(this.accessMessage(result.accessError));
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
if (result.found === 0) {
|
|
52
|
+
this.log(`No EventLogFile records found for the last ${flags.since} day(s). Free daily logs need ` +
|
|
53
|
+
'Enterprise/Unlimited/Performance edition and appear ~24h after the activity.');
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
this.printSummary(result);
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
accessMessage(access) {
|
|
60
|
+
switch (access) {
|
|
61
|
+
case 'no-permission':
|
|
62
|
+
return ('EventLogFile is not readable by this org user: the "View Event Log Files" permission is missing. ' +
|
|
63
|
+
'Grant it to the running user and re-run.');
|
|
64
|
+
case 'not-enabled':
|
|
65
|
+
return ('EventLogFile is not available on this org/edition. Free daily logs require Enterprise/Unlimited/' +
|
|
66
|
+
'Performance edition (Developer Edition also exposes them); other editions need the Event Monitoring add-on.');
|
|
67
|
+
default:
|
|
68
|
+
return 'EventLogFile could not be queried. Verify the org connection and that EventLogFile is accessible.';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
printSummary(result) {
|
|
72
|
+
this.log('');
|
|
73
|
+
this.log('─────────────────────────────');
|
|
74
|
+
this.log(' Event Baseline Pull');
|
|
75
|
+
this.log('─────────────────────────────');
|
|
76
|
+
this.log(` Found ${String(result.found).padStart(4)}`);
|
|
77
|
+
this.log(` Downloaded ${String(result.downloaded).padStart(4)}`);
|
|
78
|
+
this.log(` Skipped ${String(result.skipped).padStart(4)} (already saved)`);
|
|
79
|
+
if (result.failed > 0)
|
|
80
|
+
this.log(` Failed ${String(result.failed).padStart(4)}`);
|
|
81
|
+
this.log(` Total bytes ${String(result.totalBytes).padStart(4)}`);
|
|
82
|
+
this.log('─────────────────────────────');
|
|
83
|
+
this.log(` Saved to: ${result.storagePath}`);
|
|
84
|
+
if (result.manifestPath)
|
|
85
|
+
this.log(` Manifest: ${result.manifestPath}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=pull.js.map
|
|
@@ -15,8 +15,13 @@ export default class SecurityAuditCommand extends SfCommand<AuditResult> {
|
|
|
15
15
|
branding: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
16
|
top: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
frameworks: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'resolve-domains': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
19
|
};
|
|
19
20
|
run(): Promise<AuditResult>;
|
|
21
|
+
/** Resolve --checks to the checks to run, erroring on any unknown ID. */
|
|
22
|
+
private resolveChecks;
|
|
23
|
+
/** Resolve --format to a validated list, erroring on any unknown format. */
|
|
24
|
+
private resolveFormats;
|
|
20
25
|
private rendererFor;
|
|
21
26
|
private printSummary;
|
|
22
27
|
private handleFailOn;
|
|
@@ -29,7 +29,7 @@ export default class SecurityAuditCommand extends SfCommand {
|
|
|
29
29
|
'target-org': Flags.requiredOrg(),
|
|
30
30
|
format: Flags.string({
|
|
31
31
|
char: 'f',
|
|
32
|
-
summary: 'Output format(s), comma-separated: html, md, json',
|
|
32
|
+
summary: 'Output format(s), comma-separated: html, md, json, executive',
|
|
33
33
|
default: 'html',
|
|
34
34
|
}),
|
|
35
35
|
output: Flags.string({
|
|
@@ -64,22 +64,23 @@ export default class SecurityAuditCommand extends SfCommand {
|
|
|
64
64
|
summary: 'Compliance frameworks for the executive matrix: universal | nz | all | a comma list (executive format).',
|
|
65
65
|
default: 'universal',
|
|
66
66
|
}),
|
|
67
|
+
'resolve-domains': Flags.boolean({
|
|
68
|
+
summary: 'Make outbound DNS queries from this machine to verify CSP trusted domains resolve. Off by default; default runs contact only the target org.',
|
|
69
|
+
default: false,
|
|
70
|
+
}),
|
|
67
71
|
};
|
|
68
72
|
async run() {
|
|
69
73
|
const { flags } = await this.parse(SecurityAuditCommand);
|
|
74
|
+
// Validate the selection and output formats up front, so a typo fails fast with
|
|
75
|
+
// a clear message instead of silently running a partial/empty audit or writing
|
|
76
|
+
// no report after the (potentially long) run completes.
|
|
77
|
+
const checksToRun = this.resolveChecks(flags.checks);
|
|
78
|
+
const formats = this.resolveFormats(flags.format);
|
|
70
79
|
const conn = flags['target-org'].getConnection('62.0');
|
|
71
80
|
const orgInfo = await resolveOrgInfo(conn);
|
|
72
|
-
const ctx = buildAuditContext(conn, orgInfo
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const ids = new Set(flags.checks.split(',').map((s) => s.trim()));
|
|
76
|
-
const unknown = [...ids].filter((id) => !CHECKS.some((c) => c.id === id));
|
|
77
|
-
if (unknown.length > 0) {
|
|
78
|
-
this.warn(`Unknown check ID(s): ${unknown.join(', ')}. Run 'sf audit list' to see available checks.`);
|
|
79
|
-
}
|
|
80
|
-
return CHECKS.filter((c) => ids.has(c.id));
|
|
81
|
-
})()
|
|
82
|
-
: CHECKS;
|
|
81
|
+
const ctx = buildAuditContext(conn, orgInfo, {
|
|
82
|
+
resolveDomains: flags['resolve-domains'],
|
|
83
|
+
});
|
|
83
84
|
const knownCheckIds = new Set(CHECKS.map((c) => c.id));
|
|
84
85
|
const scoringConfig = loadScoringConfig(flags['scoring-config'], knownCheckIds, (msg) => this.warn(msg));
|
|
85
86
|
this.log(`Auditing org: ${orgInfo.name} (${orgInfo.id})`);
|
|
@@ -89,14 +90,11 @@ export default class SecurityAuditCommand extends SfCommand {
|
|
|
89
90
|
const result = await engine.run((current, total, checkName) => {
|
|
90
91
|
this.log(`[${String(current).padStart(2)}/${total}] ${checkName}`);
|
|
91
92
|
});
|
|
92
|
-
const formats = flags.format.split(',').map((f) => f.trim());
|
|
93
93
|
fs.mkdirSync(flags.output, { recursive: true });
|
|
94
94
|
for (const format of formats) {
|
|
95
95
|
const renderer = this.rendererFor(format, flags);
|
|
96
|
-
if (!renderer)
|
|
97
|
-
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
96
|
+
if (!renderer)
|
|
97
|
+
continue; // unreachable: formats validated up front
|
|
100
98
|
const output = renderer.render(result);
|
|
101
99
|
const prefix = renderer.filenamePrefix ?? 'sf-audit';
|
|
102
100
|
const filename = `${prefix}-${orgInfo.id}-${Date.now()}${renderer.fileExtension}`;
|
|
@@ -114,6 +112,38 @@ export default class SecurityAuditCommand extends SfCommand {
|
|
|
114
112
|
}
|
|
115
113
|
return result;
|
|
116
114
|
}
|
|
115
|
+
/** Resolve --checks to the checks to run, erroring on any unknown ID. */
|
|
116
|
+
resolveChecks(raw) {
|
|
117
|
+
if (!raw)
|
|
118
|
+
return CHECKS;
|
|
119
|
+
const ids = raw.split(',').map((s) => s.trim()).filter(Boolean);
|
|
120
|
+
const unknown = ids.filter((id) => !CHECKS.some((c) => c.id === id));
|
|
121
|
+
if (unknown.length > 0) {
|
|
122
|
+
this.error(`Unknown check ID(s): ${unknown.join(', ')}`, {
|
|
123
|
+
suggestions: ["Run 'sf audit list' to see all valid check IDs."],
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const set = new Set(ids);
|
|
127
|
+
const selected = CHECKS.filter((c) => set.has(c.id));
|
|
128
|
+
if (selected.length === 0) {
|
|
129
|
+
this.error('No checks were selected by --checks.', {
|
|
130
|
+
suggestions: ["Run 'sf audit list' to see valid check IDs, or omit --checks to run all."],
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return selected;
|
|
134
|
+
}
|
|
135
|
+
/** Resolve --format to a validated list, erroring on any unknown format. */
|
|
136
|
+
resolveFormats(raw) {
|
|
137
|
+
const valid = ['html', 'md', 'json', 'executive'];
|
|
138
|
+
const formats = raw.split(',').map((f) => f.trim()).filter(Boolean);
|
|
139
|
+
const bad = formats.filter((f) => !valid.includes(f));
|
|
140
|
+
if (bad.length > 0 || formats.length === 0) {
|
|
141
|
+
this.error(bad.length > 0 ? `Unknown output format(s): ${bad.join(', ')}` : 'No output format specified.', {
|
|
142
|
+
suggestions: [`Valid formats: ${valid.join(', ')}`],
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return formats;
|
|
146
|
+
}
|
|
117
147
|
rendererFor(format, flags) {
|
|
118
148
|
if (format === 'executive') {
|
|
119
149
|
let overrides;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OWASP_CONTROLS } from './owasp.js';
|
|
2
|
+
import { OWASP_LLM_CONTROLS } from './owaspLlm.js';
|
|
2
3
|
import { SOC2_CONTROLS } from './soc2.js';
|
|
3
4
|
import { ISO27001_CONTROLS } from './iso27001.js';
|
|
4
5
|
import { SBS_CONTROLS } from './sbs.js';
|
|
@@ -7,6 +8,7 @@ import { HISO10029_CONTROLS } from './hiso10029.js';
|
|
|
7
8
|
import { NZISM_CONTROLS } from './nzism.js';
|
|
8
9
|
export const ALL_CONTROLS = [
|
|
9
10
|
...OWASP_CONTROLS,
|
|
11
|
+
...OWASP_LLM_CONTROLS,
|
|
10
12
|
...SOC2_CONTROLS,
|
|
11
13
|
...ISO27001_CONTROLS,
|
|
12
14
|
...SBS_CONTROLS,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// OWASP Top 10 for Large Language Model Applications, 2025 edition.
|
|
2
|
+
// Ids and titles verified 2026-07 against the official list: https://genai.owasp.org/llm-top-10/
|
|
3
|
+
// Only the risks that a read-only Salesforce/Agentforce config audit can speak to are
|
|
4
|
+
// catalogued here; the remaining 2025 entries (LLM03 Supply Chain, LLM04 Data & Model
|
|
5
|
+
// Poisoning, LLM07 System Prompt Leakage, LLM08 Vector & Embedding Weaknesses, LLM09
|
|
6
|
+
// Misinformation, LLM10 Unbounded Consumption) concern model/training/runtime behaviour that
|
|
7
|
+
// is not observable from org metadata, so they are intentionally omitted rather than mapped
|
|
8
|
+
// weakly — the same discipline OWASP web A04 (Insecure Design) is treated with in owasp.ts.
|
|
9
|
+
const V = 'OWASP Top 10 for LLM Applications 2025';
|
|
10
|
+
const ref = (id) => `OWASP Top 10 for LLM Applications 2025, ${id}`;
|
|
11
|
+
const url = 'https://genai.owasp.org/llm-top-10/';
|
|
12
|
+
export const OWASP_LLM_CONTROLS = [
|
|
13
|
+
{ id: 'LLM01', framework: 'OWASP_LLM', version: V, title: 'Prompt Injection',
|
|
14
|
+
requirement: 'User or content-supplied input can alter an LLM application\'s behaviour or outputs in unintended, ' +
|
|
15
|
+
'attacker-controlled ways. Untrusted input paths to an agent (public channels) and the destinations ' +
|
|
16
|
+
'that injected output can reach (allowlisted egress domains) are constrained and reviewed.',
|
|
17
|
+
sourceRef: ref('LLM01'), url, verified: true },
|
|
18
|
+
{ id: 'LLM02', framework: 'OWASP_LLM', version: V, title: 'Sensitive Information Disclosure',
|
|
19
|
+
requirement: 'The LLM application must not expose sensitive data through its outputs, and misuse that leads to such ' +
|
|
20
|
+
'disclosure must be detectable. Access to sensitive data by the agent identity is minimised and agent ' +
|
|
21
|
+
'activity is captured so exfiltration can be detected and investigated.',
|
|
22
|
+
sourceRef: ref('LLM02'), url, verified: true },
|
|
23
|
+
{ id: 'LLM05', framework: 'OWASP_LLM', version: V, title: 'Improper Output Handling',
|
|
24
|
+
requirement: 'LLM-generated output is validated and safely handled by downstream components rather than trusted ' +
|
|
25
|
+
'implicitly. Channels that agent output can be sent to (e.g. CSP-trusted / allowlisted domains) are ' +
|
|
26
|
+
'owned, current, and expected, so output cannot be routed to an attacker-controlled destination.',
|
|
27
|
+
sourceRef: ref('LLM05'), url, verified: true },
|
|
28
|
+
{ id: 'LLM06', framework: 'OWASP_LLM', version: V, title: 'Excessive Agency',
|
|
29
|
+
requirement: 'An LLM-based system is granted only the functionality, permissions, and autonomy it strictly needs. ' +
|
|
30
|
+
'The agent\'s run-as identity is least-privilege and its action surface (especially write-capable ' +
|
|
31
|
+
'actions) is minimal, inventoried, and reviewed.',
|
|
32
|
+
sourceRef: ref('LLM06'), url, verified: true },
|
|
33
|
+
];
|
|
34
|
+
//# sourceMappingURL=owaspLlm.js.map
|
|
@@ -71,6 +71,41 @@ const BASE_CHECK_CONTROL_MAP = {
|
|
|
71
71
|
'public-content-exposure': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.14'],
|
|
72
72
|
'privileged-access': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.5.18', 'SBS-ACS-004'],
|
|
73
73
|
'separation-of-duties': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.5.18', 'SBS-ACS-004'],
|
|
74
|
+
'guest-object-exposure': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.18', 'SBS-CPORTAL-002'],
|
|
75
|
+
'guest-site-options': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.14', 'SBS-CPORTAL-003'],
|
|
76
|
+
'guest-record-access-policy': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.18', 'SBS-CPORTAL-002'],
|
|
77
|
+
'guest-traffic-anomaly': ['OWASP-A09', 'SOC2-CC7.2', 'ISO-A.8.15', 'SBS-MON-003'],
|
|
78
|
+
'threat-detection': ['OWASP-A09', 'SOC2-CC7.2', 'ISO-A.8.15', 'SBS-MON-001'],
|
|
79
|
+
'login-access-policy': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.5.18', 'SBS-ACS-004'],
|
|
80
|
+
'data-export-access': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.8.3'],
|
|
81
|
+
'classic-sites': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.8.3', 'SBS-CPORTAL-003'],
|
|
82
|
+
'auth-providers': ['OWASP-A07', 'SOC2-CC6.1', 'ISO-A.8.3', 'SBS-AUTH-001'],
|
|
83
|
+
'guest-api-access': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.18', 'SBS-CPORTAL-002'],
|
|
84
|
+
'external-credentials': ['OWASP-A02', 'SOC2-CC6.7', 'ISO-A.8.3', 'SBS-INT-003'],
|
|
85
|
+
'login-anomaly': ['OWASP-A09', 'SOC2-CC7.2', 'ISO-A.8.15', 'SBS-MON-003'],
|
|
86
|
+
'session-hardening': ['OWASP-A05', 'SOC2-CC6.1', 'ISO-A.8.26'],
|
|
87
|
+
'encryption-coverage': ['OWASP-A02', 'SOC2-CC6.1', 'ISO-A.8.24'],
|
|
88
|
+
'experience-csp': ['OWASP-A05', 'SOC2-CC6.6', 'ISO-A.8.26'],
|
|
89
|
+
'sandbox-data-masking': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.12'],
|
|
90
|
+
// AI & Agents (v1.5). Each agent check carries its web-OWASP / SOC2 / ISO governance
|
|
91
|
+
// control(s) plus the OWASP LLM Top 10 (2025) risk it maps to. LLM ids/titles are the real
|
|
92
|
+
// 2025 edition (see catalogs/owaspLlm.ts). Rationale is inline per check:
|
|
93
|
+
// LLM01 Prompt Injection — untrusted input path (public channel) or the egress a
|
|
94
|
+
// payload leaves through (allowlisted domain).
|
|
95
|
+
// LLM02 Sensitive Info Disclose — undetected agent-driven exfiltration (monitoring gap).
|
|
96
|
+
// LLM05 Improper Output Handling — agent output routed to an unowned/parked destination
|
|
97
|
+
// (the ForcedLeak exfil channel; this was "Insecure Output
|
|
98
|
+
// Handling / LLM02" in the 2023 list, renumbered to LLM05
|
|
99
|
+
// in 2025 — we map to the 2025 id honestly).
|
|
100
|
+
// LLM06 Excessive Agency — over-broad run-as identity or write-capable action surface.
|
|
101
|
+
// agent-inventory keeps its access-governance base and adds LLM06 (inventorying agent
|
|
102
|
+
// identities + run-as access is the foundation of least-agency).
|
|
103
|
+
'agent-inventory': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.5.18', 'LLM06'],
|
|
104
|
+
'agent-user-privilege': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.5.18', 'LLM06'],
|
|
105
|
+
'agent-action-surface': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.8.3', 'LLM06'],
|
|
106
|
+
'agent-channel-exposure': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.8.3', 'LLM01'],
|
|
107
|
+
'agent-monitoring-coverage': ['OWASP-A09', 'SOC2-CC7.2', 'ISO-A.8.15', 'LLM02'],
|
|
108
|
+
'trusted-url-hygiene': ['OWASP-A05', 'OWASP-A10', 'SOC2-CC6.6', 'ISO-A.8.26', 'LLM01', 'LLM05'],
|
|
74
109
|
};
|
|
75
110
|
// NZ pack crosswalk — each check belongs to one domain; the domain's NZ control ids are
|
|
76
111
|
// layered onto its base entry. HISO/NZISM are domain/chapter-level drafts; Privacy Act IPPs
|
|
@@ -81,25 +116,29 @@ const NZ_CROSSWALK = [
|
|
|
81
116
|
'field-level-security', 'standard-profiles', 'api-client-permission', 'integration-users',
|
|
82
117
|
'escalation-perms', 'report-folder-access', 'apex-crud-fls', 'apex-rest-endpoint',
|
|
83
118
|
'guest-executable-apex', 'experience-cloud-site', 'content-links', 'apex-sharing', 'flows-without-sharing',
|
|
84
|
-
'public-content-exposure', 'privileged-access', 'separation-of-duties'
|
|
119
|
+
'public-content-exposure', 'privileged-access', 'separation-of-duties',
|
|
120
|
+
'guest-object-exposure', 'guest-site-options', 'guest-record-access-policy',
|
|
121
|
+
'login-access-policy', 'data-export-access', 'classic-sites', 'guest-api-access'] },
|
|
85
122
|
{ controls: ['HISO-AUTH', 'NZISM-AUTH', 'PRIVACY-IPP5'],
|
|
86
123
|
checks: ['login-session', 'ip-restrictions', 'password-session-policy', 'sso-enforcement', 'mfa-enforcement',
|
|
87
124
|
'trusted-ip-ranges', 'my-domain-login-policy', 'high-assurance-session', 'internal-user-mfa',
|
|
88
|
-
'mfa-registration', 'mfa-method-strength', 'failed-login-detection', 'enhanced-domains'
|
|
125
|
+
'mfa-registration', 'mfa-method-strength', 'failed-login-detection', 'enhanced-domains',
|
|
126
|
+
'auth-providers'] },
|
|
89
127
|
{ controls: ['HISO-CRYPTO', 'NZISM-CRYPTO', 'PRIVACY-IPP5'],
|
|
90
|
-
checks: ['named-credentials', 'hardcoded-credentials', 'custom-settings', 'certificate-expiry', 'custom-labels-credential'] },
|
|
128
|
+
checks: ['named-credentials', 'hardcoded-credentials', 'custom-settings', 'certificate-expiry', 'custom-labels-credential', 'external-credentials', 'encryption-coverage'] },
|
|
91
129
|
{ controls: ['HISO-LOG', 'NZISM-LOG'],
|
|
92
130
|
checks: ['audit-trail', 'apex-logging', 'event-monitoring', 'siem-integration', 'anonymous-apex-audit',
|
|
93
|
-
'debug-log-access', 'transaction-security-policy'
|
|
131
|
+
'debug-log-access', 'transaction-security-policy', 'threat-detection', 'guest-traffic-anomaly',
|
|
132
|
+
'login-anomaly'] },
|
|
94
133
|
{ controls: ['HISO-DEV', 'NZISM-SW'],
|
|
95
134
|
checks: ['code-security', 'visualforce-xss', 'scheduled-apex'] },
|
|
96
135
|
{ controls: ['HISO-COMM', 'NZISM-NET', 'PRIVACY-IPP12'],
|
|
97
136
|
checks: ['remote-sites', 'csp-trusted-sites', 'connected-apps', 'connected-app-scope', 'connected-app-inactivity', 'cors-allowlist',
|
|
98
|
-
'email-security', 'outbound-messages'] },
|
|
137
|
+
'email-security', 'outbound-messages', 'experience-csp'] },
|
|
99
138
|
{ controls: ['HISO-DATA', 'PRIVACY-IPP5'],
|
|
100
|
-
checks: ['data-classification', 'field-history-tracking'] },
|
|
139
|
+
checks: ['data-classification', 'field-history-tracking', 'sandbox-data-masking'] },
|
|
101
140
|
{ controls: ['HISO-GOV', 'NZISM-CONFIG'],
|
|
102
|
-
checks: ['health-check', 'api-limits', 'release-updates', 'legacy-api-version', 'installed-packages', 'deployment-identity'] },
|
|
141
|
+
checks: ['health-check', 'api-limits', 'release-updates', 'legacy-api-version', 'installed-packages', 'deployment-identity', 'session-hardening'] },
|
|
103
142
|
{ controls: ['PRIVACY-IPP9'],
|
|
104
143
|
checks: ['inactive-users'] },
|
|
105
144
|
];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CHECK_CONTROL_MAP } from './mapping.js';
|
|
2
2
|
import { getControl } from './catalogs/index.js';
|
|
3
3
|
const PACKS = {
|
|
4
|
-
universal: ['OWASP', 'SOC2', 'ISO27001'],
|
|
4
|
+
universal: ['OWASP', 'OWASP_LLM', 'SOC2', 'ISO27001'],
|
|
5
5
|
nz: ['ISO27001', 'HISO10029', 'PRIVACY_ACT', 'NZISM'],
|
|
6
|
-
all: ['OWASP', 'SOC2', 'ISO27001', 'SBS', 'HISO10029', 'PRIVACY_ACT', 'NZISM', 'HIPAA', 'GDPR'],
|
|
6
|
+
all: ['OWASP', 'OWASP_LLM', 'SOC2', 'ISO27001', 'SBS', 'HISO10029', 'PRIVACY_ACT', 'NZISM', 'HIPAA', 'GDPR'],
|
|
7
7
|
};
|
|
8
8
|
export function packFrameworks(pack) {
|
|
9
9
|
return PACKS[pack];
|
|
@@ -29,7 +29,8 @@ export function getComplianceTags(checkId) {
|
|
|
29
29
|
return CHECK_CONTROL_MAP[checkId] ?? [];
|
|
30
30
|
}
|
|
31
31
|
const ALIAS = {
|
|
32
|
-
owasp: 'OWASP',
|
|
32
|
+
owasp: 'OWASP', 'owasp-llm': 'OWASP_LLM', llm: 'OWASP_LLM',
|
|
33
|
+
soc2: 'SOC2', iso: 'ISO27001', iso27001: 'ISO27001', sbs: 'SBS',
|
|
33
34
|
privacy: 'PRIVACY_ACT', 'privacy-act': 'PRIVACY_ACT', hiso: 'HISO10029', nzism: 'NZISM',
|
|
34
35
|
hipaa: 'HIPAA', gdpr: 'GDPR',
|
|
35
36
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Framework = 'OWASP' | 'SOC2' | 'ISO27001' | 'SBS' | 'HISO10029' | 'PRIVACY_ACT' | 'NZISM' | 'HIPAA' | 'GDPR';
|
|
1
|
+
export type Framework = 'OWASP' | 'OWASP_LLM' | 'SOC2' | 'ISO27001' | 'SBS' | 'HISO10029' | 'PRIVACY_ACT' | 'NZISM' | 'HIPAA' | 'GDPR';
|
|
2
2
|
export interface ControlDef {
|
|
3
3
|
id: string;
|
|
4
4
|
framework: Framework;
|
|
@@ -12,10 +12,37 @@ export interface VfPageBody {
|
|
|
12
12
|
name: string;
|
|
13
13
|
markup: string;
|
|
14
14
|
}
|
|
15
|
+
export type EventLogAccess = 'no-permission' | 'not-enabled' | 'unknown';
|
|
15
16
|
export interface EventLogSummary {
|
|
16
17
|
earliestDate: string | null;
|
|
17
18
|
totalFiles: number;
|
|
18
19
|
eventTypes: string[];
|
|
20
|
+
accessible?: boolean;
|
|
21
|
+
accessError?: EventLogAccess;
|
|
22
|
+
}
|
|
23
|
+
export type AgentAccess = 'ok' | 'not-enabled' | 'unknown';
|
|
24
|
+
export interface AgentDefinition {
|
|
25
|
+
developerName: string;
|
|
26
|
+
label: string;
|
|
27
|
+
type: 'agent' | 'classic-bot';
|
|
28
|
+
isActive: boolean;
|
|
29
|
+
activeVersion?: number;
|
|
30
|
+
runAsUserId?: string;
|
|
31
|
+
runAsUserActive?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface AgentUser {
|
|
34
|
+
userId: string;
|
|
35
|
+
username: string;
|
|
36
|
+
profileName: string;
|
|
37
|
+
isActive: boolean;
|
|
38
|
+
permissionSetIds: string[];
|
|
39
|
+
permissionSetLicenseNames: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface CspTrustedSite {
|
|
42
|
+
developerName: string;
|
|
43
|
+
endpointUrl: string;
|
|
44
|
+
isActive: boolean;
|
|
45
|
+
context?: string;
|
|
19
46
|
}
|
|
20
47
|
export interface MfaRegistration {
|
|
21
48
|
userId: string;
|
|
@@ -42,6 +69,10 @@ export interface AuditCache {
|
|
|
42
69
|
eventLogSummary?: EventLogSummary;
|
|
43
70
|
mfaRegistrations?: MfaRegistration[];
|
|
44
71
|
vfPageBodies?: VfPageBody[];
|
|
72
|
+
cspTrustedSites?: CspTrustedSite[];
|
|
45
73
|
effectivePermissions?: EffectivePermissionGrant[];
|
|
74
|
+
agentInventory?: AgentDefinition[];
|
|
75
|
+
agentUsers?: AgentUser[];
|
|
76
|
+
agentAccess?: AgentAccess;
|
|
46
77
|
}
|
|
47
78
|
//# sourceMappingURL=AuditCache.d.ts.map
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import type { SoqlClient } from '../api/SoqlClient.js';
|
|
2
2
|
import type { ToolingClient } from '../api/ToolingClient.js';
|
|
3
3
|
import type { RestClient } from '../api/RestClient.js';
|
|
4
|
+
import type { MetadataClient } from '../api/MetadataClient.js';
|
|
4
5
|
import type { OrgInfo } from './OrgInfo.js';
|
|
5
6
|
import type { AuditCache } from './AuditCache.js';
|
|
7
|
+
export interface AuditOptions {
|
|
8
|
+
resolveDomains?: boolean;
|
|
9
|
+
}
|
|
6
10
|
export interface AuditContext {
|
|
7
11
|
readonly soql: SoqlClient;
|
|
8
12
|
readonly tooling: ToolingClient;
|
|
9
13
|
readonly rest: RestClient;
|
|
14
|
+
readonly metadata?: MetadataClient;
|
|
10
15
|
readonly orgInfo: OrgInfo;
|
|
16
|
+
readonly options?: AuditOptions;
|
|
11
17
|
cache: AuditCache;
|
|
12
18
|
}
|
|
13
19
|
//# sourceMappingURL=AuditContext.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class EventBaselineStore {
|
|
2
|
+
private readonly root;
|
|
3
|
+
constructor(root?: string);
|
|
4
|
+
static defaultRoot(): string;
|
|
5
|
+
/** The per-org base directory logs for this org are stored under. */
|
|
6
|
+
orgDir(orgId: string): string;
|
|
7
|
+
/** Absolute path a given log file is (or would be) stored at. */
|
|
8
|
+
pathFor(orgId: string, eventType: string, logDate: string, id: string): string;
|
|
9
|
+
/** True when this EventLogFile is already on disk — the dedup / idempotency check. */
|
|
10
|
+
has(orgId: string, eventType: string, logDate: string, id: string): boolean;
|
|
11
|
+
/** Write a CSV body verbatim; returns the saved path. Best-effort. */
|
|
12
|
+
save(orgId: string, eventType: string, logDate: string, id: string, body: string): string;
|
|
13
|
+
/** Write a per-run manifest JSON under {root}/{orgId}/_manifests/; returns its path. */
|
|
14
|
+
writeManifest(orgId: string, manifest: unknown): string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=EventBaselineStore.d.ts.map
|