Last active
July 28, 2022 13:54
-
-
Save HitLuca/ddceb8634a8bebb6475f03f79d6842f9 to your computer and use it in GitHub Desktop.
Outputs a series of ufw rules that enable external access from legitimate Cloudflare ips to port 443
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd /tmp | |
wget https://www.cloudflare.com/ips-v4 -O ips-v4-$$.tmp | |
wget https://www.cloudflare.com/ips-v6 -O ips-v6-$$.tmp | |
for cfip in `cat ips-v4-$$.tmp`; do echo "sudo ufw allow from $cfip to any port 443 proto tcp comment 'Cloudflare ipv4'"; done | |
for cfip in `cat ips-v6-$$.tmp`; do echo "sudo ufw allow from $cfip to any port 443 proto tcp comment 'Cloudflare ipv6'"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment