@profullstack/threatcrush 0.13.32 → 0.13.33
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 +1 -1
- package/dist/daemon.js +17 -2
- package/dist/daemon.js.map +1 -1
- package/dist/index.js +460 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -186,7 +186,7 @@ A running daemon picks up `link` and `unlink` within a minute; no restart. It th
|
|
|
186
186
|
|
|
187
187
|
- uploads detections at or above `[cloud] min_severity` (rule detections, plus events from modules no rule reads, such as dns-monitor), batched (100 events or every 10 s), and every ban and unban the daemon makes;
|
|
188
188
|
- sends a heartbeat every 60 s with its version and hostname;
|
|
189
|
-
- runs the `threatcrush harden` checks a minute after it starts and every 24 h, and uploads the findings (
|
|
189
|
+
- runs the `threatcrush harden` checks and `threatcrush patches` a minute after it starts and every 24 h, and uploads the findings (both commands upload too; `--no-upload` skips it);
|
|
190
190
|
- every 15 s, picks up blocks and unblocks queued on the dashboard and applies them through auto-defence, so protected and allowlisted addresses and dry-run apply as they do locally;
|
|
191
191
|
- every 5 min, adds the organization's IP/CIDR allowlist to the never-block set.
|
|
192
192
|
|
package/dist/daemon.js
CHANGED
|
@@ -15519,7 +15519,8 @@ function findingEvents(serverId, results, observedAt = /* @__PURE__ */ new Date(
|
|
|
15519
15519
|
severity: r.severity,
|
|
15520
15520
|
title: r.title.slice(0, MAX_TITLE_CHARS),
|
|
15521
15521
|
recommendation: r.recommendation,
|
|
15522
|
-
observed_at: observedAt.toISOString()
|
|
15522
|
+
observed_at: observedAt.toISOString(),
|
|
15523
|
+
...r.details ? { details: trimMetadata(r.details) } : {}
|
|
15523
15524
|
}));
|
|
15524
15525
|
}
|
|
15525
15526
|
|
|
@@ -18049,7 +18050,21 @@ async function runHardeningChecks() {
|
|
|
18049
18050
|
{ timeout: 12e4, maxBuffer: 4 * 1024 * 1024 }
|
|
18050
18051
|
);
|
|
18051
18052
|
const parsed = JSON.parse(stdout.slice(stdout.indexOf("{")));
|
|
18052
|
-
|
|
18053
|
+
const findings = Array.isArray(parsed.findings) ? parsed.findings : [];
|
|
18054
|
+
const patches = await runPatchCheck().catch((err) => {
|
|
18055
|
+
logLine(`[cloud] patch check failed: ${err.message.split("\n")[0]}`);
|
|
18056
|
+
return null;
|
|
18057
|
+
});
|
|
18058
|
+
return patches ? [...findings, patches] : findings;
|
|
18059
|
+
}
|
|
18060
|
+
async function runPatchCheck() {
|
|
18061
|
+
const { stdout } = await (0, import_node_util.promisify)(import_node_child_process8.execFile)(
|
|
18062
|
+
process.execPath,
|
|
18063
|
+
[(0, import_node_path19.join)(__dirname, "index.js"), "patches", "--json", "--no-upload"],
|
|
18064
|
+
{ timeout: 3e5, maxBuffer: 16 * 1024 * 1024 }
|
|
18065
|
+
);
|
|
18066
|
+
const parsed = JSON.parse(stdout.slice(stdout.indexOf("{")));
|
|
18067
|
+
return parsed.finding ?? null;
|
|
18053
18068
|
}
|
|
18054
18069
|
function logLine(line) {
|
|
18055
18070
|
try {
|