【发布时间】:2021-10-05 11:06:15
【问题描述】:
我正在尝试使用 OpenSearch Dashboards API (Amazon Kibana fork) 添加搜索索引。我使用的是 1.0 版并且还设置了安全插件。我使用 TLS PKI 与 OpenSearch (Elasticsearch) 交互没有任何问题。但是,每当我尝试使用 TLS PKI 身份验证与 OpenSearch Dashboard API 交互时,都会收到错误消息。我能够在仪表板中设置 PKI 以向 OpenSearch 进行身份验证,而不会出现任何问题。下面是 shell 上使用 curl 的有效命令,但我希望在完成后使用 python:
curl -X POST --cert MYCERT.crt --key MYKEY.key --cacert MY-CA-BUNDLE.crt https://HOSTNAME:5601/api/saved_objects/index-pattern/test-index -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d' { "attributes": { "title": "test-index-*","timeFieldName": "@timestamp" } }'
我收到以下 JSON 消息错误:
{"statusCode":401,"error":"Unauthorized","message":"Authentication required"}
如果我改为使用带有“简单”用户名/密码的 API,同样的命令可以工作:
curl -X POST -u USERNAME:PASSWORD https://HOSTNAME:5601/api/saved_objects/index-pattern/test-index -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d' { "attributes": { "title": "test-index-*","timeFieldName": "@timestamp" } }'
但是,我似乎找不到让我的 ansible 使用 PKI 证书向 API 发出命令的方法,我希望这样做,以便我可以禁用简单的身份验证。有谁知道我缺少什么设置或者我是否滥用了 API?我研究了插件文档,但找不到任何我缺少的项目。
【问题讨论】:
标签: kibana opensearch opensearch-dashboards opensearch-security-plugin