@roflsec/fail2scan 0.0.21 → 0.0.23

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.
Files changed (2) hide show
  1. package/bin/daemon.js +7 -2
  2. package/package.json +1 -1
package/bin/daemon.js CHANGED
@@ -402,8 +402,11 @@ class FileTail{
402
402
  const tail=new FileTail(LOG_PATH,line=>{
403
403
  try{
404
404
  if(!BAN_RE.test(line)) return;
405
- const ip=extractIpFromLine(line);
406
- if(!ip) return;
405
+ const ip = extractIpFromLine(line);
406
+ if (!ip || ip === "null" || ip.trim() === "") {
407
+ log("Ignored invalid IP:", ip);
408
+ return;
409
+ }
407
410
  q.push(ip);
408
411
  }catch(e){
409
412
  log('onLine handler error',e.message||e);
@@ -423,3 +426,5 @@ function shutdown(){
423
426
 
424
427
  process.on('SIGINT',shutdown);
425
428
  process.on('SIGTERM',shutdown);
429
+ tail
430
+ //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roflsec/fail2scan",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Fail2Scan daemon - watches fail2ban logs and scans banned IPs using nmap, dig and whois.",
5
5
  "bin": {
6
6
  "fail2scan-daemon": "./bin/daemon.js"