-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[bitnami/keycloak] Add custom certs to system truststore #27197
Conversation
…tps-communication with hosts with certificates generated by custom ca's. Signed-off-by: Moritz Wiechers <moritz.wiechers@gmail.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Signed-off-by: Miguel Ruiz <miruiz@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @moritzwiechers,
Thank you for your contribution! Since this is a new feature, could you please bump a minor version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please update the value description? I left a suggestion below:
bitnami/keycloak/values.yaml
Outdated
@@ -138,6 +138,11 @@ auth: | |||
## @param auth.annotations Additional custom annotations for Keycloak auth secret object | |||
## | |||
annotations: {} | |||
## Custom Certificates | |||
## @param customCaExistingSecret define a secret for merging certificates to the system trustore like custom ca-certs (pem, pkcs12) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## @param customCaExistingSecret define a secret for merging certificates to the system trustore like custom ca-certs (pem, pkcs12) | |
## @param customCaExistingSecret Name of the secret containing the Keycloak custom CA certificates. The secret will be mounted as a directory and configured using KC_TRUSTSTORE_PATHS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review.
Updated the value description. Put it in one commit with readme update version bump
…ription Signed-off-by: Moritz Wiechers <moritz.wiechers@gmail.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
@migruiz4 Is there anything you need from me to advance with your review? |
Signed-off-by: Miguel Ruiz <miruiz@vmware.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
thats basically what were currently trying to do, does it work for you this way? It still seems ldaps ignores our certificates. |
Hey, |
* [bitnami/keycloak] Add custom certs to system truststore to enable https-communication with hosts with certificates generated by custom ca's. Signed-off-by: Moritz Wiechers <moritz.wiechers@gmail.com> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * [bitnami/keycloak] review-rework Changed chart version and param description Signed-off-by: Moritz Wiechers <moritz.wiechers@gmail.com> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> --------- Signed-off-by: Moritz Wiechers <moritz.wiechers@gmail.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Signed-off-by: Miguel Ruiz <miruiz@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Miguel Ruiz <miruiz@vmware.com>
Hi, please can someone share an example of the required configuration in the YAML file for adding a certificate which has been created as a secret named "keycloak-ldaps-cert"? I've added the below but still LDAPS is not able to connect - do I need to specify additional config in order for the certificate to be referenced by KeyCloak? customCaExistingSecret: keycloak-ldaps-cert cc: @moritzwiechers |
hey, is the right way. You need to create the secret before and it has to be in the same namespace, e.g.: kubectl --namespace create secret generic keycloak-ldaps-cert --from-file=<path/to/your/.keycloak-ldaps-cert.pem> Maybe you should check your keycloak log for any errors. When successfully loaded a message like this should appear on startup: keycloak 2024-08-15 13:09:47,763 INFO [org.keycloak.truststore.TruststoreBuilder] (main) Found the following truststore files under directories specified in the truststore paths [/opt/bitnami/keycloak/custom-ca/keycloak-ldaps-cert.pem, /opt/bitnami/keycloak/custom-ca/..data/keycloak-ldaps-cert.pem, /opt/bitnami/keycloak/custom-ca/..2024_08_15_13_08_42.3315499878/keycloak-ldaps-cert.pem |
Thanks for responding @moritzwiechers and will give it a try. Do you know if we need to specify any other parameters in the yaml file for KeyCloak to reference this certificate during LDAPS connection or is this the only config required? |
i couldn't get it to work with ldaps and simple certificates, so i ended up creating a java truststore and loaded it with extraEnvVars:
- name: JAVA_OPTS
value: "-Djavax.net.ssl.trustStore=/opt/keycloak/truststores/truststore.jks -Djavax.net.ssl.trustStorePassword=changeme"
extraVolumes:
- name: ca-secret
secret:
secretName: certificates-secret
defaultMode: 420
items:
- key: truststore.jks
path: truststore.jks
extraVolumeMounts:
- name: ca-secret
mountPath: /opt/keycloak/truststores
readOnly: true |
to enable https-communication with hosts with certificates generated by custom ca's.
Description of the change
Added the option to specify a secret which contains the custom ca certificates. They will be mounted to the container and loaded on keycloak startup by setting the environment variable KC_TRUSTSTORE_PATHS
Benefits
Applicable issues
Should resolve:
Checklist
Chart.yaml
according to semver. This is not necessary when the changes only affect README.md files.README.md
using readme-generator-for-helm