@cclabsnz/sf-audit 1.8.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/README.md +138 -758
  3. package/lib/chains/CapabilityRegistry.d.ts +6 -2
  4. package/lib/chains/CapabilityRegistry.js +48 -2
  5. package/lib/chains/namedChains.js +140 -7
  6. package/lib/checks/impl/AgentChannelExposureCheck.js +52 -10
  7. package/lib/checks/impl/ApexCrudFLSCheck.js +3 -3
  8. package/lib/checks/impl/ApexRestEndpointCheck.js +0 -3
  9. package/lib/checks/impl/CustomLabelsCredentialCheck.js +1 -1
  10. package/lib/checks/impl/DataClassificationCheck.js +15 -1
  11. package/lib/checks/impl/FailedLoginCheck.js +16 -1
  12. package/lib/checks/impl/FieldLevelSecurityCheck.js +29 -16
  13. package/lib/checks/impl/GuestUserVisibilityCheck.d.ts +35 -0
  14. package/lib/checks/impl/GuestUserVisibilityCheck.js +168 -0
  15. package/lib/checks/impl/HardcodedCredentialsCheck.js +0 -1
  16. package/lib/checks/impl/HealthCheckCheck.js +1 -3
  17. package/lib/checks/impl/IntegrationLeastPrivilegeCheck.d.ts +42 -0
  18. package/lib/checks/impl/IntegrationLeastPrivilegeCheck.js +467 -0
  19. package/lib/checks/impl/IntegrationUsersCheck.js +48 -52
  20. package/lib/checks/impl/InternalUserMfaCheck.js +0 -1
  21. package/lib/checks/impl/IpRestrictionsCheck.js +39 -5
  22. package/lib/checks/impl/PublicGroupSharingCheck.js +21 -2
  23. package/lib/checks/impl/ScheduledApexCheck.js +0 -1
  24. package/lib/checks/impl/SoapLoginApiAuthCheck.d.ts +10 -0
  25. package/lib/checks/impl/SoapLoginApiAuthCheck.js +151 -0
  26. package/lib/checks/impl/SsoEnforcementCheck.js +0 -1
  27. package/lib/checks/impl/TrustedUrlHygieneCheck.js +3 -1
  28. package/lib/checks/registry.js +4 -0
  29. package/lib/checks/support/integrationAccounts.d.ts +35 -0
  30. package/lib/checks/support/integrationAccounts.js +209 -0
  31. package/lib/commands/audit/security.d.ts +12 -1
  32. package/lib/commands/audit/security.js +32 -9
  33. package/lib/compliance/catalogs/gdpr.d.ts +3 -0
  34. package/lib/compliance/catalogs/gdpr.js +54 -0
  35. package/lib/compliance/catalogs/hipaa.d.ts +3 -0
  36. package/lib/compliance/catalogs/hipaa.js +97 -0
  37. package/lib/compliance/catalogs/index.js +4 -0
  38. package/lib/compliance/mapping.js +111 -36
  39. package/lib/findings/CheckMeta.js +2 -0
  40. package/lib/findings/exitCode.d.ts +28 -0
  41. package/lib/findings/exitCode.js +46 -0
  42. package/lib/findings/loadScoringConfig.js +5 -5
  43. package/lib/renderers/HtmlRenderer.js +1 -1
  44. package/messages/audit.security.md +6 -0
  45. package/package.json +5 -3
@@ -12,6 +12,7 @@ import { resolveFrameworks } from '../../compliance/resolve.js';
12
12
  import { buildAuditContext, resolveOrgInfo } from '../../lib/wire.js';
13
13
  import { loadScoringConfig } from '../../findings/loadScoringConfig.js';
14
14
  import { HistoryStore } from '../../history/HistoryStore.js';
15
+ import { EXIT_FINDINGS, EXIT_INCONCLUSIVE, resolveExitCode, violationsFor } from '../../findings/exitCode.js';
15
16
  const RENDERERS = {
16
17
  html: new HtmlRenderer(),
17
18
  md: new MarkdownRenderer(),
@@ -41,6 +42,10 @@ export default class SecurityAuditCommand extends SfCommand {
41
42
  summary: 'Exit with code 1 if any finding is at or above this severity.',
42
43
  options: ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW'],
43
44
  }),
45
+ 'fail-on-inconclusive': Flags.boolean({
46
+ summary: 'Exit with code 3 if any check could not gather evidence. Off by default.',
47
+ default: false,
48
+ }),
44
49
  checks: Flags.string({
45
50
  summary: 'Comma-separated check IDs to run. Omit to run all checks.',
46
51
  helpValue: 'hardcoded-credentials,apex-sharing',
@@ -109,9 +114,7 @@ export default class SecurityAuditCommand extends SfCommand {
109
114
  this.printSummary(result);
110
115
  this.log('');
111
116
  this.log(' Deep dives: https://softwareinsights.dev · Remediation help: https://cloudcounsel.co.nz');
112
- if (flags['fail-on']) {
113
- this.handleFailOn(result, flags['fail-on']);
114
- }
117
+ this.applyExitCode(result, flags['fail-on'], flags['fail-on-inconclusive']);
115
118
  return result;
116
119
  }
117
120
  /** Resolve --checks to the checks to run, erroring on any unknown ID. */
@@ -169,17 +172,37 @@ export default class SecurityAuditCommand extends SfCommand {
169
172
  this.log(` Score: ${result.healthScore}/100 Grade: ${result.grade}`);
170
173
  this.log('─────────────────────────────');
171
174
  }
172
- handleFailOn(result, failOn) {
173
- const ORDER = ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW'];
174
- const threshold = ORDER.indexOf(failOn);
175
- const violations = result.findings.filter((f) => ORDER.indexOf(f.riskLevel) <= threshold);
176
- if (violations.length > 0) {
175
+ /**
176
+ * Set the process exit code from the audit outcome.
177
+ *
178
+ * 0 clean · 1 findings at or above --fail-on · 3 inconclusive checks when the
179
+ * caller passed --fail-on-inconclusive. Anything that stops the audit running
180
+ * at all surfaces as oclif's own error exit instead.
181
+ *
182
+ * The result is always returned, so `--json` still yields the full report
183
+ * alongside a non-zero exit.
184
+ */
185
+ applyExitCode(result, failOn, failOnInconclusive) {
186
+ const code = resolveExitCode(result.findings, { failOn, failOnInconclusive });
187
+ if (code === EXIT_FINDINGS && failOn !== undefined) {
188
+ const violations = violationsFor(result.findings, failOn);
177
189
  this.log(`\nFail-on threshold: ${failOn}, ${violations.length} finding${violations.length !== 1 ? 's' : ''} at or above threshold:`);
178
190
  for (const f of violations) {
179
191
  this.log(` [${f.riskLevel}] ${f.title}`);
180
192
  }
181
- this.exit(1);
182
193
  }
194
+ if (code === EXIT_INCONCLUSIVE) {
195
+ const blind = result.findings.filter((f) => f.inconclusive === true);
196
+ this.log(`\n${blind.length} check${blind.length !== 1 ? 's' : ''} could not gather evidence:`);
197
+ for (const f of blind) {
198
+ this.log(` [inconclusive] ${f.title}`);
199
+ }
200
+ }
201
+ // Deliberately not this.exit(): that throws an ExitError, which SfCommand.catch()
202
+ // renders as the JSON error envelope, discarding the audit result under --json.
203
+ // Setting the code lets run() return the report and still exit non-zero.
204
+ if (code !== 0)
205
+ process.exitCode = code;
183
206
  }
184
207
  }
185
208
  //# sourceMappingURL=security.js.map
@@ -0,0 +1,3 @@
1
+ import type { ControlDef } from '../types.js';
2
+ export declare const GDPR_CONTROLS: ControlDef[];
3
+ //# sourceMappingURL=gdpr.d.ts.map
@@ -0,0 +1,54 @@
1
+ // GDPR — Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016
2
+ // on the protection of natural persons with regard to the processing of personal data and on the
3
+ // free movement of such data, and repealing Directive 95/46/EC.
4
+ //
5
+ // Article headings and the quoted text of Art. 5(1)(f), 25 and 32(1)(a)-(d) verified 2026-08
6
+ // against the consolidated regulation text; the Official Journal (OJ L 119, 4.5.2016) is the
7
+ // canonical reference.
8
+ //
9
+ // Scope note: GDPR is a regulation about processing, not a technical control set, so only the
10
+ // articles that a read-only Salesforce org-configuration review can produce evidence for are
11
+ // catalogued. Articles covering lawful basis, data-subject rights, DPIAs (Art. 35), controller /
12
+ // processor contracts and supervisory-authority procedure are out of scope for this tool and
13
+ // deliberately absent — their absence is not a claim that they do not apply.
14
+ //
15
+ // Where a paragraph is mapped rather than a whole article (Art. 5(1)(f), Art. 32(1)(a)/(b)/(d)),
16
+ // the id names the paragraph so a finding cites the specific obligation, not the article at large.
17
+ const V = 'Regulation (EU) 2016/679';
18
+ const URL = 'https://eur-lex.europa.eu/eli/reg/2016/679/oj/eng';
19
+ const ref = (cite) => `Regulation (EU) 2016/679, ${cite}`;
20
+ export const GDPR_CONTROLS = [
21
+ { id: 'GDPR-Art5(1)(f)', framework: 'GDPR', version: V,
22
+ title: 'Integrity and confidentiality',
23
+ requirement: 'Personal data shall be processed in a manner that ensures appropriate security of the personal data, including protection against unauthorised or unlawful processing and against accidental loss, destruction or damage, using appropriate technical or organisational measures.',
24
+ sourceRef: ref('Art. 5(1)(f)'), url: URL, verified: true },
25
+ { id: 'GDPR-Art25', framework: 'GDPR', version: V,
26
+ title: 'Data protection by design and by default',
27
+ requirement: 'The controller shall implement appropriate technical and organisational measures for ensuring that, by default, only personal data which are necessary for each specific purpose are processed — including their accessibility. Such measures shall ensure that by default personal data are not made accessible without the individual\'s intervention to an indefinite number of natural persons.',
28
+ sourceRef: ref('Art. 25(1)-(2)'), url: URL, verified: true },
29
+ { id: 'GDPR-Art30', framework: 'GDPR', version: V,
30
+ title: 'Records of processing activities',
31
+ requirement: 'Each controller shall maintain a record of processing activities under its responsibility, including the categories of personal data processed, the categories of recipients to whom the data have been disclosed, and transfers to third countries.',
32
+ sourceRef: ref('Art. 30(1)'), url: URL, verified: true },
33
+ { id: 'GDPR-Art32(1)(a)', framework: 'GDPR', version: V,
34
+ title: 'Pseudonymisation and encryption of personal data',
35
+ requirement: 'Taking account of the state of the art and the risks of the processing, the controller and processor shall implement appropriate technical and organisational measures including the pseudonymisation and encryption of personal data.',
36
+ sourceRef: ref('Art. 32(1)(a)'), url: URL, verified: true },
37
+ { id: 'GDPR-Art32(1)(b)', framework: 'GDPR', version: V,
38
+ title: 'Ongoing confidentiality, integrity, availability and resilience',
39
+ requirement: 'The controller and processor shall implement measures providing the ability to ensure the ongoing confidentiality, integrity, availability and resilience of processing systems and services.',
40
+ sourceRef: ref('Art. 32(1)(b)'), url: URL, verified: true },
41
+ { id: 'GDPR-Art32(1)(d)', framework: 'GDPR', version: V,
42
+ title: 'Regular testing and evaluation of security measures',
43
+ requirement: 'The controller and processor shall implement a process for regularly testing, assessing and evaluating the effectiveness of technical and organisational measures for ensuring the security of the processing.',
44
+ sourceRef: ref('Art. 32(1)(d)'), url: URL, verified: true },
45
+ { id: 'GDPR-Art33', framework: 'GDPR', version: V,
46
+ title: 'Notification of a personal data breach to the supervisory authority',
47
+ requirement: 'In the case of a personal data breach, the controller shall without undue delay and, where feasible, not later than 72 hours after having become aware of it, notify the breach to the competent supervisory authority. Detecting and characterising a breach is a precondition of meeting that deadline.',
48
+ sourceRef: ref('Art. 33(1)'), url: URL, verified: true },
49
+ { id: 'GDPR-Art44', framework: 'GDPR', version: V,
50
+ title: 'General principle for transfers',
51
+ requirement: 'Any transfer of personal data to a third country or international organisation shall take place only if the conditions of Chapter V are met, including onward transfers. All provisions of that chapter shall be applied to ensure the level of protection guaranteed by this Regulation is not undermined.',
52
+ sourceRef: ref('Art. 44'), url: URL, verified: true },
53
+ ];
54
+ //# sourceMappingURL=gdpr.js.map
@@ -0,0 +1,3 @@
1
+ import type { ControlDef } from '../types.js';
2
+ export declare const HIPAA_CONTROLS: ControlDef[];
3
+ //# sourceMappingURL=hipaa.d.ts.map
@@ -0,0 +1,97 @@
1
+ // HIPAA Security Rule — 45 CFR Part 164, Subpart C ("Security Standards for the Protection of
2
+ // Electronic Protected Health Information"), as amended by the 2013 Omnibus Rule.
3
+ //
4
+ // Version pinning matters here. HHS published an NPRM on 2025-01-06 that would rewrite these
5
+ // safeguards — removing the Required/Addressable distinction and making encryption, MFA and
6
+ // network segmentation mandatory. As of 2026-08 that rule is still PROPOSED, not final, so this
7
+ // catalog maps the operative rule. When the final rule lands, `version` and the affected
8
+ // `requirement` texts must be re-pinned and re-verified, not silently amended.
9
+ //
10
+ // Standard headings and implementation-specification names verified 2026-08 against the
11
+ // codified text of 45 CFR 164.308 / 164.310 / 164.312, including each spec's
12
+ // Required vs Addressable designation. `requirement` quotes the regulatory text.
13
+ //
14
+ // Scope note: only safeguards a read-only Salesforce org-configuration review can speak to are
15
+ // catalogued. The physical safeguards (164.310), contingency planning (164.308(a)(7)) and the
16
+ // documentation requirements (164.316) are out of scope for this tool and deliberately absent —
17
+ // their absence is not a claim that they do not apply.
18
+ const V = '45 CFR Part 164 Subpart C (HIPAA Security Rule, 2013 Omnibus)';
19
+ const URL = 'https://www.ecfr.gov/current/title-45/subtitle-A/subchapter-C/part-164/subpart-C';
20
+ const ref = (cite) => `45 CFR ${cite}`;
21
+ export const HIPAA_CONTROLS = [
22
+ // --- 164.308 Administrative safeguards ---
23
+ { id: 'HIPAA-164.308(a)(1)(ii)(A)', framework: 'HIPAA', version: V,
24
+ title: 'Risk analysis (Required)',
25
+ requirement: 'Conduct an accurate and thorough assessment of the potential risks and vulnerabilities to the confidentiality, integrity, and availability of electronic protected health information held by the covered entity or business associate.',
26
+ sourceRef: ref('164.308(a)(1)(ii)(A)'), url: URL, verified: true },
27
+ { id: 'HIPAA-164.308(a)(1)(ii)(B)', framework: 'HIPAA', version: V,
28
+ title: 'Risk management (Required)',
29
+ requirement: 'Implement security measures sufficient to reduce risks and vulnerabilities to a reasonable and appropriate level.',
30
+ sourceRef: ref('164.308(a)(1)(ii)(B)'), url: URL, verified: true },
31
+ { id: 'HIPAA-164.308(a)(1)(ii)(D)', framework: 'HIPAA', version: V,
32
+ title: 'Information system activity review (Required)',
33
+ requirement: 'Implement procedures to regularly review records of information system activity, such as audit logs, access reports, and security incident tracking reports.',
34
+ sourceRef: ref('164.308(a)(1)(ii)(D)'), url: URL, verified: true },
35
+ { id: 'HIPAA-164.308(a)(3)', framework: 'HIPAA', version: V,
36
+ title: 'Workforce security',
37
+ requirement: 'Implement policies and procedures to ensure that all members of the workforce have appropriate access to electronic protected health information, and to prevent those who do not have access from obtaining access — including termination procedures for ending access when employment or authorisation ends.',
38
+ sourceRef: ref('164.308(a)(3)'), url: URL, verified: true },
39
+ { id: 'HIPAA-164.308(a)(4)', framework: 'HIPAA', version: V,
40
+ title: 'Information access management',
41
+ requirement: 'Implement policies and procedures for authorising access to electronic protected health information that are consistent with the applicable requirements of subpart E, including access authorisation and access establishment and modification.',
42
+ sourceRef: ref('164.308(a)(4)'), url: URL, verified: true },
43
+ { id: 'HIPAA-164.308(a)(5)(ii)(C)', framework: 'HIPAA', version: V,
44
+ title: 'Log-in monitoring (Addressable)',
45
+ requirement: 'Procedures for monitoring log-in attempts and reporting discrepancies.',
46
+ sourceRef: ref('164.308(a)(5)(ii)(C)'), url: URL, verified: true },
47
+ { id: 'HIPAA-164.308(a)(5)(ii)(D)', framework: 'HIPAA', version: V,
48
+ title: 'Password management (Addressable)',
49
+ requirement: 'Procedures for creating, changing, and safeguarding passwords.',
50
+ sourceRef: ref('164.308(a)(5)(ii)(D)'), url: URL, verified: true },
51
+ { id: 'HIPAA-164.308(a)(6)', framework: 'HIPAA', version: V,
52
+ title: 'Security incident procedures',
53
+ requirement: 'Implement policies and procedures to address security incidents, including identifying and responding to suspected or known security incidents, mitigating their harmful effects, and documenting incidents and their outcomes.',
54
+ sourceRef: ref('164.308(a)(6)'), url: URL, verified: true },
55
+ { id: 'HIPAA-164.308(a)(8)', framework: 'HIPAA', version: V,
56
+ title: 'Evaluation',
57
+ requirement: 'Perform a periodic technical and nontechnical evaluation, in response to environmental or operational changes affecting the security of electronic protected health information, that establishes the extent to which security policies and procedures meet the requirements of this subpart.',
58
+ sourceRef: ref('164.308(a)(8)'), url: URL, verified: true },
59
+ // --- 164.312 Technical safeguards ---
60
+ { id: 'HIPAA-164.312(a)(1)', framework: 'HIPAA', version: V,
61
+ title: 'Access control',
62
+ requirement: 'Implement technical policies and procedures for electronic information systems that maintain electronic protected health information to allow access only to those persons or software programs that have been granted access rights as specified in 164.308(a)(4).',
63
+ sourceRef: ref('164.312(a)(1)'), url: URL, verified: true },
64
+ { id: 'HIPAA-164.312(a)(2)(i)', framework: 'HIPAA', version: V,
65
+ title: 'Unique user identification (Required)',
66
+ requirement: 'Assign a unique name and/or number for identifying and tracking user identity.',
67
+ sourceRef: ref('164.312(a)(2)(i)'), url: URL, verified: true },
68
+ { id: 'HIPAA-164.312(a)(2)(iii)', framework: 'HIPAA', version: V,
69
+ title: 'Automatic logoff (Addressable)',
70
+ requirement: 'Implement electronic procedures that terminate an electronic session after a predetermined time of inactivity.',
71
+ sourceRef: ref('164.312(a)(2)(iii)'), url: URL, verified: true },
72
+ { id: 'HIPAA-164.312(a)(2)(iv)', framework: 'HIPAA', version: V,
73
+ title: 'Encryption and decryption (Addressable)',
74
+ requirement: 'Implement a mechanism to encrypt and decrypt electronic protected health information.',
75
+ sourceRef: ref('164.312(a)(2)(iv)'), url: URL, verified: true },
76
+ { id: 'HIPAA-164.312(b)', framework: 'HIPAA', version: V,
77
+ title: 'Audit controls',
78
+ requirement: 'Implement hardware, software, and/or procedural mechanisms that record and examine activity in information systems that contain or use electronic protected health information.',
79
+ sourceRef: ref('164.312(b)'), url: URL, verified: true },
80
+ { id: 'HIPAA-164.312(c)(1)', framework: 'HIPAA', version: V,
81
+ title: 'Integrity',
82
+ requirement: 'Implement policies and procedures to protect electronic protected health information from improper alteration or destruction.',
83
+ sourceRef: ref('164.312(c)(1)'), url: URL, verified: true },
84
+ { id: 'HIPAA-164.312(d)', framework: 'HIPAA', version: V,
85
+ title: 'Person or entity authentication',
86
+ requirement: 'Implement procedures to verify that a person or entity seeking access to electronic protected health information is the one claimed.',
87
+ sourceRef: ref('164.312(d)'), url: URL, verified: true },
88
+ { id: 'HIPAA-164.312(e)(1)', framework: 'HIPAA', version: V,
89
+ title: 'Transmission security',
90
+ requirement: 'Implement technical security measures to guard against unauthorised access to electronic protected health information that is being transmitted over an electronic communications network.',
91
+ sourceRef: ref('164.312(e)(1)'), url: URL, verified: true },
92
+ { id: 'HIPAA-164.312(e)(2)(ii)', framework: 'HIPAA', version: V,
93
+ title: 'Encryption in transmission (Addressable)',
94
+ requirement: 'Implement a mechanism to encrypt electronic protected health information whenever deemed appropriate.',
95
+ sourceRef: ref('164.312(e)(2)(ii)'), url: URL, verified: true },
96
+ ];
97
+ //# sourceMappingURL=hipaa.js.map
@@ -6,6 +6,8 @@ import { SBS_CONTROLS } from './sbs.js';
6
6
  import { PRIVACY_ACT_CONTROLS } from './privacyAct.js';
7
7
  import { HISO10029_CONTROLS } from './hiso10029.js';
8
8
  import { NZISM_CONTROLS } from './nzism.js';
9
+ import { HIPAA_CONTROLS } from './hipaa.js';
10
+ import { GDPR_CONTROLS } from './gdpr.js';
9
11
  export const ALL_CONTROLS = [
10
12
  ...OWASP_CONTROLS,
11
13
  ...OWASP_LLM_CONTROLS,
@@ -15,6 +17,8 @@ export const ALL_CONTROLS = [
15
17
  ...PRIVACY_ACT_CONTROLS,
16
18
  ...HISO10029_CONTROLS,
17
19
  ...NZISM_CONTROLS,
20
+ ...HIPAA_CONTROLS,
21
+ ...GDPR_CONTROLS,
18
22
  ];
19
23
  const BY_ID = new Map(ALL_CONTROLS.map((c) => [c.id, c]));
20
24
  export function getControl(id) {
@@ -1,6 +1,5 @@
1
1
  // Maps each check id to the compliance control ids it relates to.
2
- // Migrated from the former ComplianceMapping. HIPAA/GDPR ids are intentionally omitted
3
- // until their catalogs land (later plan). A08/A10 are mapped precisely:
2
+ // Migrated from the former ComplianceMapping. A08/A10 are mapped precisely:
4
3
  // A10 (SSRF) → egress controls (remote-sites, csp-trusted-sites, named-credentials)
5
4
  // A08 (Software & Data Integrity) → installed-packages, deployment-identity
6
5
  // NZ pack control ids (HISO/NZISM/Privacy Act) are layered on by domain via NZ_CROSSWALK below.
@@ -33,6 +32,7 @@ const BASE_CHECK_CONTROL_MAP = {
33
32
  'mfa-enforcement': ['OWASP-A07', 'SOC2-CC6.1', 'ISO-A.8.3', 'SBS-AUTH-004'],
34
33
  'api-client-permission': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.8.3', 'SBS-ACS-006'],
35
34
  'integration-users': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.18', 'SBS-ACS-007', 'SBS-ACS-008', 'SBS-ACS-009'],
35
+ 'integration-least-privilege': ['OWASP-A01', 'SOC2-CC6.3', 'ISO-A.5.18', 'SBS-ACS-008', 'SBS-ACS-009'],
36
36
  'content-links': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.14', 'SBS-FILE-001', 'SBS-FILE-002', 'SBS-FILE-003'],
37
37
  'field-history-tracking': ['OWASP-A09', 'SOC2-CC7.2', 'ISO-A.8.15', 'SBS-DATA-004'],
38
38
  'data-classification': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.12', 'SBS-DATA-001', 'SBS-DATA-002'],
@@ -81,6 +81,7 @@ const BASE_CHECK_CONTROL_MAP = {
81
81
  'classic-sites': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.8.3', 'SBS-CPORTAL-003'],
82
82
  'auth-providers': ['OWASP-A07', 'SOC2-CC6.1', 'ISO-A.8.3', 'SBS-AUTH-001'],
83
83
  'guest-api-access': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.18', 'SBS-CPORTAL-002'],
84
+ 'guest-user-visibility': ['OWASP-A01', 'SOC2-CC6.1', 'ISO-A.5.18', 'SBS-CPORTAL-002'],
84
85
  'external-credentials': ['OWASP-A02', 'SOC2-CC6.7', 'ISO-A.8.3', 'SBS-INT-003'],
85
86
  'login-anomaly': ['OWASP-A09', 'SOC2-CC7.2', 'ISO-A.8.15', 'SBS-MON-003'],
86
87
  'session-hardening': ['OWASP-A05', 'SOC2-CC6.1', 'ISO-A.8.26'],
@@ -107,50 +108,124 @@ const BASE_CHECK_CONTROL_MAP = {
107
108
  'agent-monitoring-coverage': ['OWASP-A09', 'SOC2-CC7.2', 'ISO-A.8.15', 'LLM02'],
108
109
  'trusted-url-hygiene': ['OWASP-A05', 'OWASP-A10', 'SOC2-CC6.6', 'ISO-A.8.26', 'LLM01', 'LLM05'],
109
110
  };
110
- // NZ pack crosswalk — each check belongs to one domain; the domain's NZ control ids are
111
- // layered onto its base entry. HISO/NZISM are domain/chapter-level drafts; Privacy Act IPPs
112
- // are statute-level. All verified:false until the verification pass.
111
+ // Domain groupings. Each check belongs to exactly one domain, and a domain's control ids are
112
+ // layered onto every base entry in it. Shared by the NZ pack and the HIPAA/GDPR crosswalk below
113
+ // so the two cannot drift apart in which checks they consider part of a domain.
114
+ const DOMAIN = {
115
+ accessControl: ['users-and-admins', 'permissions', 'sharing-model', 'public-group-sharing', 'guest-user-access',
116
+ 'field-level-security', 'standard-profiles', 'api-client-permission', 'integration-users',
117
+ 'integration-least-privilege',
118
+ 'escalation-perms', 'report-folder-access', 'apex-crud-fls', 'apex-rest-endpoint',
119
+ 'guest-executable-apex', 'experience-cloud-site', 'content-links', 'apex-sharing', 'flows-without-sharing',
120
+ 'public-content-exposure', 'privileged-access', 'separation-of-duties',
121
+ 'guest-object-exposure', 'guest-site-options', 'guest-record-access-policy',
122
+ 'login-access-policy', 'data-export-access', 'classic-sites', 'guest-api-access',
123
+ 'guest-user-visibility'],
124
+ authentication: ['login-session', 'ip-restrictions', 'password-session-policy', 'sso-enforcement', 'mfa-enforcement',
125
+ 'trusted-ip-ranges', 'my-domain-login-policy', 'high-assurance-session', 'internal-user-mfa',
126
+ 'mfa-registration', 'mfa-method-strength', 'failed-login-detection', 'enhanced-domains',
127
+ 'auth-providers'],
128
+ crypto: ['named-credentials', 'hardcoded-credentials', 'custom-settings', 'certificate-expiry', 'custom-labels-credential', 'external-credentials', 'encryption-coverage'],
129
+ logging: ['audit-trail', 'apex-logging', 'event-monitoring', 'siem-integration', 'anonymous-apex-audit',
130
+ 'debug-log-access', 'transaction-security-policy', 'threat-detection', 'guest-traffic-anomaly',
131
+ 'login-anomaly'],
132
+ devSecurity: ['code-security', 'visualforce-xss', 'scheduled-apex'],
133
+ network: ['remote-sites', 'csp-trusted-sites', 'connected-apps', 'connected-app-scope', 'connected-app-inactivity', 'cors-allowlist',
134
+ 'email-security', 'outbound-messages', 'experience-csp'],
135
+ dataGovernance: ['data-classification', 'field-history-tracking', 'sandbox-data-masking'],
136
+ configGovernance: ['health-check', 'api-limits', 'release-updates', 'legacy-api-version', 'installed-packages', 'deployment-identity', 'session-hardening'],
137
+ accountLifecycle: ['inactive-users'],
138
+ // Agentforce / GenAI. The NZ pack does not map these (HISO/NZISM predate agentic platforms and
139
+ // have no chapter that fits); HIPAA and GDPR do, because an over-privileged agent user reading
140
+ // PHI or personal data is squarely an access-control and security-of-processing question.
141
+ aiAgents: ['agent-inventory', 'agent-user-privilege', 'agent-action-surface', 'agent-channel-exposure',
142
+ 'agent-monitoring-coverage', 'trusted-url-hygiene'],
143
+ };
144
+ // NZ pack crosswalk — HISO/NZISM are domain/chapter-level; Privacy Act IPPs are statute-level.
113
145
  const NZ_CROSSWALK = [
114
- { controls: ['HISO-AC', 'NZISM-AC', 'PRIVACY-IPP5'],
115
- checks: ['users-and-admins', 'permissions', 'sharing-model', 'public-group-sharing', 'guest-user-access',
116
- 'field-level-security', 'standard-profiles', 'api-client-permission', 'integration-users',
117
- 'escalation-perms', 'report-folder-access', 'apex-crud-fls', 'apex-rest-endpoint',
118
- 'guest-executable-apex', 'experience-cloud-site', 'content-links', 'apex-sharing', 'flows-without-sharing',
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'] },
122
- { controls: ['HISO-AUTH', 'NZISM-AUTH', 'PRIVACY-IPP5'],
123
- checks: ['login-session', 'ip-restrictions', 'password-session-policy', 'sso-enforcement', 'mfa-enforcement',
124
- 'trusted-ip-ranges', 'my-domain-login-policy', 'high-assurance-session', 'internal-user-mfa',
125
- 'mfa-registration', 'mfa-method-strength', 'failed-login-detection', 'enhanced-domains',
126
- 'auth-providers'] },
127
- { controls: ['HISO-CRYPTO', 'NZISM-CRYPTO', 'PRIVACY-IPP5'],
128
- checks: ['named-credentials', 'hardcoded-credentials', 'custom-settings', 'certificate-expiry', 'custom-labels-credential', 'external-credentials', 'encryption-coverage'] },
129
- { controls: ['HISO-LOG', 'NZISM-LOG'],
130
- checks: ['audit-trail', 'apex-logging', 'event-monitoring', 'siem-integration', 'anonymous-apex-audit',
131
- 'debug-log-access', 'transaction-security-policy', 'threat-detection', 'guest-traffic-anomaly',
132
- 'login-anomaly'] },
133
- { controls: ['HISO-DEV', 'NZISM-SW'],
134
- checks: ['code-security', 'visualforce-xss', 'scheduled-apex'] },
135
- { controls: ['HISO-COMM', 'NZISM-NET', 'PRIVACY-IPP12'],
136
- checks: ['remote-sites', 'csp-trusted-sites', 'connected-apps', 'connected-app-scope', 'connected-app-inactivity', 'cors-allowlist',
137
- 'email-security', 'outbound-messages', 'experience-csp'] },
138
- { controls: ['HISO-DATA', 'PRIVACY-IPP5'],
139
- checks: ['data-classification', 'field-history-tracking', 'sandbox-data-masking'] },
140
- { controls: ['HISO-GOV', 'NZISM-CONFIG'],
141
- checks: ['health-check', 'api-limits', 'release-updates', 'legacy-api-version', 'installed-packages', 'deployment-identity', 'session-hardening'] },
142
- { controls: ['PRIVACY-IPP9'],
143
- checks: ['inactive-users'] },
146
+ { controls: ['HISO-AC', 'NZISM-AC', 'PRIVACY-IPP5'], checks: DOMAIN.accessControl },
147
+ { controls: ['HISO-AUTH', 'NZISM-AUTH', 'PRIVACY-IPP5'], checks: DOMAIN.authentication },
148
+ { controls: ['HISO-CRYPTO', 'NZISM-CRYPTO', 'PRIVACY-IPP5'], checks: DOMAIN.crypto },
149
+ { controls: ['HISO-LOG', 'NZISM-LOG'], checks: DOMAIN.logging },
150
+ { controls: ['HISO-DEV', 'NZISM-SW'], checks: DOMAIN.devSecurity },
151
+ { controls: ['HISO-COMM', 'NZISM-NET', 'PRIVACY-IPP12'], checks: DOMAIN.network },
152
+ { controls: ['HISO-DATA', 'PRIVACY-IPP5'], checks: DOMAIN.dataGovernance },
153
+ { controls: ['HISO-GOV', 'NZISM-CONFIG'], checks: DOMAIN.configGovernance },
154
+ { controls: ['PRIVACY-IPP9'], checks: DOMAIN.accountLifecycle },
155
+ ];
156
+ // HIPAA / GDPR crosswalk — the domain-wide obligations. Anything narrower than a whole domain is
157
+ // mapped per check in REGULATORY_PRECISE below rather than swept across the domain, because these
158
+ // ids name a specific implementation specification or article paragraph: claiming "automatic
159
+ // logoff" against all fourteen authentication checks would be the imprecision the sourced catalog
160
+ // exists to avoid.
161
+ const REGULATORY_CROSSWALK = [
162
+ { controls: ['HIPAA-164.312(a)(1)', 'HIPAA-164.308(a)(4)', 'GDPR-Art5(1)(f)', 'GDPR-Art25', 'GDPR-Art32(1)(b)'],
163
+ checks: DOMAIN.accessControl },
164
+ { controls: ['HIPAA-164.312(d)', 'GDPR-Art5(1)(f)', 'GDPR-Art32(1)(b)'],
165
+ checks: DOMAIN.authentication },
166
+ { controls: ['HIPAA-164.312(a)(2)(iv)', 'GDPR-Art32(1)(a)', 'GDPR-Art5(1)(f)'],
167
+ checks: DOMAIN.crypto },
168
+ { controls: ['HIPAA-164.312(b)', 'HIPAA-164.308(a)(1)(ii)(D)', 'GDPR-Art32(1)(b)', 'GDPR-Art33'],
169
+ checks: DOMAIN.logging },
170
+ { controls: ['HIPAA-164.312(c)(1)', 'GDPR-Art25', 'GDPR-Art32(1)(b)'],
171
+ checks: DOMAIN.devSecurity },
172
+ { controls: ['HIPAA-164.312(e)(1)', 'GDPR-Art44', 'GDPR-Art32(1)(b)'],
173
+ checks: DOMAIN.network },
174
+ { controls: ['HIPAA-164.308(a)(1)(ii)(A)', 'HIPAA-164.312(c)(1)', 'GDPR-Art30', 'GDPR-Art5(1)(f)'],
175
+ checks: DOMAIN.dataGovernance },
176
+ { controls: ['HIPAA-164.308(a)(1)(ii)(B)', 'HIPAA-164.308(a)(8)', 'GDPR-Art32(1)(d)'],
177
+ checks: DOMAIN.configGovernance },
178
+ { controls: ['HIPAA-164.308(a)(3)', 'GDPR-Art5(1)(f)'],
179
+ checks: DOMAIN.accountLifecycle },
144
180
  ];
181
+ // Per-check HIPAA/GDPR additions, where the obligation is narrower than its domain.
182
+ const REGULATORY_PRECISE = {
183
+ // Shared/service identities vs "assign a unique name and/or number for identifying and tracking user identity".
184
+ 'integration-users': ['HIPAA-164.312(a)(2)(i)'],
185
+ // Session inactivity timeout is the automatic-logoff specification; password rules are their own.
186
+ 'password-session-policy': ['HIPAA-164.312(a)(2)(iii)', 'HIPAA-164.308(a)(5)(ii)(D)'],
187
+ 'session-hardening': ['HIPAA-164.312(a)(2)(iii)'],
188
+ // Monitoring log-in attempts and reporting discrepancies.
189
+ 'login-session': ['HIPAA-164.308(a)(5)(ii)(C)'],
190
+ 'failed-login-detection': ['HIPAA-164.308(a)(5)(ii)(C)'],
191
+ 'login-anomaly': ['HIPAA-164.308(a)(5)(ii)(C)'],
192
+ // Identifying and responding to suspected or known security incidents.
193
+ 'transaction-security-policy': ['HIPAA-164.308(a)(6)'],
194
+ 'threat-detection': ['HIPAA-164.308(a)(6)'],
195
+ 'guest-traffic-anomaly': ['HIPAA-164.308(a)(6)'],
196
+ // Cleartext transport of PHI/personal data — encryption in transmission.
197
+ 'remote-sites': ['HIPAA-164.312(e)(2)(ii)'],
198
+ 'csp-trusted-sites': ['HIPAA-164.312(e)(2)(ii)'],
199
+ 'outbound-messages': ['HIPAA-164.312(e)(2)(ii)'],
200
+ 'email-security': ['HIPAA-164.312(e)(2)(ii)'],
201
+ 'experience-csp': ['HIPAA-164.312(e)(2)(ii)'],
202
+ // Data Mask is pseudonymisation in the Art. 32(1)(a) sense; unmasked prod data in a sandbox is
203
+ // also a by-default-accessibility failure under Art. 25.
204
+ 'sandbox-data-masking': ['GDPR-Art32(1)(a)', 'GDPR-Art25'],
205
+ // Agentforce / GenAI — see DOMAIN.aiAgents.
206
+ 'agent-inventory': ['HIPAA-164.308(a)(4)', 'GDPR-Art30'],
207
+ 'agent-user-privilege': ['HIPAA-164.312(a)(1)', 'HIPAA-164.308(a)(4)', 'GDPR-Art5(1)(f)', 'GDPR-Art32(1)(b)'],
208
+ 'agent-action-surface': ['HIPAA-164.312(a)(1)', 'HIPAA-164.312(c)(1)', 'GDPR-Art25'],
209
+ 'agent-channel-exposure': ['HIPAA-164.312(a)(1)', 'GDPR-Art25', 'GDPR-Art5(1)(f)'],
210
+ 'agent-monitoring-coverage': ['HIPAA-164.312(b)', 'HIPAA-164.308(a)(1)(ii)(D)', 'GDPR-Art33'],
211
+ 'trusted-url-hygiene': ['HIPAA-164.312(e)(1)', 'GDPR-Art44'],
212
+ };
145
213
  function buildCheckControlMap() {
146
214
  const map = {};
147
215
  for (const [check, ids] of Object.entries(BASE_CHECK_CONTROL_MAP))
148
216
  map[check] = [...ids];
149
- for (const group of NZ_CROSSWALK) {
217
+ for (const group of [...NZ_CROSSWALK, ...REGULATORY_CROSSWALK]) {
150
218
  for (const check of group.checks) {
151
219
  (map[check] ??= []).push(...group.controls);
152
220
  }
153
221
  }
222
+ for (const [check, ids] of Object.entries(REGULATORY_PRECISE)) {
223
+ (map[check] ??= []).push(...ids);
224
+ }
225
+ // A control can arrive from both a crosswalk and a precise entry; a compliance matrix must not
226
+ // render the same control twice for one check.
227
+ for (const check of Object.keys(map))
228
+ map[check] = [...new Set(map[check])];
154
229
  return map;
155
230
  }
156
231
  export const CHECK_CONTROL_MAP = buildCheckControlMap();
@@ -27,6 +27,7 @@ export const CHECK_META = {
27
27
  'mfa-enforcement': { effort: 'quick', impact: 'Portal/external users without MFA let a stolen password reach customer or partner data directly.' },
28
28
  'api-client-permission': { effort: 'quick', impact: '“Use Any API Client” bypasses API Access Control, letting a user reach the org from any tool.' },
29
29
  'integration-users': { effort: 'moderate', impact: 'Over-privileged service accounts are prime targets: one stolen key grants broad, unattended access.' },
30
+ 'integration-least-privilege': { effort: 'moderate', impact: 'An integration account keeps whatever it was granted at go-live: long-lived credentials, no interactive user to notice misuse, and frequently outside MFA and IP restrictions. Every permission it is not using is standing privilege waiting on a leaked key.' },
30
31
  'content-links': { effort: 'quick', impact: 'Public file links without expiry or password leak documents to anyone who finds the URL.' },
31
32
  'field-history-tracking': { effort: 'quick', impact: 'Without field history, tampering with sensitive records can’t be reconstructed after an incident.' },
32
33
  'data-classification': { effort: 'moderate', impact: 'Unclassified sensitive data can’t be protected or encrypted consistently, increasing exposure.' },
@@ -75,6 +76,7 @@ export const CHECK_META = {
75
76
  'classic-sites': { effort: 'moderate', impact: 'Active classic Visualforce sites expose a second unauthenticated guest surface that the Experience Cloud checks never inspect.' },
76
77
  'auth-providers': { effort: 'moderate', impact: 'Unvetted social/SAML identity providers with just-in-time provisioning can let attackers federate in or auto-create over-privileged users.' },
77
78
  'guest-api-access': { effort: 'quick', impact: 'A guest user with API access can drive the raw REST/Bulk API, turning readable objects into scriptable mass extraction (and Hard Delete into irreversible destruction) without login.' },
79
+ 'guest-user-visibility': { effort: 'quick', impact: 'A guest holding View All Users, or a public external OWD on User, hands unauthenticated visitors the full staff roster — a ready-made target list for phishing and credential stuffing against named admins.' },
78
80
  'external-credentials': { effort: 'moderate', impact: 'Callouts with no or custom authentication can be spoofed or leak a static secret, exposing the integrated system and the data crossing it.' },
79
81
  'login-anomaly': { effort: 'quick', impact: 'An account logging in from many distinct IPs signals credential sharing or compromise; caught late, it means an attacker already has a working session.' },
80
82
  'session-hardening': { effort: 'quick', impact: 'Weak clickjack/CSRF/session-lock/XSS settings let attackers hijack authenticated sessions via framing, forged requests, or injected script.' },
@@ -0,0 +1,28 @@
1
+ import type { RiskLevel } from '@cclabsnz/sf-core';
2
+ import type { Finding } from './Finding.js';
3
+ /** Audit completed; nothing the caller asked to fail on. */
4
+ export declare const EXIT_OK = 0;
5
+ /** Findings at or above the --fail-on threshold. */
6
+ export declare const EXIT_FINDINGS = 1;
7
+ /** Audit ran, but checks could not gather evidence. Only when --fail-on-inconclusive is set. */
8
+ export declare const EXIT_INCONCLUSIVE = 3;
9
+ export interface ExitOptions {
10
+ failOn?: RiskLevel;
11
+ failOnInconclusive?: boolean;
12
+ }
13
+ /**
14
+ * Findings at or above `failOn`.
15
+ *
16
+ * Ranks are compared only after confirming the level is gateable. Testing
17
+ * `ORDER.indexOf(level) <= threshold` alone treats INFO (index -1) as more severe
18
+ * than CRITICAL, which made every passing check a violation.
19
+ */
20
+ export declare function violationsFor(findings: Finding[], failOn: RiskLevel): Finding[];
21
+ /**
22
+ * The process exit code for a completed audit.
23
+ *
24
+ * A definite finding outranks unknown coverage: when both apply the caller gets
25
+ * EXIT_FINDINGS, and the inconclusive count is still carried in the report body.
26
+ */
27
+ export declare function resolveExitCode(findings: Finding[], opts: ExitOptions): number;
28
+ //# sourceMappingURL=exitCode.d.ts.map
@@ -0,0 +1,46 @@
1
+ /** Audit completed; nothing the caller asked to fail on. */
2
+ export const EXIT_OK = 0;
3
+ /** Findings at or above the --fail-on threshold. */
4
+ export const EXIT_FINDINGS = 1;
5
+ /** Audit ran, but checks could not gather evidence. Only when --fail-on-inconclusive is set. */
6
+ export const EXIT_INCONCLUSIVE = 3;
7
+ /**
8
+ * Severity order, most severe first. INFO is deliberately absent: it is not a
9
+ * severity a caller can gate on, it is the level carried by passing and
10
+ * inconclusive findings.
11
+ */
12
+ const ORDER = ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW'];
13
+ /**
14
+ * Findings at or above `failOn`.
15
+ *
16
+ * Ranks are compared only after confirming the level is gateable. Testing
17
+ * `ORDER.indexOf(level) <= threshold` alone treats INFO (index -1) as more severe
18
+ * than CRITICAL, which made every passing check a violation.
19
+ */
20
+ export function violationsFor(findings, failOn) {
21
+ const threshold = ORDER.indexOf(failOn);
22
+ if (threshold < 0)
23
+ return [];
24
+ return findings.filter((f) => {
25
+ if (f.passed === true || f.inconclusive === true)
26
+ return false;
27
+ const rank = ORDER.indexOf(f.riskLevel);
28
+ return rank >= 0 && rank <= threshold;
29
+ });
30
+ }
31
+ /**
32
+ * The process exit code for a completed audit.
33
+ *
34
+ * A definite finding outranks unknown coverage: when both apply the caller gets
35
+ * EXIT_FINDINGS, and the inconclusive count is still carried in the report body.
36
+ */
37
+ export function resolveExitCode(findings, opts) {
38
+ if (opts.failOn !== undefined && violationsFor(findings, opts.failOn).length > 0) {
39
+ return EXIT_FINDINGS;
40
+ }
41
+ if (opts.failOnInconclusive === true && findings.some((f) => f.inconclusive === true)) {
42
+ return EXIT_INCONCLUSIVE;
43
+ }
44
+ return EXIT_OK;
45
+ }
46
+ //# sourceMappingURL=exitCode.js.map
@@ -33,11 +33,11 @@ export function loadScoringConfig(filePath, knownCheckIds, warn) {
33
33
  riskScores: validated.riskScores ?? DEFAULT_SCORING_CONFIG.riskScores,
34
34
  checkWeights: safeCheckWeights,
35
35
  gradeThresholds: {
36
- A: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.A, ...(validated.gradeThresholds?.A ?? {}) },
37
- B: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.B, ...(validated.gradeThresholds?.B ?? {}) },
38
- C: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.C, ...(validated.gradeThresholds?.C ?? {}) },
39
- D: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.D, ...(validated.gradeThresholds?.D ?? {}) },
40
- F: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.F, ...(validated.gradeThresholds?.F ?? {}) },
36
+ A: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.A, ...validated.gradeThresholds?.A },
37
+ B: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.B, ...validated.gradeThresholds?.B },
38
+ C: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.C, ...validated.gradeThresholds?.C },
39
+ D: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.D, ...validated.gradeThresholds?.D },
40
+ F: { ...DEFAULT_SCORING_CONFIG.gradeThresholds.F, ...validated.gradeThresholds?.F },
41
41
  },
42
42
  };
43
43
  }
@@ -165,7 +165,7 @@ export class HtmlRenderer {
165
165
  .map((c) => {
166
166
  const conf = c.confidence === 'named' ? '' : ' (potential)';
167
167
  const steps = c.steps
168
- .map((s, i) => `<li><strong>${escStr(s.title ?? s.findingId)}</strong> (${escStr(s.severity ?? '—')}): grants <code>${escStr(s.capability)}</code></li>`)
168
+ .map((s) => `<li><strong>${escStr(s.title ?? s.findingId)}</strong> (${escStr(s.severity ?? '—')}): grants <code>${escStr(s.capability)}</code></li>`)
169
169
  .join('');
170
170
  return `<div class="attack-chain severity-${c.severity.toLowerCase()}">
171
171
  <h3>[${escStr(c.severity)}] ${escStr(c.title)}${conf}</h3>
@@ -22,6 +22,12 @@ Directory to write the report file. Defaults to the current directory.
22
22
  Exit with code 1 if any finding is at or above this severity level.
23
23
  Options: CRITICAL, HIGH, MEDIUM, LOW
24
24
 
25
+ ## fail-on-inconclusive
26
+
27
+ Exit with code 3 if any check could not gather evidence because the audit user lacked
28
+ the required permission. Off by default, so existing pipelines are unaffected. A finding
29
+ at or above `--fail-on` takes precedence and still exits 1.
30
+
25
31
  ## checks
26
32
 
27
33
  Comma-separated check IDs to run instead of all checks (e.g. `hardcoded-credentials,apex-sharing`).