Skip to content

Commit

Permalink
add Helm options to extend auto-approval or disable it
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
  • Loading branch information
inteon authored and cert-manager-bot committed May 28, 2024
1 parent d3e8db7 commit c92fb1c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions deploy/charts/cert-manager/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ spec:
{{- with .Values.dns01RecursiveNameservers }}
- --dns01-recursive-nameservers={{ . }}
{{- end }}
{{- if .Values.disableAutoApproval }}
- --controllers=-certificaterequests-approver
{{- end }}
ports:
- containerPort: 9402
name: http-metrics
Expand Down
11 changes: 10 additions & 1 deletion deploy/charts/cert-manager/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ rules:

---

{{- if not .Values.disableAutoApproval -}}

# Permission to approve CertificateRequests referencing cert-manager.io Issuers and ClusterIssuers
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -489,7 +491,12 @@ rules:
- apiGroups: ["cert-manager.io"]
resources: ["signers"]
verbs: ["approve"]
resourceNames: ["issuers.cert-manager.io/*", "clusterissuers.cert-manager.io/*"]
{{- with .Values.approveSignerNames }}
resourceNames:
{{- range . }}
- {{ . | quote }}
{{- end }}
{{- end }}

---

Expand All @@ -514,6 +521,8 @@ subjects:

---

{{- end -}}

# Permission to:
# - Update and sign CertificatSigningeRequests referencing cert-manager.io Issuers and ClusterIssuers
# - Perform SubjectAccessReviews to test whether users are able to reference Namespaced Issuers
Expand Down
17 changes: 17 additions & 0 deletions deploy/charts/cert-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,23 @@ dns01RecursiveNameservers: ""
# Enabling this option could cause the DNS01 self check to take longer owing to caching performed by the recursive nameservers.
dns01RecursiveNameserversOnly: false

# Option to disable cert-manager's build-in auto-approver. The auto-approver
# approves all CertificateRequests that reference issuers matching the 'approveSignerNames'
# option. This 'disableAutoApproval' option is useful when you want to make all approval decisions
# using a different approver (like approver-policy - https://github.com/cert-manager/approver-policy).
disableAutoApproval: false

# List of signer names that cert-manager will approve by default. CertificateRequests
# referencing these signer names will be auto-approved by cert-manager. Defaults to just
# approving the cert-manager.io Issuer and ClusterIssuer issuers. When set to an empty
# array, ALL issuers will be auto-approved by cert-manager. To disable the auto-approval,
# because eg. you are using approver-policy, you can enable 'disableAutoApproval'.
# ref: https://cert-manager.io/docs/concepts/certificaterequest/#approval
# +docs:property
approveSignerNames:
- issuers.cert-manager.io/*
- clusterissuers.cert-manager.io/*

# Additional command line flags to pass to cert-manager controller binary.
# To see all available flags run `docker run quay.io/jetstack/cert-manager-controller:<version> --help`.
#
Expand Down

0 comments on commit c92fb1c

Please sign in to comment.