1 Answer
- Newest
- Most votes
- Most comments
0
Although you can't limit what is returned in the bucket listing, you can make a condition that the caller specifies a key prefix in the list call which limits the results to just their 'folder'
http://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html#condition-key-bucket-ops-2
Example policy with condition that requires them to provide a key prefix when listing:
{
"Id": "bucket123456",
"Statement": [{
"Sid": "1",
"Action": [ "s3:ListBucket" ],
"Effect": "Allow",
"Resource": "arn:aws:s3:::ingest-bucket",
"Principal": { "AWS": "arn:aws:iam::XXXXXXXXXXXX:user/src–iam-user" },
"Condition" : { "StringEquals" : { "s3:prefix": "customer2" } }
}, {
"Sid": "2",
"Action": ["s3:GetObject"],
"Effect": "Allow",
"Resource": "arn:aws:s3::: ingest-bucket/customer2/*",
"Principal": { "AWS": "arn:aws:iam::XXXXXXXXXXXX:user/src–iam-user" }
}]
}
Relevant content
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago