我有一个旧的Elasticsearch集群,该集群不应该获得流量,但仍然可以。我有数百种可能会达到目标的服务。我正在寻找一种捕获请求来源的方法,以便可以了解请求的来源。我尝试启用REST请求跟踪器,但似乎没有做任何事情(https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html)。
有什么想法吗?

最佳答案

如果您启用了身份验证(或者可以启用身份验证,然后让请求失败),那么我将启用audit logging。这将记录审核事件,包括origin.address,应显示这些事件的来源。
示例(对本地主机的请求):

{
  "type": "audit",
  "timestamp": "2020-07-29T20:11:08,529+0200",
  "node.id": "sDCzapQcSgCTgaOnebA07w",
  "event.type": "rest",
  "event.action": "anonymous_access_denied",
  "origin.type": "rest",
  "origin.address": "127.0.0.1:58611",
  "url.path": "/",
  "request.method": "HEAD",
  "request.id": "4s_UWL35TfiI0nGZvNeomA"
}
尽管在Elastic Cloud上,您将必须联系支持人员才能为您提供这些日志。

关于elasticsearch - 在Elastic Cloud上跟踪请求来源,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/63161339/

10-17 03:03