@cclabsnz/sf-audit 1.13.0 → 1.14.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/CHANGELOG.md +42 -0
- package/README.md +10 -0
- package/lib/commands/audit/incident/collect.d.ts +22 -0
- package/lib/commands/audit/incident/collect.js +46 -0
- package/lib/commands/audit/incident/report.d.ts +29 -0
- package/lib/commands/audit/incident/report.js +87 -0
- package/lib/incident/analyse/actions.d.ts +22 -0
- package/lib/incident/analyse/actions.js +73 -0
- package/lib/incident/analyse/actors.d.ts +56 -0
- package/lib/incident/analyse/actors.js +231 -0
- package/lib/incident/analyse/baseline.d.ts +24 -0
- package/lib/incident/analyse/baseline.js +66 -0
- package/lib/incident/analyse/configDelta.d.ts +33 -0
- package/lib/incident/analyse/configDelta.js +98 -0
- package/lib/incident/analyse/index.d.ts +41 -0
- package/lib/incident/analyse/index.js +68 -0
- package/lib/incident/analyse/outcomes.d.ts +28 -0
- package/lib/incident/analyse/outcomes.js +32 -0
- package/lib/incident/analyse/responses.d.ts +59 -0
- package/lib/incident/analyse/responses.js +201 -0
- package/lib/incident/analyse/verdict.d.ts +40 -0
- package/lib/incident/analyse/verdict.js +149 -0
- package/lib/incident/bundleIo.d.ts +34 -0
- package/lib/incident/bundleIo.js +74 -0
- package/lib/incident/collect/collectBundle.d.ts +21 -0
- package/lib/incident/collect/collectBundle.js +130 -0
- package/lib/incident/collect/discoverWaves.d.ts +15 -0
- package/lib/incident/collect/discoverWaves.js +90 -0
- package/lib/incident/collect/followUp.d.ts +14 -0
- package/lib/incident/collect/followUp.js +64 -0
- package/lib/incident/collect/orgErrors.d.ts +5 -0
- package/lib/incident/collect/orgErrors.js +11 -0
- package/lib/incident/collect/snapshotOrg.d.ts +18 -0
- package/lib/incident/collect/snapshotOrg.js +117 -0
- package/lib/incident/collect/streamGuestLogs.d.ts +17 -0
- package/lib/incident/collect/streamGuestLogs.js +116 -0
- package/lib/incident/csv.d.ts +32 -0
- package/lib/incident/csv.js +176 -0
- package/lib/incident/ipRanges.d.ts +23 -0
- package/lib/incident/ipRanges.js +64 -0
- package/lib/incident/model.d.ts +132 -0
- package/lib/incident/model.js +26 -0
- package/lib/incident/render/evidence.d.ts +15 -0
- package/lib/incident/render/evidence.js +52 -0
- package/lib/incident/render/html.d.ts +7 -0
- package/lib/incident/render/html.js +144 -0
- package/lib/incident/render/labels.d.ts +9 -0
- package/lib/incident/render/labels.js +22 -0
- package/lib/incident/render/markdown.d.ts +17 -0
- package/lib/incident/render/markdown.js +91 -0
- package/lib/incident/render/redact.d.ts +7 -0
- package/lib/incident/render/redact.js +62 -0
- package/lib/incident/text.d.ts +9 -0
- package/lib/incident/text.js +43 -0
- package/package.json +7 -4
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plain-string matching for values that come from the org (site labels, user names). Built
|
|
3
|
+
* without RegExp so no org-controlled text ever becomes a pattern.
|
|
4
|
+
*/
|
|
5
|
+
const isWordChar = (c) => c !== undefined && /[A-Za-z0-9]/.test(c);
|
|
6
|
+
/**
|
|
7
|
+
* Every start index of `needle` in `text`, compared case-insensitively slice by slice. Searching
|
|
8
|
+
* a lowercased copy would drift: some characters lengthen when lowercased (U+0130 'İ').
|
|
9
|
+
*/
|
|
10
|
+
function indexesOf(text, needle) {
|
|
11
|
+
const out = [];
|
|
12
|
+
if (!needle)
|
|
13
|
+
return out;
|
|
14
|
+
const n = needle.toLowerCase();
|
|
15
|
+
for (let i = 0; i + needle.length <= text.length;) {
|
|
16
|
+
if (text.slice(i, i + needle.length).toLowerCase() === n) {
|
|
17
|
+
out.push(i);
|
|
18
|
+
i += needle.length;
|
|
19
|
+
}
|
|
20
|
+
else
|
|
21
|
+
i++;
|
|
22
|
+
}
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
/** True when `needle` occurs in `text` bounded by non-alphanumerics or the string edges. */
|
|
26
|
+
export function containsWord(text, needle) {
|
|
27
|
+
const n = needle.trim();
|
|
28
|
+
return indexesOf(text, n).some((i) => !isWordChar(text[i - 1]) && !isWordChar(text[i + n.length]));
|
|
29
|
+
}
|
|
30
|
+
/** Replaces every case-insensitive occurrence of `needle` in `text` with `replacement`. */
|
|
31
|
+
export function replaceInsensitive(text, needle, replacement) {
|
|
32
|
+
const hits = indexesOf(text, needle);
|
|
33
|
+
if (hits.length === 0)
|
|
34
|
+
return text;
|
|
35
|
+
let out = '';
|
|
36
|
+
let last = 0;
|
|
37
|
+
for (const i of hits) {
|
|
38
|
+
out += text.slice(last, i) + replacement;
|
|
39
|
+
last = i + needle.length;
|
|
40
|
+
}
|
|
41
|
+
return out + text.slice(last);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=text.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cclabsnz/sf-audit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Read-only Salesforce security audit for the sf CLI: 88 checks, attack-chain correlation, A-F risk grading, and compliance mapping to OWASP, SOC 2, ISO 27001, NZISM and more.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"salesforce",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@cclabsnz/sf-core": "^0.3.0",
|
|
41
41
|
"@oclif/core": "^4",
|
|
42
|
-
"@salesforce/core": "^9",
|
|
42
|
+
"@salesforce/core": "^9.3.0",
|
|
43
43
|
"@salesforce/sf-plugins-core": "^13",
|
|
44
44
|
"chart.js": "^4.5.1",
|
|
45
45
|
"zod": "^4"
|
|
@@ -81,6 +81,9 @@
|
|
|
81
81
|
},
|
|
82
82
|
"apps": {
|
|
83
83
|
"description": "Analyze connected-app least-privilege from EventLogFile usage"
|
|
84
|
+
},
|
|
85
|
+
"incident": {
|
|
86
|
+
"description": "Investigate Guest User Anomaly events: collect an evidence bundle, then report"
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
}
|
|
@@ -98,8 +101,8 @@
|
|
|
98
101
|
"form-data": "^4.0.6",
|
|
99
102
|
"js-yaml@3": "^3.15.2",
|
|
100
103
|
"handlebars": "^4.7.9",
|
|
101
|
-
"brace-expansion": "^5.0.
|
|
102
|
-
"fast-uri@3": "^3.1.
|
|
104
|
+
"brace-expansion": "^5.0.11",
|
|
105
|
+
"fast-uri@3": "^3.1.8",
|
|
103
106
|
"browserslist": "^4.28.7"
|
|
104
107
|
}
|
|
105
108
|
}
|