Skip to content

Commit fb0bf04

Browse files
committed
fix: root ca not being properly split/detected
1 parent ee3076c commit fb0bf04

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ The inputs should now be exposed. Make sure to complete their configuration thro
240240
### Enable TLS
241241

242242
Before you can enable TLS, you must associate a DNS name with your Graylog installation.
243-
More specifically, it should point to the IP address/hostname associated the service used for [External Acess](#set-external-access).
243+
More specifically, your domain should point to the IP address/hostname associated the service used for [External Acess](#set-external-access).
244244
You may retrieve this information like this:
245245

246246
```sh
@@ -251,7 +251,7 @@ kubectl get svc $SERVICE_NAME -n graylog
251251
With `SERVICE_NAME` being equal to the name of the service exposed by your ingress controller, if you're using one, or
252252
`graylog-svc` otherwise.
253253

254-
Depending on your setup, TLS can be enabled in three different ways
254+
Depending on your setup, TLS can be enabled in three different ways:
255255

256256
#### Bring Your Own Certificate: Ingress Controller (recommended)
257257

@@ -331,6 +331,9 @@ Enable TLS for your Graylog nodes, referencing the Kubernetes secret:
331331
```sh
332332
helm upgrade graylog ./graylog -n graylog --reuse-values --set graylog.config.tls.enabled=true --set graylog.config.tls.secretName="my-cert" --set graylog.config.tls.updateKeyStore=true
333333
```
334+
The default set of trusted Certificate Authorities bundled in the Java Runtime for Java 17 is aligned with major,
335+
well-known public root CAs. Make sure to set `graylog.config.tls.updateKeyStore` to `true` if you are using a
336+
self-signed certificate, or if you think the CA that signed your certificate might not be among this default set.
334337

335338
### Enable Geolocation
336339
```sh

graylog/templates/config/init-graylog.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ data:
2424
{{- if .Values.graylog.config.tls.updateKeyStore}}
2525
# check if root CA is in cert file
2626
openssl crl2pkcs7 -nocrl -certfile "/mnt/tls/tls.crt" | openssl pkcs7 -print_certs -outform PEM | awk -v out="cert" '
27-
/-----BEGIN CERTIFICATE-----/ {n++; f=sprintf("%s-%03d.pem", out, n)}
28-
{print > f}
29-
/-----END CERTIFICATE-----/ {close(f)}
27+
/-----BEGIN CERTIFICATE-----/ {n++; f=sprintf("%s-%03d.pem", out, n); writing=1}
28+
writing {print > f}
29+
/-----END CERTIFICATE-----/ {close(f); writing=0}
3030
'
3131
ROOT_CA=""
3232
for f in cert-*.pem; do
33-
subj="$(openssl x509 -in "$f" -noout -subject -nameopt RFC2253 | sed "s/^subject= //")"
34-
issu="$(openssl x509 -in "$f" -noout -issuer -nameopt RFC2253 | sed "s/^issuer= //")"
33+
subj="$(openssl x509 -in "$f" -noout -subject -nameopt RFC2253 | sed "s/^subject=//")"
34+
issu="$(openssl x509 -in "$f" -noout -issuer -nameopt RFC2253 | sed "s/^issuer=//")"
3535
if [ "$subj" = "$issu" ]; then
3636
ROOT_CA="root-ca.pem"
3737
cp "$f" "${ROOT_CA}"
@@ -50,7 +50,7 @@ data:
5050
cp "${JAVA_HOME_LOCAL}/lib/security/cacerts" "${CACERTS_SRC}/graylog.jks"
5151
chown graylog:graylog "${CACERTS_SRC}/graylog.jks"
5252
keytool -importcert -noprompt -alias byoc -file "/mnt/tls/tls.crt" -keystore "${CACERTS_SRC}/graylog.jks" -storepass {{ .Values.graylog.config.tls.keyStorePass | default "changeit" }}
53-
[ -n "${ROOT_CA}" ] && keytool -importcert -noprompt -alias byoc-ca -file "${ROOT_CA}" -keystore "${CACERTS_SRC}/graylog.jks" -storepass {{ .Values.graylog.config.tls.keyStorePass | default "changeit" }}
53+
[ -n "${ROOT_CA}" ] && echo "Adding root CA..." && keytool -importcert -noprompt -alias byoc-ca -file "${ROOT_CA}" -keystore "${CACERTS_SRC}/graylog.jks" -storepass {{ .Values.graylog.config.tls.keyStorePass | default "changeit" }}
5454
if [ ! -e "${CACERTS_DST}/graylog.jks" ] || ! cmp -s "${CACERTS_SRC}/graylog.jks" "${CACERTS_DST}/graylog.jks"; then
5555
cp "${CACERTS_SRC}/graylog.jks" "${CACERTS_DST}/graylog.jks"
5656
echo "Updated Java Key Store."

0 commit comments

Comments
 (0)