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

前端 未结 4 489
误落风尘
误落风尘 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 05:01

    In GCP dashboard:

    1. get in your bucket
    2. click "Permissions" tab and get in.
    3. in member list find "allUsers", change role from Storage Object Viewer to Storage Legacy Object Reader

    then, listing should be disabled.

    Update:

    as @Devy comment, just check the note below here

    Note: roles/storage.objectViewer includes permission to list the objects in the bucket. If you don't want to grant listing publicly, use roles/storage.legacyObjectReader.

提交回复
热议问题