Skip to content

Instantly share code, notes, and snippets.

@mrsarm
Created December 26, 2016 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mrsarm/03598566c048f505c9fd1d7fdc21fbc6 to your computer and use it in GitHub Desktop.
Save mrsarm/03598566c048f505c9fd1d7fdc21fbc6 to your computer and use it in GitHub Desktop.
AWS Bucket Policy to deny access to all except NotPrincipal list
{
"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"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment