How to disable google cloud storage bucket list from acl control?

前端 未结 4 487
误落风尘
误落风尘 2021-01-05 04:34

We\'re using google cloud storage as our CDN.

However, any visitors can list all files by typing: http://ourcdn.storage.googleapis.com/

How to disable it whi

4条回答
  •  有刺的猬
    2021-01-05 04:48

    Your command set the default object ACL on the bucket to READ, which means that objects will be accessible by anyone. To prevent users from listing the objects, you need to make sure users don't have an ACL on the bucket itself.

    gsutil acl ch -d AllUsers gs://yourbucket

    should accomplish this. You may need to run a similar command for AllAuthenticatedUsers; just take a look at the bucket ACL with

    gsutil acl get gs://yourbucket

    and it should be clear.

提交回复
热议问题