-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Add SslInfoContributor and SslHealthIndicator #41205
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Hey @jonatan-ivanov, that's quite a cool feature, thank you! The implementation looks good, too. This works for all SSL bundles, and not only for the one used by the webserver, right? |
Great to hear! The main focus is the webserver but I think this should work for all SSL bundles (not tested yet) since using an expired cert can cause issues in every place they are used. I can go ahead and work on the TODO items/docs/tests, in the meantime, can I get some feedback on two important items?
|
I think this is fine. However, I'm not sure we need to use That class adapts the discrete We could just focus the |
👍🏼 That's the exact same use-case I'm using
That would simplify the changes in the PR a bit but also complicate the life of the users: simply enabling the feature might not do anything for them if they are not using bundles or it would work just half-way for them if they use bundles just not for the webserver. If it is not a big issue to use |
Along with In either case, I don't think it's necessary to make |
Treating the discrete web server SSL properties specially somewhat makes sense to me since that's what |
I removed support for |
1c6695d
to
2cabf11
Compare
We need to discuss if we want to have this warning status and if we do, to which http code to map it. |
My two cents about having a dedicated
Other than the feature introduced in this PR (the certificate will expire soon), I think there could be a few more use-cases where a |
2cabf11
to
6ae64f5
Compare
72df5fe
to
2a1bb3f
Compare
We discussed this today and a couple of things came up:
|
What do you mean by the custom status? Do mean what is in the PR right now ( You can see all of the certs on the info endpoint, do you also want the health endpoint to show all of them under a ~valid/not-valid key? |
Sorry, I quickly wrote that comment in the meeting and it was obviously too terse.
We're not keen on an indicator-specific status such as In the meantime, I think
We'd like it to show something as additional details (so they'll only appear when details are visible) but we're not yet 100% sure exactly what it should be. Moritz is going to take a look at this too. |
Great to hear! Btw since this is targeted to a milestone release would it make sense to use @mhalbritter fyi: I modified the health indicator a bit so that now it returns the whole chain instead of the separate certs since if a cert is invalid in a chain, the whole chain is invalid. I think this also helps troubleshooting if there is an invalid cert (I updated the examples in the description). |
...moke-test-tomcat-ssl/src/test/java/smoketest/tomcat/ssl/SampleTomcatSslApplicationTests.java
Outdated
Show resolved
Hide resolved
I'd remove the warning bit completely for M2. Then we can take our time and come up with a |
86cedc6
to
fbe0c5d
Compare
Makes sense, I changed it to |
Thanks @jonatan-ivanov ! The health endpoint now always adds details about invalid and valid chains. |
Production incidents because of invalid certificates are common issues in the industry.
SslInfoContributor
andSslHealthIndicator
in this PR can help to mitigate them, they:issuer
,subject
,validity
, etc.)Example
/info
and/health
outputs:/info
of aVALID
cert (click here to expand)/health
of aVALID
cert (click here to expand)/info
of anEXPIRED
cert (click here to expand)/health
of anEXPIRED
cert (click here to expand)/info
of a cert thatWILL_EXPIRE_SOON
(click here to expand)/health
of a cert thatWILL_EXPIRE_SOON
(click here to expand)If you want to play with it, start
spring-boot-smoke-test-tomcat-ssl
, the cert inresources/sample.jks
is alreadyEXPIRED
, you can generate aVALID
one viaor one that
WILL_EXPIRE_SOON
via: