0.4.3
This commit is contained in:
1 parent
bb3c90457f
commit
8e05ba1528
4 files changed
+56
-56
No files matched your search
@@ -5,15 +5,15 @@ const fs = require('node:fs');
|
||||
const chokidar = require('chokidar');
|
||||
const { parseUfwLog } = require('ufw-log-parser');
|
||||
const banner = require('./scripts/banners/ufw.js');
|
||||
const { axios } = require('./scripts/services/axios.js');
|
||||
const { axiosService } = require('./scripts/services/axios.js');
|
||||
const { saveBufferToFile, loadBufferFromFile, sendBulkReport, BULK_REPORT_BUFFER } = require('./scripts/services/bulk.js');
|
||||
const { reportedIPs, loadReportedIPs, saveReportedIPs, isIPReportedRecently, markIPAsReported } = require('./scripts/services/cache.js');
|
||||
const { refreshServerIPs, getServerIPs } = require('./scripts/services/ipFetcher.js');
|
||||
const { repoSlug, repoUrl, version } = require('./scripts/repo.js');
|
||||
const { repoSlug, repoUrl } = require('./scripts/repo.js');
|
||||
const isSpecialPurposeIP = require('./scripts/isSpecialPurposeIP.js');
|
||||
const logger = require('./scripts/logger.js');
|
||||
const config = require('./config.js');
|
||||
const { UFW_LOG_FILE, ABUSEIPDB_API_KEY, SERVER_ID, EXTENDED_LOGS, AUTO_UPDATE_ENABLED, AUTO_UPDATE_SCHEDULE, DISCORD_WEBHOOK_ENABLED, DISCORD_WEBHOOK_URL } = config.MAIN;
|
||||
const { UFW_LOG_FILE, SERVER_ID, EXTENDED_LOGS, AUTO_UPDATE_ENABLED, AUTO_UPDATE_SCHEDULE, DISCORD_WEBHOOK_ENABLED, DISCORD_WEBHOOK_URL } = config.MAIN;
|
||||
|
||||
const ABUSE_STATE = { isLimited: false, isBuffering: false, sentBulk: false };
|
||||
const RATE_LIMIT_LOG_INTERVAL = 10 * 60 * 1000;
|
||||
@@ -60,11 +60,11 @@ const reportIp = async ({ srcIp, dpt = 'N/A', proto = 'N/A', id, timestamp }, ca
|
||||
}
|
||||
|
||||
try {
|
||||
const { data: res } = await axios.post('/report', new URLSearchParams({
|
||||
const { data: res } = await axiosService.post('/report', {
|
||||
ip: srcIp,
|
||||
categories,
|
||||
comment,
|
||||
}), { headers: { 'Key': ABUSEIPDB_API_KEY } });
|
||||
});
|
||||
|
||||
logger.log(`Reported ${srcIp} [${dpt}/${proto}]; ID: ${id}; Categories: ${categories}; Abuse: ${res.data.abuseConfidenceScore}%`, 1);
|
||||
return true;
|
||||
|
||||
Generated
+42
-42
@@ -1,35 +1,35 @@
|
||||
{
|
||||
"name": "ufw-abuseipdb-reporter",
|
||||
"version": "0.4.2",
|
||||
"version": "0.4.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ufw-abuseipdb-reporter",
|
||||
"version": "0.4.2",
|
||||
"version": "0.4.3",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"axios": "^1.10.0",
|
||||
"axios": "^1.11.0",
|
||||
"axios-retry": "^4.5.0",
|
||||
"chokidar": "^4.0.3",
|
||||
"cron": "^4.3.1",
|
||||
"csv-parse": "^5.6.0",
|
||||
"csv-stringify": "^6.5.2",
|
||||
"form-data": "^4.0.3",
|
||||
"cron": "^4.3.3",
|
||||
"csv-parse": "^6.1.0",
|
||||
"csv-stringify": "^6.6.0",
|
||||
"form-data": "^4.0.4",
|
||||
"ipaddr.js": "^2.2.0",
|
||||
"semver": "^7.7.2",
|
||||
"simple-git": "^3.28.0",
|
||||
"ufw-log-parser": "^0.1.0"
|
||||
"ufw-log-parser": "^0.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.30.1",
|
||||
"@eslint/js": "^9.33.0",
|
||||
"globals": "^16.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "9.30.1",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.30.1.tgz",
|
||||
"integrity": "sha512-zXhuECFlyep42KZUhWjfvsmXGX39W8K8LFb8AWXM9gSV9dQB+MrJGLKvW6Zw0Ggnbpw0VHTtrhFXYe3Gym18jg==",
|
||||
"version": "9.33.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.33.0.tgz",
|
||||
"integrity": "sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -55,9 +55,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/luxon": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.6.2.tgz",
|
||||
"integrity": "sha512-R/BdP7OxEMc44l2Ex5lSXHoIXTB2JLNa3y2QISIbr58U/YcsffyQrYW//hZSdrfxrjRZj3GcUoxMPGdO8gSYuw==",
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.7.1.tgz",
|
||||
"integrity": "sha512-H3iskjFIAn5SlJU7OuxUmTEpebK6TKB8rxZShDslBMZJ5u9S//KM1sbdAisiSrqwLQncVjnpi2OK2J51h+4lsg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/asynckit": {
|
||||
@@ -67,13 +67,13 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz",
|
||||
"integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==",
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz",
|
||||
"integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
"form-data": "^4.0.4",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
@@ -130,28 +130,28 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cron": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/cron/-/cron-4.3.1.tgz",
|
||||
"integrity": "sha512-7x7DoEOxV11t3OPWWMjj1xrL1PGkTV5RV+/54IJTZD7gStiaMploY43EkeBSkDZTLRbUwk+OISbQ0TR133oXyA==",
|
||||
"version": "4.3.3",
|
||||
"resolved": "https://registry.npmjs.org/cron/-/cron-4.3.3.tgz",
|
||||
"integrity": "sha512-B/CJj5yL3sjtlun6RtYHvoSB26EmQ2NUmhq9ZiJSyKIM4K/fqfh9aelDFlIayD2YMeFZqWLi9hHV+c+pq2Djkw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/luxon": "~3.6.0",
|
||||
"luxon": "~3.6.0"
|
||||
"@types/luxon": "~3.7.0",
|
||||
"luxon": "~3.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.x"
|
||||
}
|
||||
},
|
||||
"node_modules/csv-parse": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-5.6.0.tgz",
|
||||
"integrity": "sha512-l3nz3euub2QMg5ouu5U09Ew9Wf6/wQ8I++ch1loQ0ljmzhmfZYrH9fflS22i/PQEvsPvxCwxgz5q7UB8K1JO4Q==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-6.1.0.tgz",
|
||||
"integrity": "sha512-CEE+jwpgLn+MmtCpVcPtiCZpVtB6Z2OKPTr34pycYYoL7sxdOkXDdQ4lRiw6ioC0q6BLqhc6cKweCVvral8yhw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/csv-stringify": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-6.5.2.tgz",
|
||||
"integrity": "sha512-RFPahj0sXcmUyjrObAK+DOWtMvMIFV328n4qZJhgX3x2RqkQgOTU2mCUmiFR0CzM6AzChlRSUErjiJeEt8BaQA==",
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-6.6.0.tgz",
|
||||
"integrity": "sha512-YW32lKOmIBgbxtu3g5SaiqWNwa/9ISQt2EcgOq0+RAIFufFp9is6tqNnKahqE5kuKvrnYAzs28r+s6pXJR8Vcw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/debug": {
|
||||
@@ -240,9 +240,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
||||
"version": "1.15.11",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
|
||||
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
@@ -260,9 +260,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz",
|
||||
"integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==",
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
|
||||
"integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
@@ -407,9 +407,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/luxon": {
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
|
||||
"integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==",
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.1.tgz",
|
||||
"integrity": "sha512-RkRWjA926cTvz5rAb1BqyWkKbbjzCGchDUIKMCUvNi17j6f6j8uHGDV82Aqcqtzd+icoYpELmG3ksgGiFNNcNg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
@@ -498,9 +498,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ufw-log-parser": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ufw-log-parser/-/ufw-log-parser-0.1.0.tgz",
|
||||
"integrity": "sha512-0hPoehTmx7bHWSGfl2ieFs4YeNRGRv1xdfFTToZeHWSNz+hUwQ0aK2h0VqeEaVMcxKGkj2DFIY8L5NqnpBwcWg==",
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ufw-log-parser/-/ufw-log-parser-0.1.1.tgz",
|
||||
"integrity": "sha512-q8VUZJIDcIKnVPiKR3B/pEyYakzEaNZ6otxFcZAULa6pwAnfVm017CG/3nyvsNl968jTXesFdRcGBdgszbsoiQ==",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ufw-abuseipdb-reporter",
|
||||
"version": "0.4.2",
|
||||
"version": "0.4.3",
|
||||
"homepage": "https://github.com/sefinek/UFW-AbuseIPDB-Reporter#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/sefinek/UFW-AbuseIPDB-Reporter/issues"
|
||||
@@ -20,20 +20,20 @@
|
||||
"update": "git pull --recurse-submodules && npm install --omit=dev && pm2 restart ufw-abuseipdb"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.10.0",
|
||||
"axios": "^1.11.0",
|
||||
"axios-retry": "^4.5.0",
|
||||
"chokidar": "^4.0.3",
|
||||
"cron": "^4.3.1",
|
||||
"csv-parse": "^5.6.0",
|
||||
"csv-stringify": "^6.5.2",
|
||||
"form-data": "^4.0.3",
|
||||
"cron": "^4.3.3",
|
||||
"csv-parse": "^6.1.0",
|
||||
"csv-stringify": "^6.6.0",
|
||||
"form-data": "^4.0.4",
|
||||
"ipaddr.js": "^2.2.0",
|
||||
"semver": "^7.7.2",
|
||||
"simple-git": "^3.28.0",
|
||||
"ufw-log-parser": "^0.1.0"
|
||||
"ufw-log-parser": "^0.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.30.1",
|
||||
"@eslint/js": "^9.33.0",
|
||||
"globals": "^16.3.0"
|
||||
}
|
||||
}
|
||||
+1
-1
Submodule scripts updated: 0798ecbe34...5e27c53446.
Reference in new issue
Block a user