Before you post: Your responses to these questions will help the community help you. Please complete this template if you’re asking a support question. Don’t forget to select tags to help index your topic!
1. Describe your incident:
I am unable to integrate wazuh-indexer opensearch with Graylog
2. Describe your environment:
Wazuh AWS AMI - OpenSearch
Graylog latest version
Both on aws , two different Instances
OS Information:
Ubuntu
Package Version:
Latest Graylog 5.0
Service logs, configurations, and environment variables:
2023-01-11T11:01:24.511Z INFO [VersionProbe] Elasticsearch is not available. Retry #619
2023-01-11T11:01:29.518Z ERROR [VersionProbe] Unable to retrieve version from Elasticsearch node: Hostname 172.22.22.22 not verified:
certificate: sha256—keyyyyyyyyyyyyyyhere
DN: CN=wazuh-indexer, OU=Wazuh, O=Wazuh, L=California, C=US
subjectAltNames: [127.0.0.1]. - Hostname 172.22.22.22 not verified:
certificate: sha256—keyyyyyyyyyyyyyyhere
DN: CN=wazuh-indexer, OU=Wazuh, O=Wazuh, L=California, C=US
subjectAltNames: [127.0.0.1].
2023-01-11T11:01:29.519Z INFO [VersionProbe] Elasticsearch is not available. Retry #620
^C
3. What steps have you already taken to try and solve the problem?
Tried root-ca certificate of Wazuh-indexer and added it in trusted certs in graylog
You are using TLS but your certificate doesn’t have the hostname you are trying to connect to in the SAN, you must add 172.22.22.22 or the actual hostname into your SAN of the certificate and then connect to it correctly.
i have created certificate again , and added it , now getting this error:
nable to retrieve version from Elasticsearch node: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors. - Path does not chain with any of the trust anchors.
I have used this process ,
mkdir /etc/graylog/server/certs
cp -a /usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacerts /etc/graylog/server/certs/cacerts
keytool -importcert -keystore /etc/graylog/server/certs/cacerts -storepass changeit -alias root_ca -file /etc/graylog/server/certs/rootCA.crt
in here, rootCA.crt file is copied from wazuh-indexer.
Did you edit /ect/default/graylog-server to point the JVM to your custom truststore? See the bottom of Using HTTPS
In order for the JVM to pick up the new trust store, it has to be started with the JVM parameter -Djavax.net.ssl.trustStore=/path/to/cacerts.jks . If you’ve been using another password to encrypt the JVM trust store than the default changeit , you additionally have to set the JVM parameter -Djavax.net.ssl.trustStorePassword=secret .
The only thing I can think of, off the top of my head is checking that the root rootCA.crt file you imported is marked as trusted in the keystore and matches the same one that signed your new certificate, you could also just directly import the wazuh indexer certificate and see if that does anything. It’s hard to tell exactly what’s going wrong because the error is clear that the JVM can’t validate the certificate to a trusted authority but I’m not sure why.