Cloudflare-WAF-To-AbuseIPDB/config.js

20 lines
No EOL
1 KiB
JavaScript

// Main interval of each cycle.
// In production mode, it's 3 hours, and in development mode, it's 8 seconds.
const CYCLE_INTERVAL = process.env.NODE_ENV === 'production' ? 3 * 60 * 60 * 1000 : 8 * 1000;
// The minimum time that must pass after reporting an IP address before it can be reported again.
// The required time is >= 15 minutes, according to AbuseIPDB API limits.
const REPORTED_IP_COOLDOWN_MS = 7 * 60 * 60 * 1000; // 7h
// The maximum URI length that can be reported to AbuseIPDB.
// If Cloudflare returns a longer URI, the API request will fail.
const MAX_URL_LENGTH = 1000;
// Additional delay after each successful IP report to avoid overloading the AbuseIPDB API.
const SUCCESS_COOLDOWN_MS = 2 * 1000; // 2s
// Interval for refreshing your IP address.
// This ensures that WAF violations originating from your IP address are not reported to AbuseIPDB.
const IP_REFRESH_INTERVAL = 9 * 60 * 1000; // 9m
module.exports = { CYCLE_INTERVAL, REPORTED_IP_COOLDOWN_MS, MAX_URL_LENGTH, SUCCESS_COOLDOWN_MS, IP_REFRESH_INTERVAL };