Hi,
I tried to deploy Opensearch 1.2.4 with Opensearch Security Plugin 1.2.4.0 with TLS enabled for transport and TLS disabled for http.
Once started, when I tried to hit localhost:9200, it says “Authentication finally failed”.
@Anthony ,
I’m building docker image with OpenSUSE as BaseOS.
And using Opensearch.tar.gz inside the docker image to run the opensearch.
For every testing I’m running/deploying the docker image as new deployment.
@manoj I would recommend to connect to the container running opensearch and use securityadmin.sh script to extract current config using --retrieve option (using admin certificates) and examine the config.yaml, roles and roles_mapping files. In case the config is not updated as expected.
@Anthony ,
Using admin certificates in securityadmin.sh is throwing “certificate path exception”.
02:03:56.597 [opensearch[_client_][transport_worker][T#1]] ERROR org.opensearch.security.ssl.transport.SecuritySSLNettyTransport - Exception during establishing a SSL connection: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
But I’m using the same cert, key pair for connecting 9200 when rest TLS is enabled.
There it’s working fine.
And the CN of the certificate is also mentioned as admin_dn in opensearch.yml
@manoj How many nodes do you have running? Are they all master and data or is there a separation.
Is the opensearch.yaml config the same on all of them?
This might indeed be a certificate issue if the cluster is not forming properly, do you see any errors in the logs during cluster formation?
To get this working the quickest, I would recommend to follow this to create certificates, get a cluster up and running using these certificates and switching on the basic_auth.
Once this is working as expected, you can enable the anonymous mode and switch off the basic_auth.
Otherwise there might be too many parts causing issues to debug this properly.
@Anthony ,
We have 2 data nodes, 3 master nodes, 2 ingest nodes (1 with rest TLS enabled, 1 with rest TLS disabled) in kubernetes environment.
Here, ingest node with rest TLS enabled is working fine (we can able to do curl -u admin:admin https://localhost:9200 and curl <pass admin/client certificate as options> https://localhost:9200).
We’re trying to achieve curl localhost:9200 in ingest node with rest TLS disabled.
We created both transport and client (or admin) certificates with CN as localhost.
Will this cause any issue ?
Or do we have command to verify the certificates ?
Sometimes, this (curl localhost:9200) is working fine in rest TLS disabled ingest pod.
@manoj
I would suggest to follow the previous example. Create certificates as per the docs, leave the TLS on http off (plugins.security.ssl.http.enabled: false) and have the correct (different) certs for nodes and admin (this is a definite issue regardless).
Once everything works using basic_auth, switch it off and switch on anonymous.