-
Notifications
You must be signed in to change notification settings - Fork 570
fix(target-allocator): Extend target allocator CA certificate duration to prevent renewal race #4526
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
base: main
Are you sure you want to change the base?
fix(target-allocator): Extend target allocator CA certificate duration to prevent renewal race #4526
Conversation
…n to prevent renewal race
| Spec: cmv1.CertificateSpec{ | ||
| IsCA: true, | ||
| CommonName: naming.CACertificate(params.TargetAllocator.Name), | ||
| // Set CA certificate to 1 year (much longer than the default 90-day duration of client/server certs) |
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.
Is the client/server certs renewal configurable?
Would it make sense to make the CA renewal shorter? / What is the lowest safe value possible for the CA renewal?
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.
client/server certs renewal configurable?
No, when I'd looked at it, it was using cert-manager's defaults (which I had to look up, hence the comments for reference because i thought it was 90 days, but had to look it up).
I think that's fine, for simplicity
make the CA renewal shorter? / What is the lowest safe value possible for the CA renewal?
In general, I've seen CAs pretty long-lived. 1-year seems reasonable (I think even like 10 years would be ok, but guessing original author(s) were erring on shorter lifecycle for CA - I don't have that history, so I picked 1 year.
I think 1 year, combined with @swiatekm suggestion adding a renewBefore would actually eliminate the race.
Will push a change.
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.
Would it make sense to set the CA certificate grace period ( |
… client/server certs
Description:
See #4441 for details
The root cause (from the 3 separate accounts in the thread) seems to be that all three TargetAllocator certificates (CA, server, client) were created at the same time with the same 90-day duration.
When they all came up for renewal simultaneously (around day 60), there was a race condition where, *for example:
By giving the CA a 1-year duration while client/server certs keep the default 90-day duration, we ensure:
Link to tracking Issue(s):
Testing:
Documentation:
Added a changelog gen entry