I am trying to retrieve current configuration with proper credentials. Am i missing here.
./sgadmin.sh -cacert /config/bdm/bdm-es-server/config/ca-bundle.cer -cn BDM-ES-DEV-HQ -p 10150 -cd /upapps/bdm/bdm-es-server/plugins/search-guard-6/sgconfig -cert /privdir/dbdm100/dbdm-admin.cer -key /privdir/dbdm100/dbdm-admin.key.pk8 -keypass /privdir/dbdm100/dbdmadmin.pass -r
Search Guard Admin v6
Will connect to localhost:10150 … done
01:20:20.597 [main] ERROR com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore - Your keystore or PEM does not contain a key. If you sepcified a key password try removing it. If you not sepcified a key password maybe you one because the key is password protected. Maybe you just confused keys and certificates.
ERR: An unexpected IllegalStateException occured: failed to load plugin class [com.floragunn.searchguard.SearchGuardPlugin]
Trace:
java.lang.IllegalStateException: failed to load plugin class [com.floragunn.searchguard.SearchGuardPlugin]
at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:452)
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:105)
at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:103)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:128)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:251)
at com.floragunn.searchguard.tools.SearchGuardAdmin$TransportClientImpl.(SearchGuardAdmin.java:823)
at com.floragunn.searchguard.tools.SearchGuardAdmin.main0(SearchGuardAdmin.java:403)
at com.floragunn.searchguard.tools.SearchGuardAdmin.main(SearchGuardAdmin.java:120)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:443)
… 7 more
Caused by: ElasticsearchSecurityException[Error while initializing transport SSL layer from PEM: java.lang.IllegalArgumentException: File does not contain valid private key: /privdir/dbdm100/dbdm-admin.key.pk8]; nested: IllegalArgumentException[File does not contain valid private key: /privdir/dbdm100/dbdm-admin.key.pk8]; nested: InvalidKeySpecException[Cannot retrieve the PKCS8EncodedKeySpec]; nested: BadPaddingException[Given final block not properly padded];
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore.initSSLConfig(DefaultSearchGuardKeyStore.java:292)
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore.(DefaultSearchGuardKeyStore.java:145)
at com.floragunn.searchguard.ssl.SearchGuardSSLPlugin.(SearchGuardSSLPlugin.java:192)
at com.floragunn.searchguard.SearchGuardPlugin.(SearchGuardPlugin.java:182)
… 12 more
Caused by: java.lang.IllegalArgumentException: File does not contain valid private key: /privdir/dbdm100/dbdm-admin.key.pk8
at io.netty.handler.ssl.SslContextBuilder.keyManager(SslContextBuilder.java:267)
at io.netty.handler.ssl.SslContextBuilder.forServer(SslContextBuilder.java:90)
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore.buildSSLServerContext(DefaultSearchGuardKeyStore.java:613)
at com.floragunn.searchguard.ssl.DefaultSearchGuardKeyStore.initSSLConfig(DefaultSearchGuardKeyStore.java:287)
… 15 more
Caused by: java.security.spec.InvalidKeySpecException: Cannot retrieve the PKCS8EncodedKeySpec
at javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(EncryptedPrivateKeyInfo.java:255)
at io.netty.handler.ssl.SslContext.generateKeySpec(SslContext.java:965)
at io.netty.handler.ssl.SslContext.getPrivateKeyFromByteBuffer(SslContext.java:1013)
at io.netty.handler.ssl.SslContext.toPrivateKey(SslContext.java:993)
at io.netty.handler.ssl.SslContextBuilder.keyManager(SslContextBuilder.java:265)
… 18 more
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:991)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:847)
at com.sun.crypto.provider.PBES1Core.doFinal(PBES1Core.java:416)
at com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(PBEWithMD5AndDESCipher.java:316)
at javax.crypto.Cipher.doFinal(Cipher.java:2165)
at javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(EncryptedPrivateKeyInfo.java:250)
···
On Tuesday, July 31, 2018 at 9:40:43 AM UTC-5, Jochen Kressin wrote:
So if you don’t see the license in the config files I assume someone used Kibana or the REST API to upload it. The license you attached is definitely valid and active.
You can also use sgadmin with the -r/–retrieve switch to download the currently active configuration from the cluster. This will include the license string in sg_config.yml
On Tuesday, July 31, 2018 at 3:32:21 PM UTC+2, Rudra wrote:
Yeah, Thanks.
I am trying to understand the current configuration and it will be renewed.
On Tuesday, July 31, 2018 at 4:28:55 AM UTC-5, Jochen Kressin wrote:
I do not fully understand. Your initial question was how to apply a Search Guard license which is described in the documentation link I posted. If you do not have a license yet you probably run Search Guard with the trial license. Or, someone has uploaded the license directly via the REST API or the Search Guard configuration GUI. In this case, the license will not show up in the sg_config.yml file of course.
What is the output of:
https://localhost:9200/_searchguard/license
On Tuesday, July 31, 2018 at 4:15:32 AM UTC+2, Rudra wrote:
Thank you for the response.
I could not find the existing license in my sgconf.yml file.
On Friday, July 27, 2018 at 4:56:46 PM UTC-5, Jochen Kressin wrote:
A renewed license can be applied just like the initial license. You can install it by using:
- sg_config.yml and uploading it with sgadmin
- using the REST API
- using the Kibana Config GUI
Please see this chapter in the docs:
https://docs.search-guard.com/latest/search-guard-enterprise-edition#applying-an-enterprise-or-compliance-license
On Friday, July 27, 2018 at 9:11:31 PM UTC+2, Rudra wrote:
What is the procedure to apply renewed licience.
On Friday, July 27, 2018 at 2:09:41 PM UTC-5, Rudra wrote:
When asking questions, please provide the following information:
- Search Guard and Elasticsearch version 6.0
- Installed and used enterprise modules, if any yes-ES 6.1 version
- JVM version and operating system version centos 6.8
- Search Guard configuration files
- Elasticsearch log messages on debug level
- Other installed Elasticsearch or Kibana plugins, if any yes-kibana