Repository navigation
vault ca bundle support - #911
Conversation
781613d to
8ff5e07
Compare
|
/ok-to-test |
munnerz
left a comment
There was a problem hiding this comment.
A few comments, otherwise looks good to me! We should just make sure we're very clear with docs, and also cover any invalid configurations as part of validation so we catch it early on 😄
| // Vault URL path to the certificate role | ||
| Path string `json:"path"` | ||
| // CA bundle to validate Vault server certificate | ||
| CABundle string `json:"caBundle"` |
There was a problem hiding this comment.
This should be a []byte, inline with other examples of caBundle in Kubernetes. Users then specify it as a base64 encoded value in their YAML 😄 (we should also update the docs to mention this too)
There was a problem hiding this comment.
Can you also add some resource validation that attempts to decode this bundle and ensures it is valid?
There was a problem hiding this comment.
Also, can you update the comment (and other doc above) to clarify the behaviour if:
- A user specifies a https:// URL, but no caBundle
- A user specifies a https:// URL, with a caBundle (i.e. call out that system roots are not used at all)
- A user specifies a http:// URL, with a caBundle
| key value that store the *secretId*. The optional attribute *path* specifies | ||
| where the AppRole authentication is mounted in Vault. The attribute *path* default | ||
| value is *approle*. | ||
| value is *approle*. An optional *caBundle* in PEM format can be provided to validate |
There was a problem hiding this comment.
nit: split onto new line after *approle*.
| vault: | ||
| path: pki_int/sign/example-dot-com | ||
| server: https://vault | ||
| caBundle: ... |
There was a problem hiding this comment.
Instead of ... can we have something like <base64 encoded caBundle PEM file>
30ba75f to
4244781
Compare
|
@munnerz I updated the pr per your review comments. Thanks for the review! Let me know if anything else is needed to merge this. |
munnerz
left a comment
There was a problem hiding this comment.
Thanks very much for addressing the review comments!
I've just got one final comment - notably that the validation code can be moved into the actual API validation package instead of in the issuer's Setup method.
| v.issuer.UpdateStatusCondition(v1alpha1.IssuerConditionReady, v1alpha1.ConditionFalse, errorVault, messageVaultCABundleInvalid) | ||
| return fmt.Errorf(messageVaultCABundleInvalid) | ||
| } | ||
| } |
There was a problem hiding this comment.
This validation should be as part of the actual API validation IMO, which will allow us to reject issuer resources with invalid CAs specified at the time they are created/updated (as opposed to when the controller is syncing the resource).
You should be able to copy this logic across to here, with some minor adjustments: https://github.com/jetstack/cert-manager/blob/master/pkg/apis/certmanager/validation/issuer.go#L115
Signed-off-by: Vincent Desjardins <[email protected]>
Signed-off-by: Vincent Desjardins <[email protected]>
Signed-off-by: Vincent Desjardins <[email protected]>
4244781 to
7b01a8a
Compare
|
code updated with latest comment. |
| // if the Server URL is using HTTPS protocol. This parameter is ignored for | ||
| // plain HTTP protocol connection. If not set the system root certificates | ||
| // are used to validate the TLS connection. | ||
| CABundle []byte `json:"caBundle"` |
There was a problem hiding this comment.
Small nit, and sorry for not spotting sooner.. this should have omitempty on it, else when marshalling nil values into json, it will be caBundle: null which trips up some JSON parsers
Signed-off-by: Vincent Desjardins <[email protected]>
672f1b4 to
4e89b61
Compare
|
Thanks! 😄 /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: munnerz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Add a caBundle field to Vault Issuer.
Which issue this PR fixes:
fixes #834
Special notes for your reviewer:
Release note: