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
cert-manager does not allow us to create certs for 64+ bytes name ksvc #214
Comments
|
Is there a reason why cert manager has this 64 byte limit? |
|
Yes, cert-manager/cert-manager#1462 has the discussion. It seems CA has the limitation as per the comment linked in above issue.
|
|
This issue is stale because it has been open for 90 days with no |
|
@nak3 is there anything we can do regarding this issue? Thinking of a few things
|
|
/assign Yes, I think these two suggestions are what we can do now. I will work on it. |
|
This issue is stale because it has been open for 90 days with no |
@nak3 Why not just ensure that the apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: route-5178950c-94db-4563-9e3f-bd7583570bd8
namespace: knative-serving
spec:
commonName: service-name.namespace.example.com
dnsNames:
- service-name.namespace.example.com
issuerRef:
kind: ClusterIssuer
name: letsencrypt
secretName: route-5178950c-94db-4563-9e3f-bd7583570bd8you can just as easily read from |
|
Maybe there is a better way here: Alternatively, just revert this PR #188 |
|
/cc @ZhiminXiang @itsmurugappan Could you please check the Leonard's comment #214 (comment) ? |
|
I think reverting #188 may break the support to venafi. @itsmurugappan could you double check? |
|
yes, reverting would break venafi support. |
|
Does it make sense to make setting the common name configurable? It's unclear to me if Venafi is an outlier so I don't know what the default should behaviour should be. |
I think the default behaviour should be to try to stick to standards for certificates. Venafi should consider changing their implementation to support standards as well. |
|
Can people comment on #380? This is breaking at least one customer who does end up with longer names, and shorter |
|
There are two facts we need to be aware:
Considering this, I would say the error @nak3 reported is expected no matter if we set What we can do better is to handle the case where there are multiple values in the |
|
As an end user, I'd like to add my perspective for how I would expect this to work with AutoTLS. Instead of automatically using top-level domain (which as mentioned here could lead to unexpected security issues), KNative could expose a |
|
I can make this configurable, but I think my default would be |
|
/assign |
|
I've started a new set of PRs to address this issue. The main one for net-certmanager is here: #472 It links to the other dependent PRs. Any feedback on those would be appreciated! |
|
Following up - I've been testing Clay's changes. Rebased PR+test fixes: #478 Few observations about the
The second issue is obvious when using route tags and I think we have a few options from the top of my head:
|
|
Scanning a list of certs isn't so bad (0c452ab) I just realize we have to do it across all namespaces. |
|
Serving tests passed here: https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative_serving/13621/istio-latest-no-mesh-tls_serving_main/1617586794230976512 This tested the change where we scan other 'Ready' certs |
|
Talked to @KauzClay we'll go ahead an land a fix using the cert look up - though it is uncertain whether it works when renewing certs (which is already broken #416). Thus we'll land this fix in 1.9 and do a subsequent point release that swiches the code over to attempt unique commonNames and fixing renewal in the serving code. |
* fix: don't use childname * childname puts the hash at the end of the domain, making the domain invalid for the challenge * this means that it is still possible for a cert to be created with a common name longer than 63 bytes if the domain itself is really large * however, it should be less likely. hopefully that can be addressed completely if subsequent commits * fix: make sure checking for existing cert excludes itself * add logging to renewing codepath * wip: create unique common name * still can't guarantee that it will be a valid length, though this will hopefully greatly reduce that possibility * wip: don't need to look for other certs * if we always create unique common names for the certs, we shouldn't need to find another cert with the same common name * don't need to log for this anymore either * use UID as prefix to common name when original is too long * respond with appropriate errors in different cases where shortening doesn't work * return status conditions and update kcert accordingly * run update codegen * remove extra status, just update ready status instead * use trimsuffix
* fix: don't use childname * childname puts the hash at the end of the domain, making the domain invalid for the challenge * this means that it is still possible for a cert to be created with a common name longer than 63 bytes if the domain itself is really large * however, it should be less likely. hopefully that can be addressed completely if subsequent commits * fix: make sure checking for existing cert excludes itself * add logging to renewing codepath * wip: create unique common name * still can't guarantee that it will be a valid length, though this will hopefully greatly reduce that possibility * wip: don't need to look for other certs * if we always create unique common names for the certs, we shouldn't need to find another cert with the same common name * don't need to log for this anymore either * use UID as prefix to common name when original is too long * respond with appropriate errors in different cases where shortening doesn't work * return status conditions and update kcert accordingly * run update codegen * remove extra status, just update ready status instead * use trimsuffix --------- Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com>
|
Patch release is out I'm going to close this out |
Step to reproduce
1. Create ksvc domain with long name.
e.g.
As you can see,
httpdoes not becomehttps2. kcert becomes
ReconcileFailed3. certmanager pod produces following error.
It says
spec.commonName: Too long: must have at most 64 bytes".Additional Info
Normal name ksvc could create kcert as expected.
cert-manager generate
certificates.cert-manager.iowhich hasspec.commonNamewith the domain name.The text was updated successfully, but these errors were encountered: