Last active
March 19, 2019 00:02
-
-
Save mikegrima/d1361737acfb2cb929b1a70ff15d97fb to your computer and use it in GitHub Desktop.
S3 only permit specific bucket object access
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
| Documented here: https://aws.amazon.com/blogs/security/how-to-restrict-amazon-s3-bucket-access-to-a-specific-iam-role/ | |
| Yes, it's really shitty. | |
| Example Policy to ONLY allow specific IAM Roles access to the objects (denies all the other roles access to the objects): | |
| { | |
| "Version": "2008-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Deny", | |
| "Principal": "*", | |
| "Action": [ | |
| "s3:ListBucket", | |
| "s3:GetObject*", | |
| "s3:PutObject*", | |
| "s3:DeleteObject*" | |
| ], | |
| "Resource": [ | |
| "arn:aws:s3:::SOMEBUCKET", | |
| "arn:aws:s3:::SOMEBUCKET/*" | |
| ], | |
| "Condition": { | |
| "StringNotLike": { | |
| "aws:userId": "AROAEXAMPLE:*" | |
| } | |
| } | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment