Full cert-manager support for listener keystore and client truststore #9452
Replies: 2 comments
-
|
Please find below the output of openssl when connecting to port 9093. |
Beta Was this translation helpful? Give feedback.
-
|
Re 1) A long time since I tried it, bu I think you should put the full chain into the Re 2) That is currently not possible. There is also no integration with cert-manager at this point (while it is on the roadmap, it does not have any expected timeline at this point). IIRC you do not need to provide the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys.
It might be, that I missed some other discussions or issues that tackled this issue already. In that case please just link it if you find it...
I am not quite experienced with Java, therefore I a not able to find the correct placed in the code to provide a PR to suggest a change.
Our requirement is to use an own CA for the external and internal listener.
Furthermore these listeners should be enabled with mTLS client authentication.
Implementing this requirements is failing because of two issues:
1. cert-manager TLS certificate chain with an own issuer
TL;DR: The missing
ca.crtin thetls.crtis causing the Kafka Broker to use a certificate in the keystore which is not having the full certificate chain... Therefore the client cannot validate the issuer properly and TLS handshake is failing.When using cert-manager with an own issuer you are getting a secret with 3 keys:
ca.crt,tls.crtandtls.key.When referencing this certificate in the
listenerviabrokerCertChainAndKeywith pointingcertificateandkeyto this keys, Strimzi is creating avolumeandvolumeMountlike this:The script
kafka_tls_prepare_certificates.shis then looping over thecertificatesfolder and if the folder starts with custom, its executing thecreate_keystore_without_ca_filefunction with the key and crt.https://github.com/strimzi/strimzi-kafka-operator/blob/main/docker-images/kafka-based/kafka/scripts/kafka_tls_prepare_certificates.sh#L38
Why can't we just mount "all" keys provided in the
brokerCertChainAndKey.secretNameand let the script identify if there is a "ca.crt" and execute thecreate_keystorefunction instead?2. clientsCa secret format incompatible to cert-manager
TL;DR: We want to use the same own issuer as clients CA to issue client certificates.
When setting
clientsCa.generateCertificateAuthoritytofalseStrimzi requires you to provide two very specific secrets which includeclients-ca-certwithca.keyandclients-cawithca.p12andca.crt.The volume creation and volumemount is ending up like this:
The files in that folder are then used in the script to create the client truststore.
https://github.com/strimzi/strimzi-kafka-operator/blob/main/docker-images/kafka-based/kafka/scripts/kafka_tls_prepare_certificates.sh#L66
Wouldn't it be possible to just reference a secret which will be used for this volume creation?
Please let me know your thoughts...
Kind regards
Sergei
Beta Was this translation helpful? Give feedback.
All reactions