This commit is contained in:
Sefinek 2024-12-25 01:11:20 +01:00
parent 83571456df
commit 0281b6dd8c

View file

@ -17,7 +17,7 @@ const reportToAbuseIPDb = async (logData, categories, comment) => {
headers: { 'Key': ABUSEIPDB_API_KEY }, headers: { 'Key': ABUSEIPDB_API_KEY },
}); });
log(0, `Successfully reported ${logData.srcIp} (${logData.dpt}/${logData.proto}); Categories ${categories}; Abuse: ${data.data.abuseConfidenceScore}%`); log(0, `Reported ${logData.srcIp} (${logData.dpt}/${logData.proto}); Categories ${categories}; Abuse: ${data.data.abuseConfidenceScore}%`);
return true; return true;
} catch (err) { } catch (err) {
log(2, `Failed to report ${logData.srcIp} (${logData.dpt}/${logData.proto}); ${err.message}\n${JSON.stringify(err.response.data?.errors || err.response.data)}`); log(2, `Failed to report ${logData.srcIp} (${logData.dpt}/${logData.proto}); ${err.message}\n${JSON.stringify(err.response.data?.errors || err.response.data)}`);
@ -89,7 +89,7 @@ const processLogLine = async line => {
(seconds || !days && !hours && !minutes) && `${seconds}s`, (seconds || !days && !hours && !minutes) && `${seconds}s`,
].filter(Boolean).join(' '); ].filter(Boolean).join(' ');
log(0, `IP ${srcIp} was last reported on ${new Date(lastReportedTime * 1000).toLocaleString()} (${timeAgo} ago)`); log(0, `${srcIp} was last reported on ${new Date(lastReportedTime * 1000).toLocaleString()} (${timeAgo} ago)`);
return; return;
} }