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

[WIP] authn-authz: document delegating custom signing domains #49275

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevekuznetsov
Copy link
Contributor

Description

Correctly scoping permissions for an actor that can delegate permissions to sign and approve CertificateSigningRequests under a domain is subtle.

Issue

Closes: kubernetes/kubernetes#122154

cc @enj

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign dipesh-rawat for approval. For more information see the Kubernetes Code Review Process.

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

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

@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 2, 2025
@k8s-ci-robot k8s-ci-robot requested review from enj and mikedanese January 2, 2025 22:31
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 2, 2025
Correctly scoping permissions for an actor that can delegate permissions
to sign and approve CertificateSigningRequests under a domain is subtle.

Signed-off-by: Steve Kuznetsov <[email protected]>
@stevekuznetsov stevekuznetsov force-pushed the skuznets/delegating-csr-tutorial branch from c8dc3aa to 5e12edc Compare January 2, 2025 22:36
Copy link

netlify bot commented Jan 2, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit c8dc3aa
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/677713ae6cfcc600085f6187
😎 Deploy Preview https://deploy-preview-49275--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 2, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 5e12edc
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/677714dd4c1c980008dfac8b
😎 Deploy Preview https://deploy-preview-49275--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sftim
Copy link
Contributor

sftim commented Jan 3, 2025

document delegating custom signing domains

sounds like a task [page] - this is a task a cluster admin might want to learn

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

/retitle [WIP] authn-authz: document delegating custom signing domains

@@ -613,6 +613,249 @@ To test it, change the context to `myuser`:
kubectl config use-context myuser
```

<!-- TODO this should become a task page -->
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this a task page before the first merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes totally - I didn't know what the preference was, since the other set above was not a task yet. Do you think we should put this under content/en/docs/tasks/administer-cluster/?

Comment on lines +627 to +635
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: top-level-csr-approver
rules:
- apiGroups: ["certificates.k8s.io"]
resourceNames: ["example.com/*"]
resources: ["signers"]
verbs: ["approve", "sign"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, either:

  • mention that RBAC is only one possible authz mechanism
  • avoid a focus RBAC and instead talk about what the SubjectAccessReview(s) will look like

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I need to read up on the other mechanisms right now.

Copy link
Contributor

Choose a reason for hiding this comment

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

The main in-tree alternative is webhook authz, but you can combine that with eg https://www.openpolicyagent.org/integrations/kubernetes-authorization/ or https://github.com/awslabs/cedar-access-control-for-k8s

OpenShift has its own custom authz that extends K8s RBAC.


### Set up a service account for the installer

In this example, we will assume some application that installs CSR signers on a Kubernetes cluster.
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment on lines +653 to +656
apiVersion: v1
kind: Namespace
metadata:
name: csr-signer-installer
Copy link
Contributor

Choose a reason for hiding this comment

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

Defining this namespace should be its own step.

@k8s-ci-robot k8s-ci-robot changed the title authn-authz: document delegating custom signing domains [WIP] authn-authz: document delegating custom signing domains Jan 3, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. language/en Issues or PRs related to English language 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.

Users Can't Delegate CSR Approval/Signing Permissions Within A Domain
3 participants