-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Rotate certificate upon valid principals change. #2812
Conversation
4fefdf2
to
3b1156d
Compare
Ignore 0.0.0.0 when checking if certificate needs to be rotated.
3b1156d
to
39464aa
Compare
// updated, the list of principals (SSH) or DNS names (TLS) on the | ||
// certificate need to be updated. | ||
if len(additionalPrincipals) != 0 && !conn.ServerIdentity.HasPrincipals(principalsToCheck) { | ||
principalsChanged = true |
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.
if all you care about is that the certificates have changed, you can return here, and avoid the extra variable?
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.
It's for logging purposes, so we can debug what changed (was it SSH or TLS or both).
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.
gotcha
additionalPrincipals, conn.ServerIdentity.Cert.ValidPrincipals) | ||
} | ||
if len(dnsNames) != 0 && !conn.ServerIdentity.HasDNSNames(dnsNames) { | ||
dnsNamesChanged = true |
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.
Ditto here?
Description
Ignore 0.0.0.0 when checking if certificate needs to be rotated.