A Node.js project that enables automatic reporting of incidents detected by Cloudflare WAF to the AbuseIPDB database.
MIT License
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 sefinek24/Cloudflare-WAF-Expressions. Also, take a look at sefinek24/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!
If you want to make changes to the script from this repository, please kindly fork it first.
Triggered Cloudflare WAF (securitylevel).
Action taken: MANAGED_CHALLENGE
ASN: 1101 (IP-EEND-AS IP-EEND BV) [T1]
Protocol: HTTP/1.0 (method GET)
Domain: blocklist.sefinek.net
Endpoint: /
Timestamp: 2024-09-18T17:55:39Z
Ray ID: 8c53354d5c885c4d
Rule ID: badscore
UA: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Safari/537.36
Report generated by Node-Cloudflare-WAF-AbuseIPDB https://github.com/sefinek24/Node-Cloudflare-WAF-AbuseIPDB
git clone https://github.com/sefinek24/Node-Cloudflare-WAF-AbuseIPDB.git
npm install
.env.default
file with the same content, then rename it to .env
. Fill it with your tokens, etc. Remember to set NODE_ENV
to production
!node .
npm install pm2 -g
ecosystem.config.js
file to be correct and existing. You don't need to create .log
files, just ensure the directory structure is accurate.PM2
to ensure constant operation and automatic restart in case of a failure.
pm2 start
Node.js
processes.
pm2 save
PM2
to startup.
pm2 startup
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u sefinek --hp /home/sefinek
pm2 logs
command.CLOUDFLARE_ZONE_ID
CLOUDFLARE_API_KEY
Create Token
button.Create Custom Token
.ABUSEIPDB_API_KEY
Visit www.abuseipdb.com/account/api.
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!
This project is inspired by the MHG-LAB/Cloudflare-WAF-to-AbuseIPDB repository. I'm not particularly fond of Python and usually try to avoid using this programming language, which is why I decided to create this repository.
Copyright 2024 © by Sefinek. All Rights Reserved.