-
Notifications
You must be signed in to change notification settings - Fork 41k
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
Expose SslBundle information via actuator metrics #42030
Comments
That's an interesting idea. @jonatan-ivanov, what do you think? |
SslBundle
information via actuator metrics
I think this is a great idea and we can create a We also need to be able to somehow "refresh" the registered So I think this is useful but could be trickier than it seems for the first sight. |
Just an assumption, but maybe we could first expose the SslBundle information on metric by using counters (ex : the second solution @jonatan-ivanov provided) on this issue. And then open another issue for the "bigger" enhancement with the I'm not a huge open-source contributor, so please correct me if I am wrong, I'm want to learn. |
The two solutions I was talking about above ("days left" and "cert count by status") are not mutually exclusive, I think we should do both. The |
Okay thanks ! Correct me if I'm wrong, but, we could not aggregate all certificate for the Gauge ? Couldn't we just refresh the gauge on reload ? |
This feels a little bit like aggregating the health status where we use the worst case by default. For example, if one subsystem is down and everything else is up, the overall status will be down. I think a similar assume-the-worst approach makes sense here as a certificate chain is only as good as the "worst" certificate in that chain. For corner cases where there's an expired certificate and a not-yet-valid certificate, I would considered expired to be worse than not-yet-valid so the chain should be considered as having expired. My reasoning being that an expired cert cannot be fixed without someone doing something but a not-yet-valid certificate could, potentially, be fixed just by waiting. |
For reference, here's the worst case by default aggregation in the health status : if (containsOnlyValidCertificates(certificateChain)) {
validCertificateChains.add(certificateChain);
}
else if (containsInvalidCertificate(certificateChain)) {
invalidCertificateChains.add(certificateChain);
} As long as a chain contains 1 invalid certificate, the whole chain is added in the "invalidCertificateChains" list. |
I currently have something like this:
So far this is working quite nicely. However, reload could be a bit trickier. Essentially we need to remove the gauges which track chains which no longer exist and update the existing ones. The |
Nice! Can you show me the code? /cc @shakuzen |
Sure. I'll work a bit on it today, and then link the branch here. |
It sounds like |
@jonatan-ivanov: Code is here: https://github.com/mhalbritter/spring-boot/tree/mh/42030-expose-sslbundle-information-via-actuator-metrics I've used the |
I saw that support for SSL bundles was added to the actuator
info
andhealth
endpoints in #41205 and I think it would be really helpful to make that information available in themetrics
endpoint as well. I would like to utilize this enhancement to set up an alarm in my monitoring software so that I can renew my certificates before they expire.I would imagine something like this:
The text was updated successfully, but these errors were encountered: