A software engineer receives an Access Denied error when running `gcloud storage cp file.txt gs://my-company-assets/ --canned-acl=public-read`. Upon inspecting the bucket configuration, you confirm that Uniform Bucket-Level Access (UBLA) is enabled on `my-company-assets`. According to Google Cloud security best practices, how should you grant public read access to the objects in this bucket?
- Grant the predefined Storage Object Viewer role (roles/storage.objectViewer) to allUsers on the bucket IAM policy.Cevap
- BDisable Uniform Bucket-Level Access on the bucket and re-run the upload command using the canned ACL flag.
- CGrant the primitive Viewer role (roles/viewer) to allUsers directly on the Cloud Storage bucket.
- DApply an IAM deny policy at the Google Cloud project level for allUsers on storage.objects.get to override bucket permissions.
Cevap
Grant the predefined Storage Object Viewer role (roles/storage.objectViewer) to allUsers on the bucket IAM policy.
When Uniform Bucket-Level Access (UBLA) is enabled on a Cloud Storage bucket, individual object ACLs (such as canned ACLs) are disabled. All access control must be managed through Google Cloud IAM policies. To make all objects in the bucket publicly readable, security best practices dictate granting the predefined `Storage Object Viewer` (`roles/storage.objectViewer`) role to `allUsers` on the bucket's IAM policy.
Adım Adım Çözüm
Anahtar Kavram
Uniform Bucket-Level Access and IAM Access Control
Tahmini Süre:1m 15s