Created
March 31, 2014 01:20
-
-
Save abevoelker/9883319 to your computer and use it in GitHub Desktop.
S3 bucket policy to whitelist access to CloudFlare (IPv6 addresses don't seem to be supported in bucket policies)
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
{ | |
"Id": "Policy1234", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1234", | |
"Action": [ | |
"s3:GetObject" | |
], | |
"Effect": "Allow", | |
"Resource": "arn:aws:s3:::foo/*", | |
"Condition": { | |
"IpAddress": { | |
"aws:SourceIp": [ | |
"199.27.128.0/21", | |
"173.245.48.0/20", | |
"103.21.244.0/22", | |
"103.22.200.0/22", | |
"103.31.4.0/22", | |
"141.101.64.0/18", | |
"108.162.192.0/18", | |
"190.93.240.0/20", | |
"188.114.96.0/20", | |
"197.234.240.0/22", | |
"198.41.128.0/17", | |
"162.158.0.0/15", | |
"104.16.0.0/12" | |
] | |
} | |
}, | |
"Principal": { | |
"AWS": [ | |
"*" | |
] | |
} | |
} | |
] | |
} |
I updated the IPv4 range of CloudFlare here https://gist.github.com/ZE3kr/0f26ae62f1590338a3f1f0127289f7d6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created an AWS forum thread noting that IPv6 addresses are broken: https://forums.aws.amazon.com/thread.jspa?threadID=149144