-
Notifications
You must be signed in to change notification settings - Fork 402
Certificate signing request ca issuer #587
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
Merged
jetstack-bot
merged 5 commits into
cert-manager:release-next
from
JoshVanL:certificate-signing-request-ca-issuer
Jun 14, 2021
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f27d94f
Adds initial CertificateSigningRequest documentation for ca-issuer
JoshVanL 0be3fc2
Adds trailing slash to internal doc references in kube-csr.md
JoshVanL 2d5e6fb
Change wording to include both `spec` and `status` fields
JoshVanL 3fd8fc2
Adds '=true' to CertificateSigningRequest feature gate flag
JoshVanL 519b80c
Update FAQ to include usage reference
JoshVanL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| --- | ||
| title: "Kubernetes CertificateSigningRequests" | ||
| linkTitle: "Kubernetes CertificateSigningRequests" | ||
| weight: 400 | ||
| type: "docs" | ||
| --- | ||
|
|
||
| Kubernetes has an in-built | ||
| [CertificateSigningRequest](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/) | ||
| resource. This resource is similar to the cert-manager | ||
| [CertificateRequest](../../concepts/certificaterequest/) in that it is used to | ||
| request an X.509 signed certificate from a referenced Certificate Authority | ||
| (CA). | ||
|
|
||
| Using this resource may be useful for users who are using an application that | ||
| supports this resource, and not the cert-manager CertificateRequest resource, | ||
| but they still wish for certificates to be signed through cert-manager. | ||
|
|
||
| #### Feature State | ||
|
|
||
| This feature is currently in an _experimental_ state, and its behavior is | ||
| subject to change in further releases. | ||
|
|
||
| {{% pageinfo color="warning" %}} | ||
|
|
||
| ⛔️ This feature is only enabled by adding it to the `--feature-gates` flag on | ||
| the cert-manager controller: | ||
|
|
||
| ```bash | ||
| --feature-gates=ExperimentalCertificateSigningRequestControllers=true | ||
| ``` | ||
|
|
||
| Which can be added using Helm: | ||
|
|
||
| ```bash | ||
| $ helm install \ | ||
| cert-manager jetstack/cert-manager \ | ||
| --namespace cert-manager \ | ||
| --create-namespace \ | ||
| --set featureGates="ExperimentalCertificateSigningRequestControllers=true" \ | ||
| # --set installCRDs=true | ||
| ``` | ||
|
|
||
| > Note: cert-manager currently only supports signing CertificateSigningRequests | ||
| > using the [CA issuer](../../configuration/ca/). | ||
|
|
||
| > Note: cert-manager _will not_ automatically approve CertificateSigningRequests | ||
| > that reference a cert-manager [Issuer](../../configuration/). Please refer to | ||
| > the [Kubernetes documentation](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/#request-signing-process) | ||
| > for the request process of CertificateSigningRequests. | ||
|
|
||
|
|
||
| {{% /pageinfo %}} | ||
|
|
||
|
|
||
| ## Signer Name | ||
|
|
||
| CertificateSigningRequests contain a | ||
| [`spec.signerName`](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/#request-signing-process) | ||
| field to reference a CA to sign the request. cert-manager Issuers or | ||
| ClusterIssuers are referenced in the following form: | ||
|
|
||
| ``` | ||
| <resource type>.cert-manager.io/<signer namespace (if namespaced)>.<signer name> | ||
| ``` | ||
|
|
||
| For example, a namespaced Issuer in the namespace `sandbox` with the name | ||
| `my-issuer` would be referenced via: | ||
|
|
||
| ```yaml | ||
| signerName: issuers.cert-manager.io/sandbox.my-issuer | ||
| ``` | ||
|
|
||
| A ClusterIssuer with the name `my-cluster-issuer` would be referenced via: | ||
|
|
||
| ```yaml | ||
| signerName: clusterissuers.cert-manager.io/my-cluster-issuer | ||
| ``` | ||
|
|
||
| ### Referencing Namespaced Issuers | ||
|
|
||
| Unlike CertificateRequests, CertificateSigningRequests are cluster scoped | ||
| resources. To prevent users from requesting certificates from a namespaced | ||
| Issuer in a namespace that they otherwise would not have access to, cert-manager | ||
| performs a | ||
| [SubjectAccessReview](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access). | ||
| This review ensures that the requesting user has the permission to `reference` | ||
| the `signers` resource in the given namespace. The name should be either the | ||
| name of the Issuer, or `"*"` to reference all Issuers in that namespace. | ||
|
|
||
| An example Role to give permissions to reference Issuers in the `sandbox` | ||
| namespace would look like the following: | ||
|
|
||
| ```yaml | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: cert-manager-referencer:my-issuer | ||
| namespace: sandbox | ||
| rules: | ||
| - apiGroups: ["cert-manager.io"] | ||
| resources: ["signers"] | ||
| verbs: ["reference"] | ||
| resourceNames: | ||
| - "my-issuer" # To give permission to _only_ reference Issuers with the name 'my-issuer' | ||
| - "*" # To give permission to reference Issuers with any name in this namespace | ||
| ``` | ||
|
|
||
| ## Annotations | ||
|
|
||
| To keep feature parity with CertificateRequests, annotations are used to store | ||
| values that do not exist as `spec` or `status` fields on the | ||
| CertificateSigningRequest resource. These fields are either set by the | ||
| _requester_ or by the _signer_ as labelled below. | ||
|
|
||
| - `experimental.cert-manager.io/request-duration`: **Set by the requester**. Accepts | ||
| a [Go time duration](https://golang.org/pkg/time/#ParseDuration) string | ||
| specifying the requested certificate duration. Defaults to 90 days. | ||
|
|
||
| - `experimental.cert-manager.io/request-is-ca`: **Set by the requester**. If set to | ||
| `"true"`, will request for a CA certificate. | ||
|
|
||
| - `experimental.cert-manager.io/ca`: **Set by the signer**. Once signed, the | ||
| signer will populate this annotation with the base 64 encode CA certificate | ||
| of the signing chain. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use present tense instead of future