wazuh簡介
Wazuh 是一個免費、開源和企業級的安全監控解決方案,用于威脅檢測、完整性監控、事件回應和合規性,
官網地址:
https://wazuh.com/
對于wazuh與其他開源安全產品的能力比較可以閱讀下面這邊文章
https://www.freebuf.com/articles/endpoint/339347.html
本文主要介紹wazuh的安裝
前提
1.查看官方安裝檔案
官方提供兩種安裝檔案,一種是通過安裝助手(偏自動化安裝),一種是通過組件安裝(手動安裝每個組件),本安裝方法選擇第一種
https://documentation.wazuh.com/current/installation-guide/wazuh-indexer/index.html
部署前多看下官方檔案可以避免很多錯誤,出現錯誤看安裝日志,有些錯誤日志中有給出解決方法
2.服務端配置
部署測驗使用單節點,系統版本CentOS Linux release 7.5.1804 (Core),4核32G,安裝wazuh4.3(測驗時最新版本)
初始配置
3.下載腳本和組態檔
curl -sO https://packages.wazuh.com/4.3/wazuh-install.sh
curl -sO https://packages.wazuh.com/4.3/config.yml
4.編輯配置config.yml
./config.yml
nodes:
# Wazuh indexer nodes
indexer:
- name: node-1
ip: <indexer-node-ip>
# - name: node-2
# ip: <indexer-node-ip>
# - name: node-3
# ip: <indexer-node-ip>
# Wazuh server nodes
# Use node_type only with more than one Wazuh manager
server:
- name: wazuh-1
ip: <wazuh-manager-ip>
# node_type: master
# - name: wazuh-2
# ip: <wazuh-manager-ip>
# node_type: worker
# Wazuh dashboard node
dashboard:
- name: dashboard
ip: <dashboard-node-ip>
單節點配置,所以只需要填一個IP就可以,格式如下

5.使用選項運行助手--generate-config-files以生成安裝所需的 Wazuh 集群密鑰、證書和密碼,
bash wazuh-install.sh --generate-config-files
Wazuh indexer節點安裝
安裝和配置 Wazuh 索引器節點,
6.使用選項--wazuh-indexer和節點名稱運行助手以安裝和配置 Wazuh 索引器,節點名稱必須與config.yml初始配置中使用的相同,例如node-1.
確保將wazuh-install-files.tar在初始配置步驟中創建的副本放在您的作業目錄中,
# bash wazuh-install.sh --wazuh-indexer node-1
7.安裝 Wazuh 索引器集群程序的最后階段包括運行安全管理腳本,
--start-cluster在任何Wazuh 索引器節點上運行帶有選項的 Wazuh 安裝助手以加載新證書資訊并啟動集群,
# bash wazuh-install.sh --start-cluster
注:只需初始化一次集群,無需在每個節點上運行此命令,
安裝 Wazuh 服務器
8.--wazuh-server使用后跟節點名稱的選項運行助手以安裝 Wazuh 服務器,節點名稱必須與config.yml初始配置中使用的相同,例如wazuh-1.
# bash wazuh-install.sh --wazuh-server wazuh-1
安裝儀表盤
9.使用選項--wazuh-dashboard和節點名稱運行助手以安裝和配置 Wazuh 儀表板,節點名稱必須與config.yml初始配置中使用的相同,例如dashboard.
# bash wazuh-install.sh --wazuh-dashboard dashboard
助手完成安裝后,輸出會顯示訪問憑據和確認安裝成功的訊息,
INFO: --- Summary ---
INFO: You can access the web interface https://<wazuh-dashboard-ip>
User: admin
Password: <ADMIN_PASSWORD>
INFO: Installation finished.

登錄web界面進入主頁

錯誤處理
1.日志/var/log/wazuh-install.log中在安裝出現一下錯誤
failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate has expired."
解決方法:
查看服務器時間
時間不對,使用ntpdate同步時間或者date
2 安裝日志出現一下欄位
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=wazuh.skip_if_unavailable=true
failure: repodata/repomd.xml from wazuh: [Errno 256] No more mirrors to try.
解決方法:
執行以下命令
yum-config-manager --save --setopt=wazuh.skip_if_unavailable=true
yum-config-manager: command not found
這個是因為系統默認沒有安裝這個命令,這個命令在yum-utils 包里,可以通過命令yum -y install yum-utils 安裝就可以了,
3、部署完成web頁面無法訪問查看監聽埠是127.0.0.1而不是服務器地址

解決方法:
修改配置opensearch_dashboards.yml檔案中server.host的iP為服務器IP,然后重啟wazuh-manger
cd /etc/wazuh-dashboard/
[root@localhost wazuh-dashboard]# ls
certs node.options opensearch_dashboards.yml
[root@localhost wazuh-dashboard]# vi opensearch_dashboards.yml
[root@localhost wazuh-dashboard]systemctl restart wazuh-manager

4 登錄檢查出現此錯誤ERROR: No template found for the selected index-pattern title [wazuh-alerts-*]

ERROR: No template found for the selected index-pattern title [wazuh-alerts-*]
解決方法:
錯誤提示是顯示的是索引的模板沒找到,看/etc/filebeat目錄有沒有對應json檔案,可以filebeat -e測驗是否可以正常向服務端傳日志
使用filbeat -e查看發現有錯誤提示data path被鎖

到 data path(/var/lib/filebeat)看下檔案,發現有xx.lock檔案,刪掉此檔案,再次執行filebeat -e 發現提示沒有wazuh-template.json
下載wazuh-template.json檔案,放到/etc/filebeat目錄下
wazuh/wazuh-template.json at master · wazuh/wazuh (github.com)
cd /etc/filebeat

使用此命令重繪模板
curl -X PUT "https://localhost:9200/_template/wazuh" -H 'Content-Type: application/json' -d @wazuh-template.json --key certificates/elasticsearch-ca.pem -k -u kibanaserver:smbL3rB9UBZmGHHTc2h1nc?*3txQl888
賬號密碼獲取:執行此命令
tar -O -xvf wazuh-install-files.tar wazuh-install-files/wazuh-passwords.txt

在web界面點擊重新檢測
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/509518.html
標籤:其他
上一篇:解析度的理解
下一篇:安裝及管理程式6
