@cclabsnz/sf-audit 1.24.1 → 1.25.1

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.
@@ -38,5 +38,28 @@ export interface PlannedAction {
38
38
  * work is wave 3 and the rest wave 2. Within a wave, the most risk removed comes first.
39
39
  */
40
40
  export declare function buildActionPlan(findings: Finding[], chains: AttackChain[]): PlannedAction[];
41
+ /** How long an action takes, in the words both reports print. */
42
+ export declare const EFFORT_LABEL: {
43
+ readonly quick: 'Under a day';
44
+ readonly moderate: 'Days';
45
+ readonly project: 'Weeks';
46
+ };
47
+ /** When to start each wave. */
48
+ export declare const WAVE_LABEL: {
49
+ readonly 1: 'Start now';
50
+ readonly 2: 'Next 30 days';
51
+ readonly 3: 'This quarter';
52
+ };
53
+ /** Why an action sits in its wave. */
54
+ export declare const WAVE_WHY: {
55
+ readonly 1: 'breaks a critical chain or closes a critical finding, whatever the effort';
56
+ readonly 2: 'high severity, days of work or less';
57
+ readonly 3: 'high severity, weeks of work';
58
+ };
59
+ /**
60
+ * The plan's conclusion in one sentence: the executive summary's headline and the technical report's
61
+ * "fix first" title, so both reports state the same answer.
62
+ */
63
+ export declare function planHeadline(plan: PlannedAction[], chains: AttackChain[], openHigh: number): string;
41
64
  export {};
42
65
  //# sourceMappingURL=ActionPlan.d.ts.map
@@ -96,4 +96,41 @@ export function buildActionPlan(findings, chains) {
96
96
  }
97
97
  return actions.sort((a, b) => a.wave - b.wave || b.risk - a.risk || a.title.localeCompare(b.title));
98
98
  }
99
+ /** How long an action takes, in the words both reports print. */
100
+ export const EFFORT_LABEL = { quick: 'Under a day', moderate: 'Days', project: 'Weeks' };
101
+ /** When to start each wave. */
102
+ export const WAVE_LABEL = { 1: 'Start now', 2: 'Next 30 days', 3: 'This quarter' };
103
+ /** Why an action sits in its wave. */
104
+ export const WAVE_WHY = {
105
+ 1: 'breaks a critical chain or closes a critical finding, whatever the effort',
106
+ 2: 'high severity, days of work or less',
107
+ 3: 'high severity, weeks of work',
108
+ };
109
+ const NUMBER_WORDS = ['No', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'];
110
+ const countWord = (n) => NUMBER_WORDS[n] ?? String(n);
111
+ const actionsWord = (n) => `${countWord(n)} action${n === 1 ? '' : 's'}`;
112
+ const verb = (n, one, many) => (n === 1 ? one : many);
113
+ /**
114
+ * The plan's conclusion in one sentence: the executive summary's headline and the technical report's
115
+ * "fix first" title, so both reports state the same answer.
116
+ */
117
+ export function planHeadline(plan, chains, openHigh) {
118
+ // Every critical chain, potential ones too: a path is only "closed" when an action breaks it.
119
+ const allCrit = chains.map((c, i) => ({ c, i })).filter((x) => x.c.severity === 'CRITICAL');
120
+ const wave1 = plan.filter((a) => a.wave === 1);
121
+ const brokenByWave1 = new Set(wave1.flatMap((a) => a.breaks));
122
+ const allCritBroken = allCrit.length > 0 && allCrit.every((x) => brokenByWave1.has(x.i));
123
+ const rest = plan.length - wave1.length;
124
+ const restText = rest ? `; ${rest} more action${verb(rest, ' completes', 's complete')} the plan` : '';
125
+ const n1 = wave1.length;
126
+ if (plan.length === 0)
127
+ return 'No critical or high-severity issues are open; the remaining fixes are routine hardening';
128
+ if (allCritBroken)
129
+ return `${actionsWord(n1)} to start now ${verb(n1, 'closes', 'close')} every critical attack path${restText}`;
130
+ if (n1)
131
+ return `${actionsWord(n1)} to start now ${verb(n1, 'addresses', 'address')} the critical exposure${restText}`;
132
+ if (openHigh)
133
+ return `${actionsWord(plan.length)} ${verb(plan.length, 'addresses', 'address')} every open high-severity issue; none is critical`;
134
+ return `${actionsWord(plan.length)} ${verb(plan.length, 'addresses', 'address')} the remaining exposure; none is critical or high`;
135
+ }
99
136
  //# sourceMappingURL=ActionPlan.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cclabsnz/sf-audit",
3
- "version": "1.24.1",
3
+ "version": "1.25.1",
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",
@@ -117,7 +117,8 @@
117
117
  "fast-uri@3": "^3.1.9",
118
118
  "browserslist": "^4.28.7",
119
119
  "@istanbuljs/load-nyc-config>js-yaml": "^4.1.1",
120
- "jest-config>deepmerge": "4.1.1"
120
+ "jest-config>deepmerge": "4.1.1",
121
+ "minimatch@<11.0.1": "^11.0.1"
121
122
  }
122
123
  }
123
124
  }