I have a running and working Graylog5 with docker. Now i will securing it with http. The graylog.conf is in a persistent directory so that i can modify them easylie.
Our PaloAlto can generate Certificates. We have create a .pem and a .crt file.
Please explane me: is it enough to put the files to the graylog system and modify the config - or is it neccessary to make the “java private store”-Steps in the article i find with google?
I using the Docker-Installation of Graylog5 with persistent Config-Files. In this directory i have put the key & cert File. The paths in the config is adaptet.
Must the Keytool execute in the host enviroment or in the docker subsystem?
Diesem Zertifikat vertrauen? [Nein]: Ja
Zertifikat wurde Keystore hinzugefügt
Then I adapt the http_enable_tls = true and try to restart
The container didn´t start again. Error in log is:
2023-04-13 04:43:27,113 INFO : org.graylog2.shared.initializers.ServiceManagerListener - Services are now stopped.
2023-04-13 04:43:27,117 ERROR: org.graylog2.bootstrap.ServerBootstrap - Graylog startup failed. Exiting. Exception was:
java.lang.IllegalStateException: Expected to be healthy after starting. The following services are not running: {FAILED=[JerseyService [FAILED]]}
at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.checkHealthy(ServiceManager.java:769) ~[graylog.jar:?]
at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.awaitHealthy(ServiceManager.java:581) ~[graylog.jar:?]
at com.google.common.util.concurrent.ServiceManager.awaitHealthy(ServiceManager.java:295) ~[graylog.jar:?]
at org.graylog2.bootstrap.ServerBootstrap.startCommand(ServerBootstrap.java:273) [graylog.jar:?]
at org.graylog2.bootstrap.CmdLineTool.doRun(CmdLineTool.java:324) [graylog.jar:?]
at org.graylog2.bootstrap.CmdLineTool.run(CmdLineTool.java:260) [graylog.jar:?]
at org.graylog2.bootstrap.Main.main(Main.java:45) [graylog.jar:?]
Suppressed: com.google.common.util.concurrent.ServiceManager$FailedService: JerseyService [FAILED]
Thanks for your reply - but i see you are not using https for docker. When i disable https then it works
Here the full error messag
2023-04-13 05:13:14,974 ERROR: org.graylog2.bootstrap.ServerBootstrap - Graylog startup failed. Exiting. Exception was:
java.lang.IllegalStateException: Expected to be healthy after starting. The following services are not running: {FAILED=[JerseyService [FAILED]]}
at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.checkHealthy(ServiceManager.java:769) ~[graylog.jar:?]
at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.awaitHealthy(ServiceManager.java:581) ~[graylog.jar:?]
at com.google.common.util.concurrent.ServiceManager.awaitHealthy(ServiceManager.java:295) ~[graylog.jar:?]
at org.graylog2.bootstrap.ServerBootstrap.startCommand(ServerBootstrap.java:273) [graylog.jar:?]
at org.graylog2.bootstrap.CmdLineTool.doRun(CmdLineTool.java:324) [graylog.jar:?]
at org.graylog2.bootstrap.CmdLineTool.run(CmdLineTool.java:260) [graylog.jar:?]
at org.graylog2.bootstrap.Main.main(Main.java:45) [graylog.jar:?]
Suppressed: com.google.common.util.concurrent.ServiceManager$FailedService: JerseyService [FAILED]
Caused by: java.security.GeneralSecurityException: org.bouncycastle.pkcs.PKCSException: unable to read encrypted data: Error finalising cipher
at org.graylog2.shared.security.tls.PemKeyStore.buildKeyStore(PemKeyStore.java:88) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.buildSslEngineConfigurator(JerseyService.java:360) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUpApi(JerseyService.java:178) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUp(JerseyService.java:159) ~[graylog.jar:?]
at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) ~[graylog.jar:?]
at com.google.common.util.concurrent.Callables$4.run(Callables.java:121) ~[graylog.jar:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
Caused by: org.bouncycastle.pkcs.PKCSException: unable to read encrypted data: Error finalising cipher
at org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo.decryptPrivateKeyInfo(Unknown Source) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.generateKeySpec(PemKeyStore.java:68) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.doBuildKeyStore(PemKeyStore.java:99) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.buildKeyStore(PemKeyStore.java:85) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.buildSslEngineConfigurator(JerseyService.java:360) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUpApi(JerseyService.java:178) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUp(JerseyService.java:159) ~[graylog.jar:?]
at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) ~[graylog.jar:?]
at com.google.common.util.concurrent.Callables$4.run(Callables.java:121) ~[graylog.jar:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
Caused by: org.bouncycastle.crypto.io.InvalidCipherTextIOException: Error finalising cipher
at org.bouncycastle.jcajce.io.CipherInputStream.finaliseCipher(Unknown Source) ~[graylog.jar:?]
at org.bouncycastle.jcajce.io.CipherInputStream.nextChunk(Unknown Source) ~[graylog.jar:?]
at org.bouncycastle.jcajce.io.CipherInputStream.read(Unknown Source) ~[graylog.jar:?]
at org.bouncycastle.util.io.Streams.pipeAll(Streams.java:114) ~[graylog.jar:?]
at org.bouncycastle.util.io.Streams.readAll(Streams.java:41) ~[graylog.jar:?]
at org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo.decryptPrivateKeyInfo(Unknown Source) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.generateKeySpec(PemKeyStore.java:68) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.doBuildKeyStore(PemKeyStore.java:99) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.buildKeyStore(PemKeyStore.java:85) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.buildSslEngineConfigurator(JerseyService.java:360) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUpApi(JerseyService.java:178) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUp(JerseyService.java:159) ~[graylog.jar:?]
at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) ~[graylog.jar:?]
at com.google.common.util.concurrent.Callables$4.run(Callables.java:121) ~[graylog.jar:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
Caused by: javax.crypto.BadPaddingException: pad block corrupted
at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher$BufferedGenericBlockCipher.doFinal(Unknown Source) ~[graylog.jar:?]
at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(Unknown Source) ~[graylog.jar:?]
at javax.crypto.Cipher.doFinal(Unknown Source) ~[?:?]
at org.bouncycastle.jcajce.io.CipherInputStream.finaliseCipher(Unknown Source) ~[graylog.jar:?]
at org.bouncycastle.jcajce.io.CipherInputStream.nextChunk(Unknown Source) ~[graylog.jar:?]
at org.bouncycastle.jcajce.io.CipherInputStream.read(Unknown Source) ~[graylog.jar:?]
at org.bouncycastle.util.io.Streams.pipeAll(Streams.java:114) ~[graylog.jar:?]
at org.bouncycastle.util.io.Streams.readAll(Streams.java:41) ~[graylog.jar:?]
at org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo.decryptPrivateKeyInfo(Unknown Source) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.generateKeySpec(PemKeyStore.java:68) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.doBuildKeyStore(PemKeyStore.java:99) ~[graylog.jar:?]
at org.graylog2.shared.security.tls.PemKeyStore.buildKeyStore(PemKeyStore.java:85) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.buildSslEngineConfigurator(JerseyService.java:360) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUpApi(JerseyService.java:178) ~[graylog.jar:?]
at org.graylog2.shared.initializers.JerseyService.startUp(JerseyService.java:159) ~[graylog.jar:?]
at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62) ~[graylog.jar:?]
at com.google.common.util.concurrent.Callables$4.run(Callables.java:121) ~[graylog.jar:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
I think something with the pem-File is wrong or missconfigured
Yeah something does look incorrect, either with the configurations for HTTP/TLS or the certs.
I have configured my Graylog Docker config file (i.e.graylog.conf) to have these settings configured.
http_publish_uri = https://graylog.domain.com:9000/
http_enable_tls = true
http_tls_key_password = secret
## I used the directory where i create the certs and chown graylog:graylog -R.
http_tls_key_file = /path/to/certs/graylog-key.pem
http_tls_cert_file = /path/to/certs/graylog-certificate.pem
You can also use the environment variables in your Docker-Compose file if you wish.