Created
July 4, 2016 10:52
-
-
Save pahud/224d2ff8139252a372a4c1282b90db73 to your computer and use it in GitHub Desktop.
generate AWS CloudFront IP/CIDR range
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
#!/usr/bin/env python | |
import requests, json | |
d = requests.get('https://ip-ranges.amazonaws.com/ip-ranges.json').text | |
l = json.loads(d) | |
for ip_range in [x['ip_prefix'] for x in l['prefixes'] if x['service']=='CLOUDFRONT' ]: | |
print ip_range |
Author
pahud
commented
Jul 4, 2016
•
[HOWTO] Get real IP coming via AWS CloudFront and ELB to nginx — Medium - https://medium.com/@pahud/get-real-ip-coming-via-aws-cloudfront-and-elb-to-nginx-d418e5070976
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment