Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra/gcp/gcs: tighten private gcs bucket iam
By default, GCS will create an IAM binding on new GCS buckets that gives members of roles/editor for the project roles/storage.legacyBucketOwner for the bucket. roles/storage.legacyBucketOwner contains storage.buckets.setIamPolicy, but not storage.objects.get. This means someone with roles/editor on the project could grant themselves access to read bucket contents that they aren't supposed to be able to read. Given that roles/editor has no *.setIamPolicy permissions for other service resources, this seems like a security gap that should be closed. Ideally we would do this in _ensure_gcs_bucket. However, removing this role means removing other (possibly needed) permissions that may be used by GCP service agent service accounts (e.g. App Engine, GCR, GCE): - storage.buckets.get - storage.multipartUploads.(abort|create|list|listParts) - storage.objects.(create|delete|list) So for now we constrain to "private" gcs buckets that are currently only used by humans to store terraform state containing potentially sensitive info
- Loading branch information