amazon web services - S3 TVM Issue – getting access denied -


i'm trying let ios app upload s3 using credentials gets modified anonymous token vending machine.

the policy statement token vending machine returns is:

{"statement":     [         {"effect":"allow",          "action":"s3:*",          "resource":"arn:aws:s3:::my-bucket-test",          "condition": {             "stringlike": {                 "s3:prefix": "66-*"             }          }         },         {"effect":"deny","action":"sdb:*","resource":["arn:aws:sdb:us-east-1:myaccountidhere:domain/__users_domain__","arn:aws:sdb:us-east-1:myaccountidhere:domain/tokenvendingmachine_devices"]},         {"effect":"deny","action":"iam:*","resource":"*"}     ] } 

the object i'm trying put has same bucket name , key 66-3315f11e-84fa-417f-9c32-ac4be364ad99.natural.mp4.

as far understand should work fine, doesn't, , throws access denied message. there wrong policy statement?

you don't need use prefix refer resource context of object operations. i'd recommend restricting s3 actions. here recommend policy, based on 1 article on s3 personal file store. feel free remove listbucket if doesn't make sense app.

{"statement":     [         {"effect":"allow",          "action":["s3:putobject","s3:getobject","s3:deleteobject"],          "resource":"arn:aws:s3:::my-bucket-test/66-*",         },         {"effect":"allow",          "action":"s3:listbucket",          "resource":"arn:aws:s3:::my-bucket-test",          "condition":{               "stringlike":{                    "s3:prefix":"66-*"               }          }         },           {"effect":"deny","action":"sdb:*","resource":["arn:aws:sdb:us-east-1:myaccountidhere:domain/__users_domain__","arn:aws:sdb:us-east-1:myaccountidhere:domain/tokenvendingmachine_devices"]},         {"effect":"deny","action":"iam:*","resource":"*"}     ]  }  

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -