This project offers an automated script that collects and reports IP addresses that have triggered Cloudflare firewall events. In simple terms, it enables the reporting of incidents detected by Cloudflare WAF to the AbuseIPDB database.
If you're looking for effective WAF Expressions, you're in the right place! Check out sefinek/Cloudflare-WAF-Expressions. Also, take a look at sefinek/UFW-AbuseIPDB-Reporter for UFW.
If you like this repository or find it useful, I would greatly appreciate it if you could give it a β star. Thanks a lot!
- Node.js + npm
- PM2 (
npm i -g pm2
) - Git
- Easy Configuration - The
config.js
file allows for quick and simple configuration. - Simple Installer - Enables fast and seamless deployment and integration.
- Bulk Reporting Support - If the script hits a rate limit, it will immediately start buffering IP addresses and send a bulk report once the limit is lifted.
- Self-IP Protection (IPv4 & IPv6) - Automatically excludes the server's own public and local IPs from reports, including dynamic addresses.
- Discord Webhooks Integration:
- Critical notifications
- Script error alerts
Daily summaries of reported IPs
- Automatic Updates - The script regularly fetches and applies the latest updates. You can disable this if you prefer.
If you want to make changes to the script from this repository, please kindly fork it first.
Triggered Cloudflare WAF (securitylevel) from T1.
Action taken: MANAGED_CHALLENGE
ASN: 53667 (PONYNET)
Protocol: HTTP/1.0 (GET method)
Endpoint: /
Timestamp: 2024-11-09T19:20:18Z
Rule ID: badscore
UA: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5042.0 Safari/537.36
This report was generated by:
https://github.com/sefinek/Cloudflare-WAF-To-AbuseIPDB
- Clone the repository.
git clone --recurse-submodules https://github.com/sefinek/Cloudflare-WAF-To-AbuseIPDB.git
- Install dependencies.
cd Cloudflare-WAF-To-AbuseIPDB && npm install
- Create a new configuration file.
cp config.default.js config.js
- Paste the tokens into the
config.js
file.nano config.js
- Run the script.
node .
- If you want to run the process 24/7, install the PM2 module.
npm install -g pm2
- Modify the log paths in the
ecosystem.config.js
file to be correct and existing. You don't need to create.log
files, just ensure the directory structure is accurate. - Run the process continuously using
PM2
to ensure constant operation and automatic restart in case of a failure.pm2 start
- Save a snapshot of the currently running
Node.js
processes.pm2 save
- Add
PM2
to startup.
eval "$(pm2 startup | grep sudo)"
- That's it! Monitor logs using the
pm2 logs
command.
- Accepts a string or an array of Zone IDs:
CLOUDFLARE_ZONE_IDS: 'zone-id-1'
- If you manage multiple zones, pass them as an array:
CLOUDFLARE_ZONE_IDS: ['zone-id-1', 'zone-id-2']
- Screenshot for reference:
- Go to dash.cloudflare.com/profile/api-tokens.
- Click Create Token.
- Select Create Custom Token.
- Refer to the screenshot for required permissions:
Visit www.abuseipdb.com/account/api and copy your API key.
If you need help or have any questions, feel free to create a new Issue. If you'd like to contribute to the project, go ahead and open a Pull request. Thank you!
π GPL-3.0 License
Copyright 2024-2025 Β© by Sefinek. All Rights Reserved.