@profullstack/threatcrush 0.12.5 → 0.12.6
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/dist/daemon.js +14 -3
- package/dist/daemon.js.map +1 -1
- package/dist/index.js +42 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/daemon.js
CHANGED
|
@@ -9482,14 +9482,25 @@ var RemediationManager = class {
|
|
|
9482
9482
|
}
|
|
9483
9483
|
this.blocklist = live;
|
|
9484
9484
|
this.saveState();
|
|
9485
|
-
|
|
9486
|
-
let applied = [];
|
|
9485
|
+
let applied = null;
|
|
9487
9486
|
try {
|
|
9488
9487
|
applied = await this.adapter.listBlocked();
|
|
9489
9488
|
} catch {
|
|
9490
9489
|
}
|
|
9490
|
+
if (applied) {
|
|
9491
|
+
const known = new Set(live.filter((b) => !b.dry_run).map((b) => b.ip));
|
|
9492
|
+
for (const ip of applied) {
|
|
9493
|
+
if (known.has(ip)) continue;
|
|
9494
|
+
this.logLine(`[firewall] reconcile: dropping stale rule for ${ip} (no record of why)`);
|
|
9495
|
+
try {
|
|
9496
|
+
await this.adapter.unblock(ip);
|
|
9497
|
+
} catch {
|
|
9498
|
+
}
|
|
9499
|
+
}
|
|
9500
|
+
}
|
|
9501
|
+
if (this.config.dry_run) return;
|
|
9491
9502
|
for (const entry of live) {
|
|
9492
|
-
if (applied
|
|
9503
|
+
if (applied?.includes(entry.ip)) continue;
|
|
9493
9504
|
try {
|
|
9494
9505
|
await this.adapter.block(entry.ip);
|
|
9495
9506
|
} catch {
|