Records now works without running a scan first. If logs aren't cached in memory from a scan, the endpoint greps the nginx access logs directly for [Client IP] matches and returns the last 500 lines.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
\s* in the regex matches \n, so when ignoreip = is empty:
^ignoreip\s*=\s*(.+)$ → consumes the newline, captures [badbot] from
the next section header as if it were an IP address.
Fix: use [ \t]* instead of \s* so the regex never crosses a line boundary.
Also tighten the addWhitelist line-finder to use the same pattern.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously isWhitelisted() checked SUBNETS_TO_IGNORE env var in addition
to jail.local ignoreip. This meant removing a subnet from the dashboard
whitelist updated fail2ban but the dashboard scan still excluded those IPs,
creating a visible disconnect.
Now isWhitelisted() reads and does CIDR matching only against jail.local.
Dashboard whitelist changes are immediately reflected in scan/records,
1:1 with what fail2ban enforces.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ip had a high severity SSRF vuln (GHSA-2p57-rm9w-gvfp) with no upstream fix.
Replace with:
- net.isIPv4/isIPv6 (Node built-in) for format validation
- ipaddr.js for CIDR subnet matching
Add package-lock.json for reproducible builds (required for npm ci).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove WEBHOOK_URL from server.js and compose (too many untestable edge cases)
- Delete .env.example (config is now inline in docker-compose.yml)
- Comment out ABUSEIPDB_API_KEY, CF_EMAIL, CF_APIKEY in compose by default
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace iptables-allports with docker-npm action (DOCKER-USER + xt_string
X-Forwarded-For matching + INPUT chain) matching user's working setup
- Add telegram_notif.sh (deployed to /data/action.d/ at first run, user-editable)
- Add cloudflare.conf action; jail.cloudflare.local enabled via CF compose file
- Two compose files: docker-compose.yml (standard) and docker-compose.cloudflare.yml
- entrypoint: modprobe xt_string, DOCKER-USER chain check, CF jail auto-selection,
telegram_notif.sh deployment to persistent volume on first run
- Fix whitelist live-update: addignoreip/delignoreip called alongside jail.local write
- Hardcode AUTOBAN_THR=75 and DEFAULT_DAYS=3 (remove env vars)
- Include Nginx Proxy Manager in both compose files with shared log bind mount
- Rewrite filters for actual NPM log format ([Client <HOST>] real IP extraction)
- Add DATA_DIR, Telegram, CF API key fields to .env.example
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dockerized Fail2Ban + dashboard for Nginx Proxy Manager.
- Single-container image (fail2ban + Node.js + supervisord)
- Pre-built NPM filters: badbot, http-errors, npm-probe, manual-bans
- Web dashboard with live ban feed, log scanner, AbuseIPDB integration
- Configurable via environment variables and .env file
- Persistent volumes for config and ban history
- Webhook support for ban event notifications
- README, .gitignore, MIT license
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>