Open
Description
Followup based on #2005
For whatever reason, I am still confused by exactly which permissions are available to whom on which GCS buckets. I've started consulting a spreadsheet I put together to help figure out what makes sense from a policy perspective. I've been trying keep GCS IAM best practices in mind, as well as the guidance that basic roles aren't a great idea for production environments.
Three things currently bug me:
- whether uniform bucket-level access is enabled at bucket-creation time determines whether convenience roles like
roles/viewer
are grantedstorage.objects.get
(ref: https://cloud.google.com/storage/docs/access-control/iam-roles#basic-roles-modifiable) - there's no predefined role that grants
storage.buckets.list
on a per-bucket basis exceptroles/storage.admin
- some projects have buckets that are more sensitive than others (e.g. terraform resources for disparate privilege levels, logs containing PII), and it's unclear how to ensure basic roles are denied permissions to these buckets, while retaining admin/read privileges for other buckets
What I think we can do to address:
- Set
constraints/storage.uniformBucketLevelAccess
at the org level (ref: https://cloud.google.com/resource-manager/docs/organization-policy/org-policy-constraints). This wouldn't suddenly wipe out existing per-object ACLs. The only per-object ACLs I am currently aware of are related to billing data in kubernetes-public, and I'm optimistic they can be removed in favor of the bucket's IAM policy. - research if this is feasible or worthwhile by creating a custom
storage.bucketLister
role and trying to apply it on a per-bucket basis (we do this today withsecretmanager.secretLister
) - based on 1 and 2, determine if it makes sense to prune convenience bindings like
projectOwner:roles/legacyBucketOwner
, and replace with directroles/storage.admin
or a custom storage admin role that removestorage.buckets.delete
References:
- https://cloud.google.com/storage/docs/access-control/iam#best_practices
- https://cloud.google.com/storage/docs/access-control/iam#project-level_roles_vs_bucket-level_roles
- https://cloud.google.com/storage/docs/access-control/iam#convenience-values
- https://cloud.google.com/storage/docs/access-control/iam-roles#basic-roles-modifiable
- https://cloud.google.com/storage/docs/access-control/iam-permissions
Metadata
Assignees
Labels
Define who has access to what via IAM bindings, role bindings, policy, etc.Audit of project resources, audit followup issues, code in audit/Infrastructure management, infrastructure design, code in infra/Indicates that an issue or PR should not be auto-closed due to staleness.Lowest priority. Possibly useful, but not yet enough support to actually get it done.Categorizes an issue or PR as relevant to SIG K8s Infra.