Skip to content

Instantly share code, notes, and snippets.

@gvasquez95
Created April 26, 2020 19:28
Show Gist options
  • Save gvasquez95/a8e743e741f9322eec437d7b3ac665c6 to your computer and use it in GitHub Desktop.
Save gvasquez95/a8e743e741f9322eec437d7b3ac665c6 to your computer and use it in GitHub Desktop.
Sample S3 Bucket policy to restrict IP addresses
{
"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