Expired certificate in CA bundle makes api/health/checks/certificate-expiration return a failure even if the CA is not used by server certificate #12899
-
Describe the bugI have a RabbitMQ 4.0.4 server running on Ubuntu 22 LTS. It is set to use the CA Bundle in /etc/ssl/certs/ca-certificartes.crt for TLS. One of the certificates - Security_Communication_Root_CA.pem - expired (notAfter=Sep 30 04:20:49 2023 GMT). When invoking api/health/checks/certificate-expiration, the result was: {
"status": "failed",
"reason": "Certificates expiring",
"expired": [
{
"node": "rabbit@myservice",
"port": 5671,
"protocol": "amqp/ssl",
"interface": "::",
"cacertfile": "/etc/ssl/certs/ca-certificates.crt",
"certfile": "/etc/ssl/certs/myservice.domain.internal.pem",
"cacertfile_expires_on": [
"2023-09-30 4:20:49"
],
"certfile_expires_on": [
]
}
]
} But myservice.domain.internal.pem was generated by a different CA which is still valid. It looks any certificate in the CA bundle is tested, not only the CA which generated the actual certificate used by the RabbitMQ server. That makes monitoring application report a certificate is expired even when it is not. After Removing the expired CA the correct result was returned. Reproduction steps
Expected behaviorstatus: "ok" Additional contextUbuntu 22 LTS fully updated to date. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
@kmorwath you haven't provided any evidence of a bug. Our community support policy very clearly states that we will not troubleshoot TLS for non-paying users. We have no details on how to reproduce this behavior in any case. |
Beta Was this translation helpful? Give feedback.
-
I have re-opened this discussion and have deleted comments that are not helpful. @kmorwath - at the very least you could provide a CA bundle that exhibits this behavior. Yes, I could spend time doing that but it's time I could be using to investigate this behavior. Currently, the expiration check looks at all certs in the CA bundle and if any are expired, returns failure. To improve on that, we would have to determine which cert or certs are actually being used by RabpitMQ, which may not be worth the effort. Nearly every RabbitMQ user uses a CA "bundle" consisting of one root cert, usually that of their own cert infrastructure. Thanks. |
Beta Was this translation helpful? Give feedback.
-
@kmorwath I am looking forward to a detailed algorithm with tests, ideally with an implementation, in a PR or a discussion under Ideas. Or simply stop using that optional health check if it does not work for you and move on. We do not consider this catastrophic bug that affects one person to be worth our small team's time. |
Beta Was this translation helpful? Give feedback.
-
InvestigationAfter looking at a number of popular data services and HTTP servers, I conclude that they often There may be exceptions but the norm is to tell the user to figure certificate validation out In addition, a very typical feature in the industry is to ask the user to provide a bundle full Therefore, @kmorwath's environment is not a typical case, and the claim that Section 6 of RFC 5280 does Verifying such relation between every pair of certificates to find out expired certificates
and so on. So what RabbitMQ's health check does seems to be a very standard thing to do Documentation UpdatesAs of #13037 (which will ship in
In [1] we now explicitly recommend not using this health check in environments where either A. An expired certificate in one of the bundles is a normal operating condition An Alternative SolutionAn alternative health check can be implemented as a very small command line tool a. Load all relevant certificate bundles (how to determine which files are relevant outside of RabbitMQ is left to the reader to figure out) This tool can be built using any programming language that has a PKI/x509 library, which is anything I consider this case to be closed. If someone wants to provide an example of an alternative |
Beta Was this translation helpful? Give feedback.
Investigation
After looking at a number of popular data services and HTTP servers, I conclude that they often
do not provide a similar health check, or its behavior is limited to process startup and a logged warning, and usually the documentation is limited to a mention of the warning.
There may be exceptions but the norm is to tell the user to figure certificate validation out
however they like, including a verification of expiration.
In addition, a very typical feature in the industry is to ask the user to provide a bundle full
of relevant certificates and use them plus a number of trusted roots that come from an OS-specific source. There is no other commonly used mechanism for determin…