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

Add Helm option to create RBAC allowing approval for all issuers #278

Open
SgtCoDFish opened this issue Oct 4, 2023 · 1 comment
Open
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@SgtCoDFish
Copy link
Member

When a user creates a custom issuer, they'll currently need to give permission to approver-policy to approve CertificateRequests from that issuer, which will look something like the below:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: example-role
rules:
- apiGroups:
  - cert-manager.io
  resourceNames:
  - issuer.example.com/*
  resources:
  - signers
  verbs:
  - approve

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: example-rolebinding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: example-role
subjects:
- kind: ServiceAccount
  name: cert-manager-approver-policy
  namespace: myns

It's possible to conjure situations where users might want to restrict these permissions, but for most users installing approver-policy it's reasonable for them to want it to be able to approve CRs from any issuer.

Maybe for security reasons we wouldn't want to default open (although we might yet consider defaulting open!), but we could at least add a Helm option to create an allow-all role which applies to approver-policy in this case.

/kind feature

@SgtCoDFish SgtCoDFish added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Oct 4, 2023
@jetstack-bot jetstack-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 4, 2023
@wallrj
Copy link
Member

wallrj commented Oct 17, 2023

I think I agree with this change, to (optionally) make things simpler for people using approver-policy with external issuers.

Is csi-driver-spiffe an example of a situation where not to enable this new setting?

In https://cert-manager.io/docs/usage/csi-driver-spiffe/#approver :

A distinct cert-manager approver Deployment is responsible for managing the approval and denial condition of created CertificateRequests that target the configured SPIFFE Trust Domain signer.
The approver will only manage CertificateRequests who request from the same IssuerRef that has been configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants