Conversation
|
Turning into draft until feature/fix/patch has been documented. |
502aeed to
279d590
Compare
|
Validation steps:
Done! |
|
It works! The only minor thing I'd add is in NOTES.txt - when a user has If I was better at Go, I'd go ahead and do this for you, I'm sorry 😢 |
Patched! Please re-validate when convenient.
No worries -- reviewing that the code works is more important than the actual code 💪 |
williamtrelawny
left a comment
There was a problem hiding this comment.
LGTM! 🚀 Awesome work @monrax !!
|
I already resolved the merge conflict but it's still telling me there's another conflict, so I'm going to leave it to you @monrax to resolve, sorry... Hope I didn't mess anything up when resolving the first conflict. |
This closes #34
This PR attempts to address the following issue:
GRAYLOG_HTTP_TLS_CERT_FILEis presented to both clients outside the cluster for external access, as well as internal clients for traffic between nodes. This means a cert with only aCNfield that does not match any of the node names will prevent inter-node secure communication."None of the TrustManagers trust this certificate chain"pops up when using a self-signed cert.The fix:
CNfield, and aSANfield with at least two entries: the CN again, but also the internal node names as a wild card like so:DNS:*.graylog-svc.graylog.svc.cluster.local(adjusted to the current service name and namespace)Implementation details:
values.yaml: addedupdateKeyStore(which defaults totrue) andkeyStorePass(which defaults to Java's own default"changeit") tograylog.config.tls.byocto control when to enable updating the Java Key Store._helpers.tpl: the full Java options passed to the containers will also include"-Djavax.net.ssl.trustStore=/usr/share/graylog/data/cacerts/graylog.jks"(as well as the corresponding password option) whenever bothgraylog.config.tls.byoc.enabledandgraylog.config.tls.byoc.updateKeyStoreare set totrue.init-script.sh: this is the main bit. In here we perform one check to see if the wildcard *.graylog-svc.graylog.svc.cluster.localis present as aSANin the cert mounted using the provided TLS k8s secret whengraylog.config.tls.byoc.enabledistrue. If this is not the case the Graylog application pods won't start up until a valid certificate is provided (valid meaning the cert has the wildcard SAN field). Secondly, ifgraylog.config.tls.byoc.updateKeyStoreis alsotruethe certificate (and any root CA in it) will be added to the Java Key Store automatically.The part I'm less comfortable with is the one where the application doesn't start up if a cert is given without the
DNS:*.graylog-svc.graylog.svc.cluster.localSAN (which are going to be most certificates out there), even if the init container logs tell the user what's going on. I would rather have Graylog use two certs: one for inter-node communication (which we would generate internally automatically) and leave GRAYLOG_HTTP_TLS_CERT_FILE for external access, or something similar (perhaps, even allow an option to skip hostname verification altogether?). However, that would require internal changes to the application, and not an option right now.Notes for Reviewers