Update index.js
This commit is contained in:
1 parent
c1cb5dfe54
commit
9be7f51ed9
3 files changed
+14
-8
No files matched your search
@@ -46,7 +46,7 @@ const checkRateLimit = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const reportIp = async ({ srcIp, dpt = 'N/A', proto = 'N/A', id, timestamp }, categories, comment) => {
|
const reportIp = async ({ srcIp, dpt = 'N/A', proto = 'N/A', timestamp, timestampRaw }, categories, comment) => {
|
||||||
if (!srcIp) return logger.log('Missing source IP (srcIp)', 3);
|
if (!srcIp) return logger.log('Missing source IP (srcIp)', 3);
|
||||||
|
|
||||||
await checkRateLimit();
|
await checkRateLimit();
|
||||||
@@ -67,7 +67,7 @@ const reportIp = async ({ srcIp, dpt = 'N/A', proto = 'N/A', id, timestamp }, ca
|
|||||||
timestamp,
|
timestamp,
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.log(`Reported ${srcIp} [${dpt}/${proto}]; ID: ${id}; Categories: ${categories}; Abuse: ${res.data.abuseConfidenceScore}%`, 1);
|
logger.log(`Reported ${srcIp} [${dpt}/${proto}]; Categories: ${categories}; Abuse: ${res.data.threat_score}%; Raw timestamp: ${timestampRaw}; Parsed: ${timestamp}`, 1);
|
||||||
return true;
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const status = err.response?.status ?? 'unknown';
|
const status = err.response?.status ?? 'unknown';
|
||||||
|
|||||||
Generated
+11
-5
@@ -19,7 +19,7 @@
|
|||||||
"ipaddr.js": "^2.2.0",
|
"ipaddr.js": "^2.2.0",
|
||||||
"semver": "^7.7.2",
|
"semver": "^7.7.2",
|
||||||
"simple-git": "^3.28.0",
|
"simple-git": "^3.28.0",
|
||||||
"ufw-log-parser": "^0.1.1"
|
"ufw-log-parser": "github:sefinek/ufw-log-parser"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.33.0",
|
"@eslint/js": "^9.33.0",
|
||||||
@@ -498,10 +498,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ufw-log-parser": {
|
"node_modules/ufw-log-parser": {
|
||||||
"version": "0.1.1",
|
"version": "1.0.0-beta.0",
|
||||||
"resolved": "https://registry.npmjs.org/ufw-log-parser/-/ufw-log-parser-0.1.1.tgz",
|
"resolved": "git+ssh://git@github.com/sefinek/ufw-log-parser.git#657f125d26821400e395126eee37e0ef29ec3c6d",
|
||||||
"integrity": "sha512-q8VUZJIDcIKnVPiKR3B/pEyYakzEaNZ6otxFcZAULa6pwAnfVm017CG/3nyvsNl968jTXesFdRcGBdgszbsoiQ==",
|
"license": "MIT",
|
||||||
"license": "MIT"
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://sefinek.net/donate"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -30,7 +30,7 @@
|
|||||||
"ipaddr.js": "^2.2.0",
|
"ipaddr.js": "^2.2.0",
|
||||||
"semver": "^7.7.2",
|
"semver": "^7.7.2",
|
||||||
"simple-git": "^3.28.0",
|
"simple-git": "^3.28.0",
|
||||||
"ufw-log-parser": "^0.1.1"
|
"ufw-log-parser": "github:sefinek/ufw-log-parser"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.33.0",
|
"@eslint/js": "^9.33.0",
|
||||||
|
|||||||
Reference in new issue
Block a user