Skip to content

Instantly share code, notes, and snippets.

@brock
Last active December 18, 2015 04:39
Show Gist options
  • Save brock/5727323 to your computer and use it in GitHub Desktop.
Save brock/5727323 to your computer and use it in GitHub Desktop.
Simple AWS IAM Group policy to limit a client to read-only access to a single bucket. They'll be able to see the names of all other buckets, but won't be able to get into them. They will be able to see all folders and files in the bucket.
{
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket", "s3:ListAllMyBuckets" ],
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Deny",
"Action": ["s3:ListBucket"],
"NotResource":["arn:aws:s3:::bucketname", "arn:aws:s3:::bucketname/*"]
},
{
"Effect": "Allow",
"Action": ["s3:ListBucket","s3:GetObject"],
"Resource": ["arn:aws:s3:::bucketname", "arn:aws:s3:::bucketname/*"],
"Condition": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment