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

Allow CSR that contains either IP or DNS as SANs #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yuanying
Copy link

In some environments, kubelet may only send IP addresses or DNS
address as SANs in CSR. For example, kubelet which starts with
--hostname-override=IP_ADDRRES only sends IP addresses.
So we should allow this CSR.

@dbaumgarten
Copy link

@jnummelin I really don't want to annoy anyone, but having this PR merged would be really, really helpful

@jnummelin
Copy link
Contributor

@dbaumgarten no worries. I haven't been working with stamper (or any other kontena org projects) in a good while and hence all the notifications from these have fallen into /dev/null unfortunately. I'll be looking at all the open PRs in coming week or so.

@@ -73,7 +73,7 @@ func isNodeServingCert(csr *capi.CertificateSigningRequest, x509cr *x509.Certifi
klog.Warningf("Org does not match: %s", x509cr.Subject.Organization)
return false
}
if (len(x509cr.DNSNames) < 1) || (len(x509cr.IPAddresses) < 1) {
if (len(x509cr.DNSNames) < 1) && (len(x509cr.IPAddresses) < 1) {
return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As defined in the original issue #35 maybe we should also log here something why we're rejecting the CSR. I.e. something like No DNS or IP addresses given in CSR

Copy link
Author

@yuanying yuanying Oct 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added! 6041f9f

In some environments, kubelet may only send IP addresses or DNS
address as SANs in CSR. For example, kubelet which starts with
`--hostname-override=IP_ADDRRES` only sends IP addresses.
So we should allow this CSR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants