-
-
Save actionjack/d900c6587297f24d83b14c2b7a85200f to your computer and use it in GitHub Desktop.
AWS Bucket Policy to deny access to all except NotPrincipal list
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", | |
"Id": "Policy9999999990001", | |
"Statement": [ | |
{ | |
"Sid": "Deny access except NotPrincipal list", | |
"Effect": "Deny", | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::123000004567:role/xxxx-eb-ec2-role", | |
"arn:aws:iam::123000004567:user/Marianoruiz", | |
"arn:aws:iam::123000004567:user/pepe2222" | |
] | |
}, | |
"Action": "s3:*", | |
"Resource": "arn:aws:s3:::bucket-name" | |
} | |
] | |
} |
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":"AllowPublicUpload", | |
"Effect":"Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action":["s3:PutObject","s3:PutObjectAcl"], | |
"Resource":["arn:aws:s3:::bucket-name/*"] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment