开源Wazuh安全平台容器化部署
一、Wazuh简介
Wazuh 是一个免费、开源和企业级的安全监控解决方案,用于威胁检测、完整性监控、事件响应和合规性。Wazuh由部署到受监视系统的端点安全代理和管理服务器组成,管理服务器收集和分析代理收集的数据。此外,Wazuh已与Elastic Stack完全集成,提供了搜索引擎和数据可视化工具,使用户可以浏览其安全警报。Wazuh提供的功能包括日志数据分析,入侵和恶意软件检测,文件完整性监视,配置评估,漏洞检测以及对法规遵从性的支持。
官网地址:https://documentation.wazuh.com/current/installation-guide/index.html
GitHub地址:https://github.com/wazuh/wazuh-docker
1.1 Wazuh平台的组件和体系结构
Wazuh平台主要包括三个主要组件,分别是Wazuh代理,Wazuh服务器和Elastic Stack。
(1)Wazuh代理:它安装在端点上,例如:服务器,云实例或虚拟机。它提供了预防,检测和响应功能。它确实支持Windows,Linux,macOS,HP-UX,Solaris和AIX平台。
(2)Wazuh服务器:它分析从代理收到的数据,通过解码器和规则对其进行处理,并使用威胁情报来查找众所周知的危害指标(IOC)。一台服务器可以分析来自成百上千个代理的数据,并在设置为集群时水平扩展。该服务器还用于管理代理,在必要时进行远程配置和升级。
(3)Elastic Stack:它索引和存储Wazuh服务器生成的警报。此外,Wazuh和Kibana之间的集成为数据的可视化和分析提供了强大的用户界面。该界面还可用于管理Wazuh配置并监视其状态。
1.2 架构图
【注】放大页面可以查看高清图片。
(1)整体架构图

官网地址:https://documentation.wazuh.com/current/getting-started/components/index.html
(2)Agent端组件架构

官网地址:https://documentation.wazuh.com/current/getting-started/components/wazuh_agent.html#wazuh-agent
(3)Server端架构

官网地址:https://documentation.wazuh.com/current/getting-started/components/wazuh_server.html#wazuh-server
二、Wazuh部署
官网容器化部署介绍:https://documentation.wazuh.com/current/docker/docker-installation.html
2.1 准备工作
(1)安装Docker compose工具
[root@10-27-0-224 ~]# curl -L "https://github.com/docker/compose/releases/download/1.28.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
(2)添加可执行权限
[root@10-27-0-224 ~]# chmod +x /usr/local/bin/docker-compose
(3)添加软连接
[root@10-27-0-224 ~]# ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
(4)内核参数调整
[root@10-27-0-224 ~]# sysctl -w vm.max_map_count=262144
2.2 演示部署
(1)克隆Wazuh容器仓库
[root@10-27-0-224 ~]# git clone https://github.com/wazuh/wazuh-docker.git -b v4.2.0 --depth=1
(2)启动容器
[root@10-27-0-224 ~]# cd wazuh-docker/ [root@10-27-0-224 wazuh-docker]# docker-compose up -d
(3)拓展内容(绑定自定义域名)
[root@10-27-0-224 wazuh-docker]# vim docker-compose.yml
……
kibana:
image: wazuh/wazuh-kibana-odfe:4.2.0
hostname: kibana
restart: always
ports:
- 5601:5601 # 修改默认443端口卫5601
environment:
- ELASTICSEARCH_USERNAME=admin
- ELASTICSEARCH_PASSWORD=admin
#- SERVER_SSL_ENABLED=true # 屏蔽
#- SERVER_SSL_CERTIFICATE=/usr/share/kibana/config/opendistroforelasticsearch.example.org.cert # 屏蔽
#- SERVER_SSL_KEY=/usr/share/kibana/config/opendistroforelasticsearch.example.org.key # 屏蔽
……
# nginx代理转发配置
[root@10-27-0-224 ~]# vim /etc/nginx/conf.d/wazuh.starcto.com.conf
server {
listen 80;
listen [::]:80;
server_name wazuh.starcto.com;
rewrite ^ https://$http_host$request_uri? permanent;
}
server {
listen 443 ssl http2 ;
listen [::]:443 ssl http2;
server_name wazuh.starcto.com;
ssl_certificate "/data/ssl/wazuh.starcto.com/public.pem";
ssl_certificate_key "/data/ssl/wazuh.starcto.com/private.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://10.25.25.25:5601;
proxy_ssl_session_reuse off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}三、浏览器访问配置
3.1 查看容器运行情况
[root@10-27-0-224 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3f67b222b5c5 wazuh/wazuh-kibana-odfe:4.2.0 "/bin/sh -c ./entryp…" 30 minutes ago Up 30 minutes 0.0.0.0:443->5601/tcp wazuh-docker_kibana_1 5f1a270c037d wazuh/wazuh-odfe:4.2.0 "/init" 30 minutes ago Up 30 minutes 0.0.0.0:1514-1515->1514-1515/tcp, 0.0.0.0:514->514/udp, 0.0.0.0:55000->55000/tcp, 1516/tcp wazuh-docker_wazuh_1 f863669ad885 amazon/opendistro-for-elasticsearch:1.13.2 "/usr/local/bin/dock…" 30 minutes ago Up 30 minutes 9300/tcp, 9600/tcp, 0.0.0.0:9200->9200/tcp, 9650/tcp wazuh-docker_elasticsearch_1
3.2 登录配置
https://10.27.0.224/ 默认用户:admin 默认密码:admin

3.3 安装并配置客户端Agent
Agent客户端安装教程:https://documentation.wazuh.com/4.2/installation-guide/wazuh-agent/wazuh_agent_package_linux.html


(1)安装agent客户端
[root@10-27-0-224 ~]# sudo WAZUH_MANAGER='10.27.0.224' WAZUH_AGENT_GROUP='default' yum install https://packages.wazuh.com/4.x/yum/wazuh-agent-4.2.0-1.x86_64.rpm
(2)启动agent客户端
[root@10-27-0-224 ~]# sudo systemctl daemon-reload [root@10-27-0-224 ~]# sudo systemctl enable wazuh-agent [root@10-27-0-224 ~]# sudo systemctl start wazuh-agent
(3)查看添加成功

3.4 变更密码
https://documentation.wazuh.com/current/user-manual/elasticsearch/elastic_tuning.html
作者:UStarGao
链接:https://www.starcto.com/open-sourcing/230.html
来源:STARCTO
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
UCloud云平台推荐
随便看看
- 2022-07-13极简了解Ceph存储架构
- 2022-07-21Ceph集群部署之ceph-deploy工具自动化安装
- 2021-06-23iptables与firewalls网络防火墙相关配置
- 2022-05-11MongoDB优雅查询文档记录.pretty()用法
- 2021-03-27Grafana安装部署教程



