Skip to content

Commit

Permalink
Create restrict-access-to-owner.json
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-veeramalla authored Jul 6, 2023
1 parent 259add2 commit 35804e0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions day-9/demos/bucket-policies/restrict-access-to-owner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Version": "2012-10-17",
"Id": "RestrictBucketToIAMUsersOnly",
"Statement": [
{
"Sid": "AllowOwnerOnlyAccess",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::your-bucket-name/*",
"arn:aws:s3:::your-bucket-name"
],
"Condition": {
"StringNotEquals": {
"aws:PrincipalArn": "arn:aws:iam::AWS_ACCOUNT_ID:root"
}
}
}
]
}

0 comments on commit 35804e0

Please sign in to comment.