草庐IT

wazuh服务端安装

xinga 2023-03-28 原文

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界面点击重新检测

有关wazuh服务端安装的更多相关文章

  1. ruby - 使用 ruby​​ 和 savon 的 SOAP 服务 - 2

    我正在尝试使用ruby​​和Savon来使用网络服务。测试服务为http://www.webservicex.net/WS/WSDetails.aspx?WSID=9&CATID=2require'rubygems'require'savon'client=Savon::Client.new"http://www.webservicex.net/stockquote.asmx?WSDL"client.get_quotedo|soap|soap.body={:symbol=>"AAPL"}end返回SOAP异常。检查soap信封,在我看来soap请求没有正确的命名空间。任何人都可以建议我

  2. ruby - 具有身份验证的私有(private) Ruby Gem 服务器 - 2

    我想安装一个带有一些身份验证的私有(private)Rubygem服务器。我希望能够使用公共(public)Ubuntu服务器托管内部gem。我读到了http://docs.rubygems.org/read/chapter/18.但是那个没有身份验证-如我所见。然后我读到了https://github.com/cwninja/geminabox.但是当我使用基本身份验证(他们在他们的Wiki中有)时,它会提示从我的服务器获取源。所以。如何制作带有身份验证的私有(private)Rubygem服务器?这是不可能的吗?谢谢。编辑:Geminabox问题。我尝试“捆绑”以安装新的gem..

  3. ruby - 在 64 位 Snow Leopard 上使用 rvm、postgres 9.0、ruby 1.9.2-p136 安装 pg gem 时出现问题 - 2

    我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po

  4. ruby - 完全离线安装RVM - 2

    我打算为ruby​​脚本创建一个安装程序,但我希望能够确保机器安装了RVM。有没有一种方法可以完全离线安装RVM并且不引人注目(通过不引人注目,就像创建一个可以做所有事情的脚本而不是要求用户向他们的bash_profile或bashrc添加一些东西)我不是要脚本本身,只是一个关于如何走这条路的快速指针(如果可能的话)。我们还研究了这个很有帮助的问题:RVM-isthereawayforsimpleofflineinstall?但有点误导,因为答案只向我们展示了如何离线在RVM中安装ruby。我们需要能够离线安装RVM本身,并查看脚本https://raw.github.com/wayn

  5. ruby-on-rails - rails 目前在重启后没有安装 - 2

    我有一个奇怪的问题:我在rvm上安装了ruby​​onrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(

  6. ruby - 如何为 emacs 安装 ruby​​-mode - 2

    我刚刚为fedora安装了emacs。我想用emacs编写ruby。为ruby​​提供代码提示、代码完成类型功能所需的工具、扩展是什么? 最佳答案 ruby-mode已经包含在Emacs23之后的版本中。不过,它也可以通过ELPA获得。您可能感兴趣的其他一些事情是集成RVM、feature-mode(Cucumber)、rspec-mode、ruby-electric、inf-ruby、rinari(用于Rails)等。这是我当前用于Ruby开发的Emacs配置:https://github.com/citizen428/emacs

  7. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  8. ruby - 通过 RVM (OSX Mountain Lion) 安装 Ruby 2.0.0-p247 时遇到问题 - 2

    我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search

  9. ruby - 如何在 Lion 上安装 Xcode 4.6,需要用 RVM 升级 ruby - 2

    我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121

  10. ruby - Fast-stemmer 安装问题 - 2

    由于fast-stemmer的问题,我很难安装我想要的任何ruby​​gem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=

随机推荐