Created
October 25, 2017 00:35
-
-
Save jayankandathil/26e9ecc71fce267ff71e005569c6dfa3 to your computer and use it in GitHub Desktop.
Creates an Amazon S3 bucket policy that white-lists a list of IP addresses in the CIDR format
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
{ | |
"Version": "2012-10-17", | |
"Id": "customerpoc", | |
"Statement": [ | |
{ | |
"Sid": "IPDeny", | |
"Effect": "Deny", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:*", | |
"Resource": "arn:aws:s3:::bucketname", | |
"Condition": { | |
"NotIpAddress": { | |
"aws:SourceIp": [ | |
"10.20.30.40/32", | |
"11.22.33.44/32" | |
] | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment