Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to simplify storage permissions #2007

Open
spiffxp opened this issue May 6, 2021 · 10 comments
Open

Try to simplify storage permissions #2007

spiffxp opened this issue May 6, 2021 · 10 comments
Labels
area/access Define who has access to what via IAM bindings, role bindings, policy, etc. area/audit Audit of project resources, audit followup issues, code in audit/ area/infra Infrastructure management, infrastructure design, code in infra/ lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra.

Comments

@spiffxp
Copy link
Member

spiffxp commented May 6, 2021

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:

  1. whether uniform bucket-level access is enabled at bucket-creation time determines whether convenience roles like roles/viewer are granted storage.objects.get (ref: https://cloud.google.com/storage/docs/access-control/iam-roles#basic-roles-modifiable)
  2. there's no predefined role that grants storage.buckets.list on a per-bucket basis except roles/storage.admin
  3. 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:

  1. 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.
  2. 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 with secretmanager.secretLister)
  3. based on 1 and 2, determine if it makes sense to prune convenience bindings like projectOwner:roles/legacyBucketOwner, and replace with direct roles/storage.admin or a custom storage admin role that remove storage.buckets.delete

References:

@spiffxp
Copy link
Member Author

spiffxp commented May 6, 2021

#2010 should allow us to perform 1 (should research more before flipping that switch though)

Also ensures org admins can list, get, update any bucket within the org. Specifically does nothing about whether they can access multipartUploads or objects.

@spiffxp
Copy link
Member Author

spiffxp commented May 28, 2021

Based on review of #2094, here are some example buckets that appear to have per-object ACLs enabled:

  • audit/projects/k8s-gcr-audit-test-prod/buckets/artifacts.k8s-gcr-audit-test-prod.appspot.com/metadata.txt
  • audit/projects/k8s-infra-e2e-boskos-001/buckets/kubernetes-staging-485128143e-asia/metadata.txt
  • audit/projects/k8s-infra-e2e-boskos-001/buckets/kubernetes-staging-485128143e-eu/metadata.txt
  • audit/projects/k8s-infra-e2e-boskos-001/buckets/kubernetes-staging-485128143e/metadata.txt
  • (basically all kubernetes-staging-{sha} buckets created by kube-up.sh)

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 26, 2021
@ameukam
Copy link
Member

ameukam commented Aug 26, 2021

/area infra
/area audit
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added area/infra Infrastructure management, infrastructure design, code in infra/ area/audit Audit of project resources, audit followup issues, code in audit/ and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 26, 2021
@spiffxp
Copy link
Member Author

spiffxp commented Aug 30, 2021

/area access

@k8s-ci-robot k8s-ci-robot added the area/access Define who has access to what via IAM bindings, role bindings, policy, etc. label Aug 30, 2021
@spiffxp
Copy link
Member Author

spiffxp commented Sep 2, 2021

/priority backlog
Though I'd like to breakout dropping per-object ACLs as a higher priority issue
/milestone v1.23

@k8s-ci-robot k8s-ci-robot added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Sep 2, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Sep 2, 2021
@spiffxp
Copy link
Member Author

spiffxp commented Sep 29, 2021

/remove-priority backlog
/priority awaiting-more-evidence
/milestone clear

@k8s-ci-robot k8s-ci-robot added priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. and removed priority/backlog Higher priority than priority/awaiting-more-evidence. labels Sep 29, 2021
@k8s-ci-robot k8s-ci-robot removed this from the v1.23 milestone Sep 29, 2021
@k8s-ci-robot k8s-ci-robot added sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. and removed wg/k8s-infra labels Sep 29, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 28, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 27, 2022
@k8s-ci-robot k8s-ci-robot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jan 27, 2022
@ameukam
Copy link
Member

ameukam commented Jan 28, 2022

/remove-lifecycle rotten
/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/access Define who has access to what via IAM bindings, role bindings, policy, etc. area/audit Audit of project resources, audit followup issues, code in audit/ area/infra Infrastructure management, infrastructure design, code in infra/ lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra.
Projects
None yet
Development

No branches or pull requests

4 participants