@cclabsnz/sf-audit 1.27.0 → 1.28.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.
@@ -0,0 +1,21 @@
1
+ export type CitationBasis = 'scf' | 'direct';
2
+ export interface HsupCitation {
3
+ id: string;
4
+ basis: CitationBasis;
5
+ reason?: string;
6
+ findings?: string[];
7
+ }
8
+ export interface NzismCitation {
9
+ section: string;
10
+ basis: CitationBasis;
11
+ controls?: string[];
12
+ reason?: string;
13
+ findings?: string[];
14
+ }
15
+ export interface CheckNzCitations {
16
+ scf: string[];
17
+ hsup: HsupCitation[];
18
+ hml: string[];
19
+ nzism: NzismCitation[];
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -2,8 +2,8 @@ import { CHECK_CONTROL_MAP } from './mapping.js';
2
2
  import { getControl } from './catalogs/index.js';
3
3
  const PACKS = {
4
4
  universal: ['OWASP', 'OWASP_LLM', 'SOC2', 'ISO27001'],
5
- nz: ['ISO27001', 'HISO10029', 'PRIVACY_ACT', 'NZISM'],
6
- all: ['OWASP', 'OWASP_LLM', 'SOC2', 'ISO27001', 'SBS', 'HISO10029', 'PRIVACY_ACT', 'NZISM', 'HIPAA', 'GDPR'],
5
+ nz: ['ISO27001', 'HISO10029_3', 'HISO10029_4', 'PRIVACY_ACT', 'NZISM'],
6
+ all: ['OWASP', 'OWASP_LLM', 'SOC2', 'ISO27001', 'SBS', 'HISO10029_3', 'HISO10029_4', 'PRIVACY_ACT', 'NZISM', 'HIPAA', 'GDPR'],
7
7
  };
8
8
  export function packFrameworks(pack) {
9
9
  return PACKS[pack];
@@ -28,10 +28,13 @@ export function resolveControls(checkId, opts = {}) {
28
28
  export function getComplianceTags(checkId) {
29
29
  return CHECK_CONTROL_MAP[checkId] ?? [];
30
30
  }
31
+ // `hiso` selects both HISO parts; `hiso-provider` (10029.3, health organisations) and
32
+ // `hiso-supplier` (10029.4, their suppliers) select one. Which applies depends on who owns the org.
31
33
  const ALIAS = {
32
34
  owasp: 'OWASP', 'owasp-llm': 'OWASP_LLM', llm: 'OWASP_LLM',
33
35
  soc2: 'SOC2', iso: 'ISO27001', iso27001: 'ISO27001', sbs: 'SBS',
34
- privacy: 'PRIVACY_ACT', 'privacy-act': 'PRIVACY_ACT', hiso: 'HISO10029', nzism: 'NZISM',
36
+ privacy: 'PRIVACY_ACT', 'privacy-act': 'PRIVACY_ACT', nzism: 'NZISM',
37
+ hiso: ['HISO10029_3', 'HISO10029_4'], 'hiso-provider': 'HISO10029_3', 'hiso-supplier': 'HISO10029_4',
35
38
  hipaa: 'HIPAA', gdpr: 'GDPR',
36
39
  };
37
40
  /** Resolve a --frameworks value: a pack name (universal|nz|all) or a comma list of aliases. */
@@ -41,9 +44,11 @@ export function resolveFrameworks(input) {
41
44
  return packFrameworks(v);
42
45
  const out = [];
43
46
  for (const part of v.split(',').map((s) => s.trim())) {
44
- const fw = ALIAS[part];
45
- if (fw && !out.includes(fw))
46
- out.push(fw);
47
+ const fws = ALIAS[part];
48
+ for (const fw of fws === undefined ? [] : Array.isArray(fws) ? fws : [fws]) {
49
+ if (!out.includes(fw))
50
+ out.push(fw);
51
+ }
47
52
  }
48
53
  return out;
49
54
  }
@@ -1,4 +1,4 @@
1
- export type Framework = 'OWASP' | 'OWASP_LLM' | 'SOC2' | 'ISO27001' | 'SBS' | 'HISO10029' | 'PRIVACY_ACT' | 'NZISM' | 'HIPAA' | 'GDPR';
1
+ export type Framework = 'OWASP' | 'OWASP_LLM' | 'SOC2' | 'ISO27001' | 'SBS' | 'HISO10029_3' | 'HISO10029_4' | 'PRIVACY_ACT' | 'NZISM' | 'HIPAA' | 'GDPR';
2
2
  export interface ControlDef {
3
3
  id: string;
4
4
  framework: Framework;
@@ -32,7 +32,7 @@ const TACTIC_SHORT = {
32
32
  const FRAMEWORK_LABEL = {
33
33
  OWASP: 'OWASP Top 10', OWASP_LLM: 'OWASP LLM Top 10', SOC2: 'SOC 2', ISO27001: 'ISO/IEC 27001',
34
34
  SBS: 'Security Benchmark for Salesforce', PRIVACY_ACT: 'NZ Privacy Act',
35
- HISO10029: 'HISO 10029', NZISM: 'NZISM', HIPAA: 'HIPAA', GDPR: 'GDPR',
35
+ HISO10029_3: 'HISO 10029.3 (providers)', HISO10029_4: 'HISO 10029.4 (suppliers)', NZISM: 'NZISM', HIPAA: 'HIPAA', GDPR: 'GDPR',
36
36
  };
37
37
  /** The grade's reason in words: "F: 7 CRITICAL (4 findings, 3 attack chains) (D allows none)" reads as a sentence. */
38
38
  function gradeInWords(grade, reason) {
@@ -23,7 +23,8 @@ export function buildComplianceMatrix(result, frameworks) {
23
23
  for (const f of active) {
24
24
  if (!f.checkId)
25
25
  continue;
26
- for (const id of CHECK_CONTROL_MAP[f.checkId] ?? []) {
26
+ // Per-finding tags: HISO 10029 and NZISM citations can be scoped to some of a check's findings.
27
+ for (const id of f.complianceTags ?? CHECK_CONTROL_MAP[f.checkId] ?? []) {
27
28
  if (hits.has(id))
28
29
  hits.get(id).push(f);
29
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cclabsnz/sf-audit",
3
- "version": "1.27.0",
3
+ "version": "1.28.0",
4
4
  "description": "Read-only Salesforce security audit for the sf CLI: 109 checks, attack-chain correlation, A-F risk grading, compliance mapping, free EventLogFile capture, and Guest User Anomaly investigation.",
5
5
  "keywords": [
6
6
  "salesforce",