Created
April 26, 2020 19:28
-
-
Save gvasquez95/a8e743e741f9322eec437d7b3ac665c6 to your computer and use it in GitHub Desktop.
Sample S3 Bucket policy to restrict IP addresses
This file contains hidden or 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", | |
"Statement": [ | |
{ | |
"Sid": "AddPermStaticsAXK", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::<my-bucket-fqdn>/*", | |
"Condition": { | |
"NotIpAddress": { | |
"aws:SourceIp": [ | |
"w.x.y.z/32", | |
"a.b.c.d/32" | |
] | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment