Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 while all the files under the bucket is still public readable by default?

We previously set the acl using

gsutil defacl ch -g AllUsers:READ 
like image 802
Tom Fishman Avatar asked Oct 01 '13 19:10

Tom Fishman


People also ask

How do I disable uniform bucket level in GCP?

To disable uniform bucket-level access on a bucket, you must first remove all IAM Conditions from that bucket's policy. For information on how to view and remove conditions from a bucket's policy, see Using IAM Conditions on bucket.

Can control the access to Cloud Storage bucket using?

This page describes how to control access to buckets and objects using Identity and Access Management (IAM) permissions. IAM allows you to control who has access to your buckets and objects.


1 Answers

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.

like image 180
Hao Xu Avatar answered Oct 07 '22 15:10

Hao Xu