Get Discord notifications when someone triggers a Cloudflare firewall event
 
Go to file
janderedev 2b488ca15a
fixed issue where it stopped working after 24 hours lol
2021-11-03 19:34:30 +01:00
assets move readme images into repository 2021-11-03 19:25:49 +01:00
.gitignore Init commit 2021-04-07 01:22:23 +02:00
README.md move readme images into repository 2021-11-03 19:25:49 +01:00
index.js fixed issue where it stopped working after 24 hours lol 2021-11-03 19:34:30 +01:00
package-lock.json Init commit 2021-04-07 01:22:23 +02:00
package.json Init commit 2021-04-07 01:22:23 +02:00

README.md

Cloudflare Firewall Discord Webhook

yes.

assets/1617749859-nicememe.8LjIKiH1ECHwQX7h3Ix.png

Setup

Step 1: Read source code because I'm too lazy to write proper instructions

Step 2: Get an API key

Go to https://dash.cloudflare.com/profile/api-tokens and create a new token, with the following permissions:

assets/1617750671-nicememe.L0cFCxLqyEDYNNZRw2f.png

Step 3: Set environment variables

Create a file called .env in the project root:

CF_TOKEN=The previously created token
WEBHOOK_ID=The ID of the Discord Webhook
WEBHOOK_SECRET=The Webhook's token
CF_ZONES_BLACKLIST=(Optional) Comma-seperated list of domains (Zone IDs!) that should not be monitored.

Note that I have no idea if CF_ZONES_BLACKLIST even works simply because I'm too lazy to test it.

Step 4: Run it

npm install and node . yada yada ya