amazon web services - AWS s3:ListBucket action results in access denied using conditional StringLike statement on s3:prefix -


i have items in "folder" in s3 bucket. "path" file contains identity id of user uploaded file , appears in s3 managment console "all buckets/[my_bucket]/us-east-1:080ffd35-c00e-4e33-877f-3ec57be4b128" have iam policy attached cognito authenticated users includes following conditional statement:

"condition": {             "stringlike": {                 "s3:prefix": [                     "us-east-1:080ffd35-c00e-4e33-877f-3ec57be4b128/*"                 ]             }         } 

i've hard-coded in identity id troubleshooting step since wasn't sure if "${cognito-identity.amazonaws.com:sub}" contained correct string. specific identity id encoded, still not work , receive access denied error when trying list contents of bucket. correct in thinking stringlike looks given string inside prefix? there else i'm missing?

i've included full iam policy below:

{ "version": "2012-10-17", "statement": [     {         "effect": "allow",         "action": [             "s3:listbucket"         ],         "resource": [             "arn:aws:s3:::[my_bucket]"         ],         "condition": {             "stringlike": {                 "s3:prefix": [                     "us-east-1:080ffd35-c00e-4e33-877f-3ec57be4b128/*"                 ]             }         }     },     {         "effect": "allow",         "action": [             "s3:getobject",             "s3:putobject",             "s3:putobjectacl",             "s3:getobjectacl"         ],         "resource": [             "arn:aws:s3:::[my_bucket]/${cognito-identity.amazonaws.com:sub}*",             "arn:aws:s3:::[my_bucket]/${cognito-identity.amazonaws.com:sub}/*"         ]     } ] 

}

does s3 bucket require specific permissions settings on s3 management console make work , prevent access denied error when trying list contents of bucket?

additional edit:

  1. a couple of questions wasn't able figure out document. there requirement bucket have policy? don't see in documentation's examples specify bucket needs policy itself.
  2. does bucket's permissions matter? once again, didn't see specified in iam policy documentation.

list bucket can't narrowed specific prefix that. list- bucket operation done on bucket condition , resource must valid bucket. i.e. prefix condition doesn't match valid on objects in bucket not bucket itself.

in same way can't limit list buckets list buckets because action done on service.

this poorly described in docs: http://docs.aws.amazon.com/amazons3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-buckets


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -