@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.
- package/bin/daemon.js +7 -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)
|
|
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