Hi,
I’m trying to setup Dashboard → OpenSearch communication using client certificate instead of basic auth (I have few clusters were I’d like to replace ELK stack with OpenSearch and would prefer to use client cert auth instead of having to generate new dashboard and fluentbit users in each cluster).
For now I’m trying to make it work with the python script like that:
import requests
import json
base_url = 'https://localhost:9200/'
headers = {
'Content-Type': 'application/json'
}
cert_file_path = "..."
key_file_path = "..."
root_ca_path = "..."
# Send the request.
path = 'movies/_doc/3'
url = base_url + path
response = requests.get(url, cert = (cert_file_path, key_file_path), verify=False)
print(response.text)
(I’m using no-verify because I’m port-forwarding from my machine to a node in k8s cluster)
but all I’m getting is Unauthorized
and audit log not saying much more than:
[2022-05-06T13:14:30,774][INFO ][stdout ] [opensearch-cluster-master-0] AUDIT_LOG: {
[2022-05-06T13:14:30,774][INFO ][stdout ] [opensearch-cluster-master-0] "audit_cluster_name" : "opensearch-cluster",
[2022-05-06T13:14:30,774][INFO ][stdout ] [opensearch-cluster-master-0] "audit_rest_request_params" : {
[2022-05-06T13:14:30,775][INFO ][stdout ] [opensearch-cluster-master-0] "index" : "movies",
[2022-05-06T13:14:30,775][INFO ][stdout ] [opensearch-cluster-master-0] "id" : "3"
[2022-05-06T13:14:30,775][INFO ][stdout ] [opensearch-cluster-master-0] },
[2022-05-06T13:14:30,775][INFO ][stdout ] [opensearch-cluster-master-0] "audit_node_name" : "opensearch-cluster-master-0",
[2022-05-06T13:14:30,775][INFO ][stdout ] [opensearch-cluster-master-0] "audit_rest_request_method" : "GET",
[2022-05-06T13:14:30,775][INFO ][stdout ] [opensearch-cluster-master-0] "audit_category" : "FAILED_LOGIN",
[2022-05-06T13:14:30,777][INFO ][stdout ] [opensearch-cluster-master-0] "audit_request_origin" : "REST",
[2022-05-06T13:14:30,778][INFO ][stdout ] [opensearch-cluster-master-0] "audit_node_id" : "mBwCH71SSqKIyBkyyBK30Q",
[2022-05-06T13:14:30,778][INFO ][stdout ] [opensearch-cluster-master-0] "audit_request_layer" : "REST",
[2022-05-06T13:14:30,778][INFO ][stdout ] [opensearch-cluster-master-0] "audit_rest_request_path" : "/movies/_doc/3",
[2022-05-06T13:14:30,778][INFO ][stdout ] [opensearch-cluster-master-0] "@timestamp" : "2022-05-06T13:14:30.757+00:00",
[2022-05-06T13:14:30,778][INFO ][stdout ] [opensearch-cluster-master-0] "audit_request_effective_user_is_admin" : false,
[2022-05-06T13:14:30,778][INFO ][stdout ] [opensearch-cluster-master-0] "audit_format_version" : 4,
[2022-05-06T13:14:30,779][INFO ][stdout ] [opensearch-cluster-master-0] "audit_request_remote_address" : "127.0.0.1",
[2022-05-06T13:14:30,779][INFO ][stdout ] [opensearch-cluster-master-0] "audit_node_host_address" : "XXX",
[2022-05-06T13:14:30,779][INFO ][stdout ] [opensearch-cluster-master-0] "audit_rest_request_headers" : {
[2022-05-06T13:14:30,784][INFO ][stdout ] [opensearch-cluster-master-0] "content-length" : [
[2022-05-06T13:14:30,784][INFO ][stdout ] [opensearch-cluster-master-0] "0"
[2022-05-06T13:14:30,784][INFO ][stdout ] [opensearch-cluster-master-0] ],
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] "Accept" : [
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] "*/*"
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] ],
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] "User-Agent" : [
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] "python-requests/2.27.1"
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] ],
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] "Connection" : [
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] "keep-alive"
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] ],
[2022-05-06T13:14:30,785][INFO ][stdout ] [opensearch-cluster-master-0] "Host" : [
[2022-05-06T13:14:30,786][INFO ][stdout ] [opensearch-cluster-master-0] "localhost:9200"
[2022-05-06T13:14:30,786][INFO ][stdout ] [opensearch-cluster-master-0] ],
[2022-05-06T13:14:30,786][INFO ][stdout ] [opensearch-cluster-master-0] "Accept-Encoding" : [
[2022-05-06T13:14:30,786][INFO ][stdout ] [opensearch-cluster-master-0] "gzip, deflate"
[2022-05-06T13:14:30,786][INFO ][stdout ] [opensearch-cluster-master-0] ]
[2022-05-06T13:14:30,788][INFO ][stdout ] [opensearch-cluster-master-0] },
[2022-05-06T13:14:30,788][INFO ][stdout ] [opensearch-cluster-master-0] "audit_request_effective_user" : "<NONE>",
[2022-05-06T13:14:30,788][INFO ][stdout ] [opensearch-cluster-master-0] "audit_node_host_name" : "XXX"
[2022-05-06T13:14:30,788][INFO ][stdout ] [opensearch-cluster-master-0] }
Is there any way to get more details of failed logins than just this? I’m sure my configuration must bo broken somewhere but not sure how to find it