What is NixStats?
I’m currently trying the NixStats (affiliate link) monitoring tool for servers and websites – mainly because it’s cheap (starts at $0/month for 5 monitors and 1 server, $9.95/month for 10 servers and 25 web monitors) and partially because it’s owned by WebPros. Not heard of WebPros? Me neither until I went digging and found out that not only do they now own NixStats but also cPanel Inc and Plesk (both “rivals” in the web hosting control panel world) – along with a few others(!)
The Problem – Cloudflare’s security being triggered
Anyway – one of the sites I am monitoring using Nixstats is under the Cloudflare system – and because of the frequent monitoring, it may “trip up” Cloudflare’s security features so I needed to “allow list” (aka “white list”) the IP addresses used by NixStats. Luckily, they do provide a list at https://nixstats.com/whitelist.php and https://nixstats.com/whitelist.php?v6 (I’ve got no idea how often these are updated though) – but you can’t simply import these into Cloudflare due to two issues:
- One of the IP addresses (in the first list) has a trailing tab character which Cloudflare just rejects as being an invalid IP address. Took me a while to find that!
- The IPv6 addresses are not in a format that Cloudflare accepts – they only accept CIDR’d IPv6 address on a /64 or smaller (and if you are not that techy, you are forgiven for not understanding that!).
So I’ve put together a downloadable CSV file listing all those IP addresses in the “correct format” for you to easily import into Cloudflare’s lists (Cloudflare don’t have an export option 🙁 ).
You can download the file from here but I give no guarantee of accuracy etc etc.
But where in Cloudflare do I use the file?
It’s a two stage operation – first you’ve got to create the list and then you’ve got to setup the firewall rules.
Creating the IP Address List in Cloudflare
- Log into your Cloudflare account and get onto the main account screen (i.e. where it lists your individual sites)
- On the left hand menu near the bottom, there is an option labelled “Manage Account” – expand that.
- Under “Manage Account”, select “Configurations”
- On the “Configurations” screen, select “Lists”
- Select “Create new list” (free Cloudflare accounts can only create a single list by the way)
- Create the list with a name such as “nixstats” and a “Content type” of “IP Addresses”
- Edit the list and select “Add items”
- Select “Upload CSV” and upload the CSV of IP addresses ,
- Click “Add to list” and it should load them into the list.
Setting Cloudflare to use the list
- Log into Cloudflare (or, if you are already logged in, click the Cloudflare logo in the top left to return to home)
- Select the account of the domain name you are monitoring
- In the left hand menu, expand “Security”
- Under “Security”, select “WAF” (Web Application Firewall)
- Under “Firewall rules” (free accounts get 5 active firewall rules), select “Create firewall rule”
- Set a “Rule name” of something like “nixstats”
- Under the “When incoming requests match…” heading use the following settings
- Field: “IP Source Address”
- Operator: “is in list”
- Value: “nixstats” (i.e. the list you created above)
- Under “Then…” select “Allow”
- Click “Deploy firewall rule” and it should take affect.
You’ll need to do this for each account you are monitoring using nixstats.