Wazuh自建索引

Wazuh自建索引

  1. 安全
  2. 5 days ago
  3. 2 min read

Wazuh默认有如下索引

  • wazuh‑alerts-*: 这是Wazuh Server生成的告警的索引。

  • wazuh‑archives-*: 这是发送到Wazuh Server所有事件的索引。

  • wazuh‑monitoring-*: 这是Wazuh Agent状态的索引。

  • wazuh‑statistics-*: 这是 Wazuh Server统计信息的索引。

  • wazuh-states-vulnerabilities-*: 这是agent扫描到的漏洞信息的索引。

为了进一步定制警报的索引,也可以创建自定义索引。

创建自定义索引

  1. 停止 Filebeat 服务
systemctl stop filebeat
  1. 下载 Wazuh 模板并将其保存到文件中
curl -so template.json https://raw.githubusercontent.com/wazuh/wazuh/v4.12.0/extensions/elasticsearch/7.x/wazuh-template.json
  1. 打开模板文件并在文件开头找到此行:
"index_patterns": [
  "wazuh-alerts-4.x-*",
  "wazuh-archives-4.x-*"
],

添加自定义索引内容

"index_patterns": [
  "wazuh-alerts-4.x-*",
  "wazuh-archives-4.x-*",
  "my-custom-alerts-*"
],
  1. 保存修改并将新模板插入 Wazuh 索引器。这将替换现有模板:
curl -XPUT -k -u <INDEXER_USERNAME>:<INDEXER_PASSWORD> 'https://<INDEXER_IP_ADDRESS>:9200/_template/wazuh' -H 'Content-Type: application/json' -d @template.json

这里的账号密码是wazuh的管理员账号密码

显示{“acknowledged”:true}表示正确插入。

  1. 重新启动 Filebeat 和 Wazuh 服务器组件:
systemctl restart filebeat
systemctl restart wazuh-manager
systemctl restart wazuh-indexer
systemctl restart wazuh-dashboard

检查索引信息

参考

博客: htttps://colin404.com

Wazuh官方文档: https://documentation.wazuh.com/current/user-manual/wazuh-indexer/wazuh-indexer-indices.html

Wazuh 安全 security SOC SIEM SOAR