infra/gcp/main: give tf bucket owners buckets.list#2005
Merged
k8s-ci-robot merged 1 commit intokubernetes:mainfrom May 6, 2021
Merged
infra/gcp/main: give tf bucket owners buckets.list#2005k8s-ci-robot merged 1 commit intokubernetes:mainfrom
k8s-ci-robot merged 1 commit intokubernetes:mainfrom
Conversation
So apparently the only off-the-shelf roles that grant `storage.buckets.list` are: - `roles/storage.admin` - `roles/owner` - `roles/editor` - `roles/viewer` We're trying to follow the principle of least-privilege for the `k8s-infra-tf-*` buckets. Unfortunately none of the basic roles like `roles/viewer` can be applied directly to a bucket. This leaves us with either: - `roles/viewer` on the project hosting the buckets - `roles/storage.admin` directly on the buckets The latter would grant the following addition permissions compared to the existing set of `roles/storage.legacyBucketOwner` + `roles/storage.objectAdmin`: - `storage.buckets.create` - doesn't matter for a single bucket - `storage.buckets.delete` - this might be concerning for some buckets - `storage.buckets.list` - this is what we want The reason delete might be concerning is if someone accidentally deleted a very public, very hardcoded bucket (e.g. the k8s.gcr.io GCS buckets) just long enough for another project to create a bucket with the now-available name, thus stealing ownership of a very critical asset. ref: https://cloud.google.com/storage/docs/naming-buckets#considerations So as much as I would like to default to `roles/storage.admin` on specific buckets instead of a combination of legacy roles on buckets and projects, I'm not yet prepared to make that call for all of our GCS buckets. Thus, we're left with assigning `roles/viewer` on the project hosting the bucket.
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: spiffxp The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
Author
|
/cc @ameukam |
Contributor
Author
|
Opened #2007 as followup to research if there's a better alternative |
Member
|
/lgtm |
Contributor
Author
|
/hold cancel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses #1974 (comment)
So apparently the only off-the-shelf roles that grant
storage.buckets.listare:roles/storage.adminroles/ownerroles/editorroles/viewerWe're trying to follow the principle of least-privilege for the
k8s-infra-tf-*buckets. Unfortunately none of the basic roles likeroles/viewercan be applied directly to a bucket.This leaves us with either:
roles/vieweron the project hosting the bucketsroles/storage.admindirectly on the bucketsThe latter would grant the following addition permissions compared to the existing set of
roles/storage.legacyBucketOwner+roles/storage.objectAdmin:storage.buckets.create- doesn't matter for a single bucketstorage.buckets.delete- this might be concerning for some bucketsstorage.buckets.list- this is what we wantThe reason delete might be concerning is if someone accidentally deleted a very public, very hardcoded bucket (e.g. the k8s.gcr.io GCS buckets) just long enough for another project to create a bucket with the now-available name, thus stealing ownership of a very critical asset. (ref: https://cloud.google.com/storage/docs/naming-buckets#considerations)
So as much as I would like to default to
roles/storage.adminon specific buckets instead of a combination of legacy roles on buckets and projects, I'm not yet prepared to make that call for all of our GCS buckets.Thus, we're left with assigning
roles/vieweron the project hosting the bucket.