@profullstack/threatcrush 0.18.0 → 0.18.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.
- package/README.md +4 -1
- package/dist/daemon.js +5 -1
- package/dist/daemon.js.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/systemd/threatcrushd.service +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -687,7 +687,10 @@ box's listening ports raises a high `threat-feed-inbound` event that carries
|
|
|
687
687
|
the source address, so auto-defence can ban it.
|
|
688
688
|
|
|
689
689
|
It needs root, `bpftrace` (`apt install bpftrace`) and kernel BTF
|
|
690
|
-
(`/sys/kernel/btf/vmlinux`).
|
|
690
|
+
(`/sys/kernel/btf/vmlinux`). Under systemd the unit must also grant `CAP_BPF`
|
|
691
|
+
and `CAP_PERFMON`: enable `[edr]` first, then run `threatcrush install-service`
|
|
692
|
+
again, which adds them when the eBPF source is configured. A unit installed
|
|
693
|
+
before that makes bpftrace exit with "Missing CAP_BPF capability". `source = "auto"` picks eBPF when all three are
|
|
691
694
|
present and auditd otherwise; `source = "ebpf"` logs why and uses auditd when
|
|
692
695
|
they are not. If bpftrace exits it is restarted with exponential backoff (1s
|
|
693
696
|
up to 60s); if it fails to start three times in a row, the daemon falls back
|
package/dist/daemon.js
CHANGED
|
@@ -28930,6 +28930,7 @@ function probeHost(configured) {
|
|
|
28930
28930
|
platform: process.platform
|
|
28931
28931
|
};
|
|
28932
28932
|
}
|
|
28933
|
+
var BPFTRACE_ENV = { PATH: "/usr/sbin:/usr/bin:/sbin:/bin", LANG: "C" };
|
|
28933
28934
|
var STDERR_TAIL = 2048;
|
|
28934
28935
|
var HEALTHY_AFTER_MS = 3e4;
|
|
28935
28936
|
var KILL_GRACE_MS = 3e3;
|
|
@@ -29040,7 +29041,7 @@ var BpftraceSource = class {
|
|
|
29040
29041
|
child = this.spawnFn(this.opts.bpftracePath, bpftraceArgs({ network: this.opts.network, peers: this.opts.peers }), {
|
|
29041
29042
|
stdio: ["ignore", "pipe", "pipe"],
|
|
29042
29043
|
shell: false,
|
|
29043
|
-
env:
|
|
29044
|
+
env: BPFTRACE_ENV
|
|
29044
29045
|
});
|
|
29045
29046
|
} catch (error) {
|
|
29046
29047
|
this.onExit(null, null, error.message);
|
|
@@ -29283,6 +29284,9 @@ var EdrWatch = class {
|
|
|
29283
29284
|
onFatal: (failure) => {
|
|
29284
29285
|
this.bpftrace = null;
|
|
29285
29286
|
this.opts.log(`[edr] ${failure}; falling back to auditd`);
|
|
29287
|
+
if (/Missing CAP_(BPF|PERFMON)/.test(failure)) {
|
|
29288
|
+
this.opts.log("[edr] the service unit does not grant CAP_BPF and CAP_PERFMON: re-run `threatcrush install-service` with [edr] enabled, then restart the daemon");
|
|
29289
|
+
}
|
|
29286
29290
|
this.startAuditd(`eBPF failed: ${failure}`);
|
|
29287
29291
|
},
|
|
29288
29292
|
log: this.opts.log
|