Skip to content

roles: add custom org role container.deployer#2156

Merged
k8s-ci-robot merged 3 commits intokubernetes:mainfrom
spiffxp:container-deployer-role
Jun 10, 2021
Merged

roles: add custom org role container.deployer#2156
k8s-ci-robot merged 3 commits intokubernetes:mainfrom
spiffxp:container-deployer-role

Conversation

@spiffxp
Copy link
Copy Markdown
Contributor

@spiffxp spiffxp commented Jun 8, 2021

The intent is to bind this to prow-deployer@k8s-infra-prow-build-trusted to give prow the ability to CRUD all resources in a given GKE cluster without granting it permission to CRUD the cluster itself.

Motivated by issues deploying kubernetes-external-secrets via post-k8sio-deploy-prow-build-trusted-resources: #2148 (comment)

See individual commits for details

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. wg/k8s-infra labels Jun 8, 2021
@k8s-ci-robot k8s-ci-robot requested review from nikhita and thockin June 8, 2021 03:48
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 8, 2021
@spiffxp
Copy link
Copy Markdown
Contributor Author

spiffxp commented Jun 10, 2021

/cc @BenTheElder @ameukam

Copy link
Copy Markdown
Member

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 10, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 10, 2021
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, spiffxp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ameukam
Copy link
Copy Markdown
Member

ameukam commented Jun 10, 2021

/lgtm

Comment on lines +615 to +620
- contactcenterinsights.analyses.list
- contactcenterinsights.conversations.list
- contactcenterinsights.issueModels.list
- contactcenterinsights.issues.list
- contactcenterinsights.operations.list
- contactcenterinsights.phraseMatchers.list
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spiffxp out of curiosity, why do we need this ? Do we have a GCP API use this as a dependency ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are coming in via roles/iam.securityReviewer, ref:

# *.list and *.getIamPolicy
- roles/iam.securityReviewer

And we're constraining to list|get.* permissions, with some service-specific exceptions, ref:

# only include (get|list).* (e.g. get, getIamPolicy, etc.)
- \.(list|get)[^\.]*$
# include some exceptions from service-specific roles:
# ...everything from roles/cloudasset.viewer
- ^cloudasset.assets.(analyze|export|search)[^\.]*$
# ...this specific permission from roles/cloudkms.publicKeyViewer
- cloudkms.cryptoKeyVersions.viewPublicKey
# ...this specific permission from roles/serviceusage.serviceUsageConsumer
- serviceusage.services.use

You're right that we don't need this; it's more that I've been lazy about restricting what we pull in. I honestly don't really know whether it makes more sense to use roles/viewer instead of all the service-specific roles, or if it's worth investing the time to tighten the role to exactly the services we expect.

Copy link
Copy Markdown
Member

@ameukam ameukam Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the current state of laziness just want to make sure I understand correctly. :-)
Looking at https://github.com/darkbitio/gcp-iam-role-permissions/blob/master/roles/viewer, I think we should stick at custom roles.

@spiffxp
Copy link
Copy Markdown
Contributor Author

spiffxp commented Jun 10, 2021

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 10, 2021
@k8s-ci-robot k8s-ci-robot merged commit 835007b into kubernetes:main Jun 10, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Jun 10, 2021
@spiffxp spiffxp deleted the container-deployer-role branch June 10, 2021 21:00
@spiffxp
Copy link
Copy Markdown
Contributor Author

spiffxp commented Jun 10, 2021

Ran make -C images/k8s-infra TAG=latest run ./infra/gcp/ensure-organization.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants