Add IGNORED_PORTS option to prevent false positives on user-defined ports (fixes #10)
This commit is contained in:
1 parent
f53495dc25
commit
edc7c30e77
2 files changed
+7
-1
No files matched your search
@@ -15,7 +15,7 @@ const { repoSlug, repoUrl } = require('./scripts/repo.js');
|
||||
const isSpecialPurposeIP = require('./scripts/isSpecialPurposeIP.js');
|
||||
const { initWhitelist, isWhitelisted } = require('./scripts/services/whitelist.js');
|
||||
const logger = require('./scripts/logger.js');
|
||||
const { UFW_LOG_FILE, 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, IGNORED_PORTS } = config.MAIN;
|
||||
|
||||
const RATE_LIMIT_LOG_INTERVAL = 10 * 60 * 1000;
|
||||
const BUFFER_STATS_INTERVAL = 5 * 60 * 1000;
|
||||
@@ -138,6 +138,11 @@ const processLogLine = async (line, test = false) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Array.isArray(IGNORED_PORTS) && IGNORED_PORTS.includes(Number(dpt))) {
|
||||
if (EXTENDED_LOGS) logger.info(`Skipping ignored port: PROTO=${proto?.toLowerCase()} SRC=${srcIp} DPT=${dpt} ID=${data.id}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (test) return data;
|
||||
|
||||
// Report
|
||||
|
||||
Reference in new issue
Block a user