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
@@ -13,6 +13,7 @@ exports.MAIN = {
|
||||
/* --------------------------- Reports --------------------------- */
|
||||
ABUSEIPDB_API_KEY: '', // https://www.abuseipdb.com/account/api
|
||||
IP_REPORT_COOLDOWN: 12 * 60 * 60 * 1000, // Minimum time between reports of the same IP. Must be >= 15 minutes. Do not set too low values, as it would waste API quota due to daily rate limits.
|
||||
IGNORED_PORTS: [], // Destination ports to never report. Useful when running a BitTorrent client on the same machine, as peers connecting to that port would otherwise be falsely reported as port scanners. Example: [12345, 51413]
|
||||
|
||||
/* --------------------------- Automatic Updates --------------------------- */
|
||||
AUTO_UPDATE_ENABLED: false, // Set to true to enable automatic updates via "git pull", false to disable. This option is discouraged due to potential future incompatibilities. Enable it only if you actively monitor the server and want the latest version.
|
||||
|
||||
@@ -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