Search Guard not initialized (SG11) searchguard 6.7.1

Hello? i try to configure search guard wit elastic search 6.7.1.
When i add my cert elasticsearch start but, I have an error Search Guard not initialized (SG11). Then i rm /etc/elasticsearch /usr/share/elasticsearch /var/lib/elasticsearch and reinstall elasticsearch. Then i Try to install demo_configuration and i have the same error Search Guard not initialized (SG11)
And I have one more question. How can i generete or create csr to admin cert< when i use wildcard cert and root-ca-cert from my company?

.elasticsearch.log (9.1 KB)
elasticsearch.yml (4.0 KB)
searchguard_demo.log (150.9 KB)

When posting in this category, please add:

If you are using Kibana, please also add:

  • Your kibana.yml configuration file

There seems to be an issue with your cluster state. From the logs I can see that Search Guard is trying to initialise, and when the SG index is created your cluster immediately goes into red cluster state:

[2019-05-13T14:17:11,627][INFO ][o.e.c.m.MetaDataCreateIndexService] [qw113ZZ] [searchguard] creating index, cause [api], templates [], shards [1]/[1], mappings []
[2019-05-13T14:17:11,658][INFO ][o.e.c.r.a.AllocationService] [qw113ZZ] updating number_of_replicas to [0] for indices [searchguard]
[2019-05-13T14:17:11,695][INFO ][o.e.c.r.a.AllocationService] [qw113ZZ] Cluster health status changed from [YELLOW] to [RED] (reason: [index [searchguard] created]).

What does your cluster topology looks like, means how many nodes, master nodes, data nodes etc. do you have?

Regarding the admin cert: This is just a regular TLS client certificate, signed by your companies root CA. The only difference is that you configure it in elasticsearch.yml to be an admin cert. No other requirements apply.

You can use any tool to generate the CSR, like OpenSSL or our own TLS Tool:

Thank you very much! This is a test server.Yesterday evening i add to sgadmin --accept-red-cluster and SG is initialised. Can you please give an example about generate admin cert.

An admin certificate is no different from other certificates. So if you already have generated CSRs for your cluster, you just need to generate another CSR for the admin cert and submit it to your PKI. Then you just need to configure it in elasticsearch.yml like:

  - CN=kirk,OU=client,O=client,L=test, C=de

Let me know if I did not understand your question correctly.

Thank you very much. it works. But i have a new problem. In local machine elk6.7.1. and SG6.7.1 works correctly. When i add my cert in a docker container I have this output:
[root@41b97860da99 tools]# bash --accept-red-cluster --enable-shard-allocation -key /usr/share/elasticsearch/config/admin1.key -cert /usr/share/elasticsearch/config/admin.pem -cacert /usr/share/elasticsearch/config/root-ca.pem -icl -nhnv -h linuxtest.**** -p 26300
Search Guard Admin v6
Will connect to linuxtest.******:26300 … done
ERR: An unexpected IllegalStateException occured: failed to load plugin class [com.floragunn.searchguard.SearchGuardPlugin]
java.lang.IllegalStateException: failed to load plugin class [com.floragunn.searchguard.SearchGuardPlugin]
at org.elasticsearch.plugins.PluginsService.loadPlugin(
at org.elasticsearch.plugins.PluginsService.(
at org.elasticsearch.client.transport.TransportClient.newPluginService(
at org.elasticsearch.client.transport.TransportClient.buildTemplate(
at org.elasticsearch.client.transport.TransportClient.(
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(
at java.base/java.lang.reflect.Constructor.newInstance(
at org.elasticsearch.plugins.PluginsService.loadPlugin(
… 7 more
Caused by: ElasticsearchSecurityException[Error while initializing transport SSL layer from PEM: failed to initialize the server-side SSL context]; nested: SSLException[failed to initialize the server-side SSL context]; nested: KeyStoreException[Key protection algorithm not found: Certificate chain is not valid]; nested: KeyStoreException[Certificate chain is not valid];
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore.initSSLConfig(
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore.(
at com.floragunn.searchguard.ssl.SearchGuardSSLPlugin.(
at com.floragunn.searchguard.SearchGuardPlugin.(
… 13 more
Caused by: failed to initialize the server-side SSL context
at io.netty.handler.ssl.JdkSslServerContext.newSSLContext(
at io.netty.handler.ssl.JdkSslServerContext.(
at io.netty.handler.ssl.SslContext.newServerContextInternal(
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore$
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore$
at java.base/
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore.buildSSLContext0(
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore.buildSSLServerContext(
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore.initSSLConfig(
… 16 more
Caused by: Key protection algorithm not found: Certificate chain is not valid
at java.base/
at java.base/
at java.base/
at java.base/
at io.netty.handler.ssl.SslContext.buildKeyStore(
at io.netty.handler.ssl.SslContext.buildKeyManagerFactory(
at io.netty.handler.ssl.SslContext.buildKeyManagerFactory(
at io.netty.handler.ssl.JdkSslServerContext.newSSLContext(
… 25 more
Caused by: Certificate chain is not valid
at java.base/
… 32 more

I don’t understand why my cert are invalid in docker container.

elasticsearch.yml (848 Bytes)

docker image is elasticsearch:6.7.1

Can you please share more details about your docker image and the Java version/vendor you are using.

Maybe the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files are not installed (or crypto.policy=unlimited is not set in java-security). That means that you can not use AES 256 or RSA with more than 2048 bit keysize. Without the “Dockerfile” it’s hard to say what’s wrong.

Or you simply did create your certs/keys with a Key protection algorithm (KPA) which is not available in JSSE. Did you create them with OpenSSL or another tool? Please provide mor details about your certs/keys and root/intermediate CA.

Dockerfile (605 Bytes)
This is my docker file. I use an official elasticsearch 6.7.1 image

I create my certs from pfx container with OpenSSLl. On physical machine this cert work correctly. When i add this cert in docker container i have errors

The problem is solved. I create docker image from official centos:latest image. Attach my Dockerfile. Dockerfile (857 Bytes)
Maybe it helps some one

Thanks for sharing the Dockerfile!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.