wazauh离线部署

官网 https://wazuh.com/

  • 如果服务器可以联网,直接参照官网文档部署即可。

  • 为方便安装,选择手动下载rpm包进行安装
wazuh相关下载地址:https://documentation.wazuh.com/3.12/installation-guide/packages-list/index.html#linux
ES下载相关地址:https://www.elastic.co/cn/downloads/
  • 内网无法使用网络源,因此选择先将rpm包在可以联网的机器下载下来,再上传到内网服务器安装,可以使用yumdownloader命令。
yum install yum-utils
语法:yumdownloader  rpmname  --resolve --destdir=/path  ##resolve   下载依赖包

一、安装Wazuh

  1. 安装Wazuh-manager

    rpm -ivh wazuh-manager-3.12.3-1.x86_64.rpm 
    systemctl status wazuh-manager #安装完成会自动启动
  2. 安装Wazuh-API

    #安装Wazuh-API需要nodejs> = 4.6.1,因此首先安装nodejs
    rpm -ivh nodejs-10.21.0-1nodesource.x86_64.rpm 
    rpm -ivh wazuh-api-3.12.3-1.x86_64.rpm 
    systemctl status wazuh-api.service #安装完成会自动启动
  3. 安装filebeat

    #Filebeat是Wazuh服务器上的工具,可将警报和存档事件安全地转发到Elasticsearch。
    rpm -ivh filebeat-7.7.1-x86_64.rpm 
    
    #由于内网环境不方便下载官方提供的配置文件,因此选择一台可以连网的机器手动下载后将文件上传至内网服务器对应的目录中并授权。
    #下载Filebeat配置文件,用于将Wazuh警报转发到Elasticsearch。
    curl -so /etc/filebeat/filebeat.yml https://raw.githubusercontent.com/wazuh/wazuh/v3.12.3/extensions/filebeat/7.x/filebeat.yml  #官方下载命令
    
    cp  filebeat.yml  /etc/filebeat/ #拷贝下载的配置文件至filebeat
    chmod go+r /etc/filebeat/filebeat.yml #授权
    
    #下载Elasticsearch的警报模板
    curl -so /etc/filebeat/wazuh-template.json https://raw.githubusercontent.com/wazuh/wazuh/v3.12.3/extensions/elasticsearch/7.x/wazuh-template.json  #官方下载命令
    
    cp wazuh-template.json /etc/filebeat/  ##拷贝下载的警报模板至filebeat
    chmod go+r /etc/filebeat/wazuh-template.json  #授权
    
    #下载适用于Filebeat的Wazuh模块
    curl -s https://packages.wazuh.com/3.x/filebeat/wazuh-filebeat-0.1.tar.gz | sudo tar -xvz -C /usr/share/filebeat/module
    
    tar  -xvf wazuh-filebeat-0.1.tar.gz  -C /usr/share/filebeat/module/
    
    #修改配置文件
    vim /etc/filebeat/filebeat.yml
    output.elasticsearch.hosts: ['http://YOUR_ELASTIC_SERVER_IP:9200']  #写入es的地址
    
    #启动
    systemctl daemon-reload
    systemctl enable filebeat.service
    systemctl start filebeat.service

二、安装Elasticsearch

  1. 安装jdk

    rpm -ivh jdk-8u181-linux-x64.rpm 
    #可以选择分布式,也可以选择单点,因为是实验环境,所以将Elasticsearch与Wazuh服务器装在同一台服务器。
  2. 安装es

    rpm -ivh elasticsearch-7.7.1-x86_64.rpm
    #修改es配置文件
    vim  /etc/elasticsearch/elasticsearch.yml
    network.host: 127.0.0.1   #由于单机部署,因此写127.0.0.1
    node.name: node-1   #使用默认
    cluster.initial_master_nodes: ["node-1"]  
    
    #启动
    systemctl daemon-reload
    systemctl enable elasticsearch.service
    systemctl start elasticsearch.service
    
    #加载Filebeat模板,在安装filebeat的位置运行此命令
    filebeat setup --index-management -E setup.template.json.enabled=false
    
    #简单检查
    curl http://127.0.0.1:9200

三、安装Kibana

  1. 安装

    rpm -ivh kibana-7.7.1-x86_64.rpm
  2. 安装wazuh插件

    cd /usr/share/kibana/
    cp /root/wazuhapp-3.12.3_7.7.1.zip  /usr/share/kibana/  #也可以放到/tpm
    sudo -u kibana bin/kibana-plugin install  file:///usr/share/kibana/wazuhapp-3.12.3_7.7.1.zip
  3. 修改配置文件

    vim /etc/kibana/kibana.yml
    server.host: "0.0.0.0"
    elasticsearch.hosts: ["http://127.0.0.1:9200"]
    
    #对于Kibana 7.6.X以上的版本,增加kibana的堆大小确保插件正常安装
    cat >> /etc/default/kibana << EOF
    NODE_OPTIONS="--max_old_space_size=2048"
    EOF
    
    #登录
    http://192.168.113.107:5601/

四、安装agent

  • 自动注册

    #自动注册,将agent的包上传到服务器,然后使用此命令安装即可。
    WAZUH_MANAGER='192.168.113.107'  yum install wazuh-agent-3.12.3-1.x86_64.rpm
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值