首页 > 其他分享 >wazuh服务端安装

wazuh服务端安装

时间:2022-09-25 16:22:38浏览次数:94  
标签:wazuh Wazuh dashboard install -- 安装 服务端

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就可以,格式如下

image

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.

image

登录web界面进入主页

image

错误处理

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而不是服务器地址
image

解决方法:

修改配置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

image

4 登录检查出现此错误ERROR: No template found for the selected index-pattern title [wazuh-alerts-*]

image

ERROR: No template found for the selected index-pattern title [wazuh-alerts-*]

解决方法:

错误提示是显示的是索引的模板没找到,看/etc/filebeat目录有没有对应json文件,可以filebeat -e测试是否可以正常向服务端传日志

使用filbeat -e查看发现有错误提示data path被锁

image

到 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

image

使用此命令刷新模板

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

image

在web界面点击重新检测

标签:wazuh,Wazuh,dashboard,install,--,安装,服务端
From: https://www.cnblogs.com/xinga/p/16728066.html

相关文章

  • Scoop修改安装目录
    参考资料:https://github.com/ScoopInstaller/scoop/issues/249下面的内容差不多就是上面回答里的翻译而已,感觉以后没准会有需要用到的地方可以使用$env:SCOOP环境变量......
  • Centos7上安装ElasticSearch
    我这里选择的版本是Elasticsearch7.17.6,下载链接为Elasticsearch7.17.6|Elastic下载完毕后解压到想要安装的文件夹,我这里是/data/elasticsearch-7.17.6由于我......
  • Python 虚拟环境安装与配置
    1、虚拟环境创建pipinstallvirtualenv-ihttps://pypi.tuna.tsinghua.edu.cn/simplepipinstallvirtualenvwrapper-win创建虚拟环境使用命令 mkvirtualenv[viruta......
  • 五、pycharm的安装与基本使用
    目录一、pycharm的安装1、软件介绍2、正版安装1.下载软件2.安装软件3、其他方法安装(需要先下载相关资源)①无限试用法②傻瓜式激活法③淘宝购买二、pycharm软件的使用1.创建......
  • 如何在 Apple Silicon 上安装 Kubeflow Pipelines v2
    如何在AppleSilicon上安装KubeflowPipelinesv2KubeflowPipelines(KFP)是一个强大的平台,用于使用Kubernetes大规模构建机器学习管道.该平台在GCP等主要云平台......
  • 安装及管理程序
    1.rpm命令的格式1.1查询选项功能效果rpm-qa(all)显示当前系统中以RPM方式安装的所有软件列表rpm-q软件名查询指定软件是否已安装rpm-qi软件名查......
  • 【SLAM学习:环境配置2】记录:双系统(Win11+Ubuntu22.04)安装、卸载及配置
    双系统安装:设备:拯救者Y9000X2022,i5-12500H,24G,1T+512GB,RTX3060,BIOS模式为UEFI工具:8G的U盘,rufus工具,Ubuntu22.04LTS镜像文件 Windows11系统下:1、开机进入BIOS,关......
  • 当API服务端options.Authority ="http://localhost:5001" 报错误
      //验证传入的令牌以确保它来自受信任的颁发者//验证令牌是否可以与此api一起使用(又名受众)//将身份验证服务添加到DI(依赖注入)并将身份验证中间件添加到管道bu......
  • Python安装PIL报错:No module named 'PIL'的解决方法
    在Python中,如果import了PIL,但是本机上并没有安装相应的组件,在运行py程序时会报错:ModuleNotFoundError:Nomodulenamed'PIL'。D:\Python\PY>MYPYAPP.pyTraceback(mos......
  • Python安装win32gui报错:No module named 'win32gui'的解决方法
    在Python中,如果import了win32gui,但是本机上并没有安装响应的组件,在运行py程序时会报错:ModuleNotFoundError:Nomodulenamed'win32gui'。D:\Python\PY>MYPYAPP.pyTrac......