S3store robot with custom Aws S3 policies (no list access)

Archived from the Transloadit support forum. Originally posted on September 8, 2011; details may be outdated, see our docs for current behavior. Original thread

Related to S3store robot and Amazon S3 policies without list access.

I like to keep policies quite strictly. So I tried to have write only policy for transloadit keys in the IAM (at the end). The policy wont allow listing of files, only write and read. Policy works for uploading from different tools. If I ad in action section “s3:List*” transloadit works ok.

I guess that Transloadit doesn’t work without rights for listing the files? Is it so?

Is there a possibility to use transloadit with limited access policy. Do I have to fix the policy with some specifics? Do you need the listings for some reason? Or was this just issue with testing template inside transloadit user pages?

The bucket has also some other files so I want to keep sharing as minimal as possible.

Policy in Amazon IAM for keys that transloadit template uses:

{ "Statement": [
{ "Effect": "Allow",  "Action": [  "s3:Put*",  "s3:Get*" ],
  "Resource": "arn:aws:s3:::my.bucket.com*"
}  ] }

I guess that Transloadit doesn’t work without rights for listing the files? Is it so?

We need the list permission because S3 PUT is broken by design. If we do not verify the success of a storage operation (and retry if there was a problem), we are seeing about 1-2% data loss.

See this post for more details: http://transloadit.com/blog/2011/05/fixing-amazon-s3

We could make our verification optional, but that would mean that you’d be responsible for verifying the success of a storage step - we could no longer do it for you.

Thanks for the quick answer. That sounds reasonable. Optional verification doesn’t seem a good idea (at least without really understanding everything behind it).

Have to figure out whats the strictest policy I can get away with. Probably I’ll limit the resources within some path etc.

Out of curiosity: What do you do with the listing of the bucket? How do you check something with that? Couldn’t you do the same checks by getting head info on the files you uploaded? With that approach policy could allow [ “s3:Put_”, “s3:Get_”] without allowing listings. Or does amazon then reply with errors instead of reasonable information?

Out of curiosity: What do you do with the listing of the bucket? How do you check something with that? Couldn’t you do the same checks by getting head info on the files you uploaded? With that approach policy could allow [ “s3:Put”, “s3:Get”] without allowing listings. Or does amazon then reply with errors instead of reasonable information?

We use list against the exact path of the upload because it works to verify uploads to private and public files alike. We could do a HEAD request for public files, but that would make things a bit complicated on our end, so we are not doing it at this point.

I hope that’s ok for now, but it’s certainly something we’ll look into improving in the future.

It’s ok. Nice to know. It Just requires some extra work at our end.

And in case someone else is wondering/googling how to make s3 policies for transloadit. Here is a sample for restricting access to specific files/folder:

{"Statement": [{ "Effect": "Allow",
  "Action": [ "s3:Put*", "s3:Get*" ],
  "Resource": "arn:aws:s3:::<bucket_here>/<directory_here>/*"  }]}
{"Statement": [{ "Effect": "Allow",
  "Action": "s3:ListBucket",
  "Condition": { "StringLike": { "s3:prefix": "<directory_here>/*"} },
  "Resource": "arn:aws:s3:::<bucket_here>"}]}

Thanks for referencing your settings!

Closing this as it is resolved.