agent.conf
在服务器agent.conf文件中添加以下内容
<agent_config> <localfile> <location>Microsoft-Windows-Sysmon/Operational</location> <log_format>eventchannel</log_format> </localfile> </agent_config>
docker安装的wazuh,agent配置文件在 `wazuh.manager` 容器中。
ossec.conf
将logall_json修改为yes,如下:
<logall_json>yes</logall_json>
docker安装的wazuh,agent配置文件在 `wazuh.manager` 容器中。
修改上述两项后重启wazuh-manager服务
filebeat.yml
修改filebeat配置文件,修改内容如下:
... filebeat.modules: - module: wazuh alerts: enabled: true archives: enabled: true ...
重启filebeat
service filebeat restart
测试filebeat输出
filebeat test output
添加Index Patterns
在WUI中,Management -> Stack Management -> Index Patterns
添加wazuh-archives-*的Patterns
添加完后,可以在Discover中看到客户端的sysmon日志。
添加IP黑名单
开始接收sysmon日志后,日志存储量会无限增大,需要对发送过来的源地址进行限制。
如果使用docker安装,需要在docker-compose.yml中,添加privileged,不添加的话无法在容器中启动iptables,如下:
services: wazuh.manager: image: wazuh/wazuh-manager:4.8.0 hostname: wazuh.manager restart: always privileged: true #添加 ports: - "1514:1514" - "1515:1515" - "514:514/udp" - "55000:55000"
构建好docker容器后,在`wazuh.manager`容器中安装iptables,并添加目的端口为1514的黑名单即可,如下:
# apt update # apt install iptables # iptables -I INPUT -s x.x.x.x -p tcp --dport 1514 -j DROP # iptables-save