New CloudFront IPs

This commit is contained in:
2025-04-05 14:36:05 +02:00
parent 3e7e4dd1b5
commit 108b830c5c
2 changed files with 52 additions and 5 deletions

View File

@ -1,10 +1,14 @@
#!/bin/sh
PROJECT_ROOT="$(realpath $(dirname $0)/../)"
echo "Running in: $PROJECT_ROOT"
set -eu
# See: https://stackoverflow.com/a/69768584/5155484
curl -f -s -# https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service == "CLOUDFRONT") | .ip_prefix' | sort -V > cloudfront-ips.txt
curl -f -s -# https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.ipv6_prefixes[] | select(.service == "CLOUDFRONT") | .ipv6_prefix' | sort -V >> cloudfront-ips.txt
curl -f -s -# https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service == "CLOUDFRONT") | .ip_prefix' | sort -V > "$PROJECT_ROOT/data/collections/amazon/cloudfront-ips.txt"
curl -f -s -# https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.ipv6_prefixes[] | select(.service == "CLOUDFRONT") | .ipv6_prefix' | sort -V >> "$PROJECT_ROOT/data/collections/amazon/cloudfront-ips.txt"
# Does not seem up to date: 06-2023
#curl https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips | jq -r '.CLOUDFRONT_GLOBAL_IP_LIST | join("\n")' | sort > cloudfront-ips.txt
#curl https://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips | jq -r '.CLOUDFRONT_GLOBAL_IP_LIST | join("\n")' | sort > "$PROJECT_ROOT/data/collections/amazon/cloudfront-ips.txt"