I am using RabbitMQ with TLS and have successfully configured it to use certificates signed by a trusted CA. The setup works correctly, and clients using certificates issued by this CA can connect to the RabbitMQ server. However, I have encountered a potential security issue.
ProblemI have two sets of certificates:
Currently, any client that provides a certificate signed by the trusted CA—regardless of its intended purpose—can connect to the RabbitMQ server. I don't have such issue when RabbitMQ is configured with self-signed certificates because self-signed CA is the issuer itself.
I am enabling both below options in RMQ SSL configuration:
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = true
How can I configure RabbitMQ to restrict client access to only certificates explicitly issued for this RabbitMQ instance ?
Thanks,
Nagaraju
Currently, any client that provides a certificate signed by the trusted CA—regardless of its intended purpose—can connect to the RabbitMQ server
How can I configure RabbitMQ to restrict client access to only certificates explicitly issued for this RabbitMQ instance
Hello Luke,
I sincerely appreciate the time and effort you took to address my questions. Your insights and suggestions were helpful and gave me clarity.
Thanks,
Nagaraju
Hello Luke,
Thank you again for your previous response — it was very helpful in framing the issue more clearly.
As a follow-up, I wanted to share that I tried introducing an intermediate CA specifically for signing RabbitMQ client certificates, as you suggested. However, RabbitMQ still accepts client certificates signed by any intermediate or directly by the root CA, not just the designated intermediate.
I went through the RabbitMQ and Erlang SSL documentation and double-checked the configuration. I'm already using the following:
I’m also using username and password authentication alongside client certificates.
From what I gather, RabbitMQ validates the certificate chain up to a trusted root CA, and as long as the chain is valid, it doesn't enforce restrictions on which intermediate CA was used, which is what I’d like to do.
I also looked into rabbitmq_auth_mechanism_ssl, but I am trying to solve this issue with intermediate CA.
The root of the problem is that when I use a trusted CA (e.g., a public or internal enterprise CA), the Root CA might have signed many certificates for different systems and purposes. Since RabbitMQ trusts any certificate that chains up to the trusted root, any certificate signed by that CA (or its intermediates) is accepted — even if it wasn't intended for RabbitMQ access.
This becomes a security concern, as RabbitMQ can't distinguish between certificates meant for it and others issued for different services within the organization.
How can I configure RabbitMQ to only accept client certificates signed by a specific intermediate CA, even if multiple intermediates chain to the same trusted root? Or rabbitmq_auth_mechanism_ssl is the only way forward for my usecase?
Thanks again for your help.
Best regards,
Nagaraju
From what I gather, RabbitMQ validates the certificate chain up to a trusted root CA, and as long as the chain is valid, it doesn't enforce restrictions on which intermediate CA was used, which is what I’d like to do.
I also looked into rabbitmq_auth_mechanism_ssl, but I am trying to solve this issue with intermediate CA.
The root of the problem is that when I use a trusted CA (e.g., a public or internal enterprise CA), the Root CA might have signed many certificates for different systems and purposes. Since RabbitMQ trusts any certificate that chains up to the trusted root, any certificate signed by that CA (or its intermediates) is accepted — even if it wasn't intended for RabbitMQ access.
I have tried with only the intermediate certificate, and as you guessed, it didn't work.
After doing some research on client certificate authentication in RabbitMQ, I came across this helpful article:
🔗 https://cjshelton.github.io/blog/2019/12/18/rabbitmq-client-certificate-authentication.html
Since I am aiming for client authentication, I am currently exploring the rabbitmq-auth-mechanism-ssl plugin to achieve this.