-
Notifications
You must be signed in to change notification settings - Fork 0
sslcertificate::from_pem - add switch to remove duplicates immediately #10
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
Conversation
Is the |
@simonlye spot on, that duplicate wasn't supposed to be there. |
If the intent of this is to always have exactly one cert with a given name, then I might suggest comparing thumbprints rather than ExpiresAfter dates - these are guaranteed to always be unique. If the intent is to have no expired certificates, then I'd compare the ExpiresAfter to the current timestamp (but there's still a window of one puppet-run's duration). |
Have re-worked to just compare the current date to |
Sounds good. If I were being picky, I'd suggest multiplying by With |
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.
sslcertificate::from_pem currently leaves expired certificates around for 30 days, before it removes them.
This causes issues with NPS still sometimes trying to use the old certificate and breaking WiFi auth.
This PR adds a switch of
remove_immediately
that we can pass from puppet when using the module on a server.The existing logic gets certificates from the local cert store that match the certificate name, looks at the expiry date, checks if it's more than 30 days ago and removes them.
The new logic if the switch is used should get certificates from the local store, matches the name, then checks the expiry date again the current one being stored in Vault, and removes them if they don't match. which should get rid of dupes on the first puppet run after there are multiples.
This Puppet resources already notifies the IAS service, so should restart it and confirm it's using the current cert.
Is this a sensible plan?
Do we still want to keep expired certs around for 30 days? I assume this was a thing for when we weren't positive the cert renewal process worked?
Would we prefer to just compare each certs
notafter
date to todays date and remove them the first puppet run after they expire?