Description
In a Cloud Storage ACL, allUsers includes anonymous users and allAuthenticatedUsers includes accounts outside the project. A bucket READER can list objects. Reading an object’s contents requires object-level access.
Potential impact
Public write access can allow object creation, replacement or deletion. A public defaultObjectAcl can expose newly uploaded objects that do not specify their own ACL. Changing the default leaves existing object ACLs intact.
Remediation
Review IAM, existing bucket and object ACLs, and the default object ACL. Remove unnecessary public grants and use public access prevention where appropriate. Before enabling uniform bucket-level access, migrate required ACL grants to IAM. When ACLs remain necessary, name the required recipients and roles. Test intended access and denial of unapproved requests.
Examples
Use these excerpts to review legacy Deployment Manager templates. Supply the actual bucket name and consult the service’s deprecation and migration guidance.
Using the default ACL
resources:
- name: storage-bucket
type: storage.v1.bucket
properties:
name: my-bucket
With ACLs enabled, a bucket created without an explicit ACL defaults to projectPrivate. Review effective IAM and public access prevention to determine its actual exposure.
Granting read access to one user
resources:
- name: storage-bucket
type: storage.v1.bucket
properties:
name: my-bucket
acl:
- entity: user-liz@example.com
role: READER
defaultObjectAcl:
- entity: user-liz@example.com
role: READER
The named user can list objects in this bucket and read new objects that inherit the default ACL. Use an approved account and check existing object ACLs and IAM for other grants.