-1

I have a Google Bucket that requires the files in it to be publicly accessible with direct URL. I set access to "allUsers"

However, I noticed that URL https://console.cloud.google.com/storage/browser/{bucket_name} opens when I use my other gmail account and I can see the entire bucket structure, read only.

How to properly set permissions so that other google account cannot access it?

Thank you!

cheechee
  • 33
  • 5
  • You may want to check for ACLs – Puteri Nov 05 '22 at 02:41
  • 1
    @FerreginaPelona thank you, could you maybe assist with specific settings you had in mind? Sorry, I am new to Google cloud and find permission control very confusing, went over the docs twice but am unable to set it correctly :) Thank you! – cheechee Nov 05 '22 at 08:04
  • Have you referred to this [document](https://cloud.google.com/storage/docs/access-control/create-manage-lists#changing-acls) ? – Veera Nagireddy Nov 10 '22 at 16:34

1 Answers1

1

Follow the below steps to make files in the bucket are publicly accessible via URL, but bucket structure is not accessible.

step -1:

While creating a bucket give the access control as fine grained or if you have already created a bucket change the access control from Uniform to Fine Grained.

Above step enable the ACL’s(Access control lists) for the object.

Step-2:

We need to set ACL’s for the object in the bucket.

1.Go to the Cloud Storage browser in the Google Cloud console.

2.Navigate to the object whose ACL you want to modify.

3.Choose Edit access from the more actions menu (3 dots on right side of the object) associated with the object.

4.Click Add item.

5.Give entity, name and Access as public, All users and reader respectively as shown in below image.

enter image description here

  1. Click save.

Step-3:

https://console.cloud.google.com/storage/browser/{bucket_name}, Now from this URL all users cannot access the bucket.

Now select the object which you want to share, choose the copy public url from the more actions menu associated with the object. The url will be as (https://storage.googleapis.com/demobucket-0/Screenshot%202022-09-13%202.00.31%20PM.png), Now from this url anyone can access the object but cannot view the bucket details or structure.

Veera Nagireddy
  • 1,656
  • 1
  • 3
  • 12