Thanks again for your feedback.
- martin
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
$ export AWS_ACCESS_KEY_ID=AKIAU4ZTTZ7COMQD657S
$ export AWS_SECRET_ACCESS_KEY=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
$ aws s3 ls s3://winscp-bug
PRE allowed/
PRE forbidden/
$ aws s3 ls s3://winscp-bug/allowed/
PRE sub-allowed/
2021-08-24 09:04:24 0
$ aws s3 ls s3://winscp-bug/forbidden/
An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied
$ aws s3 ls s3://winscp-bug/allowed/sub-allowed/
2021-08-24 09:04:59 0
2021-08-24 09:06:12 46 allowed.txt
$ aws s3 cp s3://winscp-bug/allowed/sub-allowed/allowed.txt .
download: s3://winscp-bug/allowed/sub-allowed/allowed.txt to ./allowed.txt
$ cat allowed.txt
you are allowed to list and download this file
bucket
a
-foldera
-folderb
b
-foldera
-folderb
c
-foldera
-folderb
s3://bucket/a
and s3://bucket/b
including all subfolders. The folder c
is not allowed. Also the root folder can be listed.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::bucket"
],
"Condition": {
"StringEquals": {
"s3:prefix": [
"",
"foldera",
"foldera/",
"folderb",
"folderb/"
],
"s3:delimiter": [
"/"
]
}
}
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::bucket"
],
"Condition": {
"StringLike": {
"s3:prefix": [
"foldera*",
"folderb*"
]
}
}
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::bucket/foldera/*",
"arn:aws:s3:::bucket/folderb/*"
]
}
]
}
""
in "StringEquals": { "s3:prefix": [ ""
, which allows the the root folder to be listed.
/bucket
I get an Access Denied message. When I change the folder to /bucket/a
it works, but it is not possible to navigate to the root folder. Changing the current folder from /bucket/a
to /bucket/b
works but that's a bad user experience.