用于测试没有任何角色的用户的Elasticsearch端点

lawou6xi  于 2023-02-18  发布在  ElasticSearch
关注(0)|答案(2)|浏览(124)

我刚刚在Elasticsearch中定义了用户(通过Kibana UI),并希望测试用户是否可以在Elastic中访问和授权。

从用户的Angular 来看,我可以使用哪个端点测试Elastic已知的用户?(无高权限管理API)

所有我尝试需要某种角色,请求看起来像:

curl --basic --user user:pass https://evil.com:9200/_cat/indices

UPDTE使用curl -v时,我看到401 / 403来区分密码是否正确,我希望某个端点返回200表示密码正确,返回401表示用户不正确或不存在...

js81xvg6

js81xvg61#

如果我没理解错的话,你只需要检查kibana是否只使用定义的用户名和密码打开。所以你可以点击

https://your_ip or kibana_ip_whichever_given:5601 
or 
http://your_ip or kibana_ip_whichever_given:5601

如果你已经使用xpack.security在它然后尝试https否则尝试它与http

rta7y2nd

rta7y2nd2#

您可以使用X-Pack API测试Elasticsearch群集是否知道用户,而无需高权限。该API在端点/_xpack/security/user/<username>上可用,如果知道用户,则返回200状态代码,如果不知道用户或用户未获得授权,则返回错误代码(例如401或403)。
了解更多... https://discuss.elastic.co/t/216937

相关问题