This looks to be a better resource and may inspire me to 'play' a little:
www.microsoft.com
It's updated weekly and is presented as a json file (yuk!). I have a downloaded script that parses other json lists, for different services (Hetzner, AWS etc.) based on ASN (IIRC). It might be adaptable..
[Much later and multi-edits]
This appears to work, after much routing around and piecing together various snippets.
Step 1. Edit /etc/csf/csf.blocklists and add to the bottom, changing the FQDN hostname):
AZUREIP|86400|0|http://your.whmserver.tld/azure-ip.txt
Step 2. Create, for example, /root/azure-ip.sh with the following:
Code:
#!/bin/bash
# Produce http (txt) lists for other servers
dir=/usr/local/apache/htdocs
# Comment out existing IPs to allow new list retrieval (just to be sure its not blocked)
sed -i 's/AZUREIP/#AZUREIP/g' /etc/csf/csf.blocklists
/usr/sbin/csf -r
mv $dir/ip-ranges.json $dir/ip-ranges.json.old
# Find the updated list
newlist=`curl -sS https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519 | egrep -o 'https://download.*?\.json' | grep -v meta | uniq`
# Grab the list
wget -O $dir/ip-ranges.json $newlist
# Strip off the crud, to leave CIDR IPs
grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}/[0-9]{1,2}" $dir/ip-ranges.json > $dir/azure-ip.txt
# Reactivate IP ranges, as a group in the blocklists
sed -i 's/#AZUREIP/AZUREIP/g' /etc/csf/csf.blocklists
# Activate the new list
/usr/sbin/csf -r
Step 3. Finally, run "crontab -e" and add a weekly task, for example:
28 1 * * 1 /root/azure-ip.sh > /dev/null 2>&1
You can also access this generated list from other WHM servers by adding the same entry to /etc/csf/csf.blocklists
Hope that's useful.