0

We are using minio server on mac. We generate a presigned put url using node npm package and upload from a browser using a simple fetch call.

We want to keep the bucket private but inside objects (files) should be publicly available, How can we achieve this.

Right now we have kept the bucket public but with this it lists all the objects in the bucket which is not needed.

j10
  • 2,009
  • 3
  • 27
  • 44

1 Answers1

1

In s3 objects inherit parents permissions unless specified otherwise.

After uploading an object to bucket.

You can set permissions by using bucket policy and ACL, and example for listing several files public under a private bucket examplebucket. Buy it can be hard and inefficient to maintain lists of public items in a private bucket. You can always reverse the bucket policy and design policies that make files private.

{
   "Version" : "2012-10-17",
   "Statement" : [
      {
         "Effect" : "Allow",
         "Action" : [ "s3:GetObject" ],
         "Resource" : [
             "arn:aws:s3:::examplebucket/design_info.doc",
             "arn:aws:s3:::examplebucket/design_info_2.doc"
         ]
      } 
   ]
}

https://docs.min.io/docs/javascript-client-api-reference.html#setBucketPolicy

Rofgar
  • 318
  • 3
  • 12