{"id":12380,"date":"2022-04-30T15:21:58","date_gmt":"2022-04-30T12:21:58","guid":{"rendered":"https:\/\/kifarunix.com\/?p=12380"},"modified":"2024-03-09T11:39:33","modified_gmt":"2024-03-09T08:39:33","slug":"integrate-suricata-with-wazuh-for-log-processing","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/integrate-suricata-with-wazuh-for-log-processing\/","title":{"rendered":"Integrate Suricata with Wazuh for Log Processing"},"content":{"rendered":"\n
Follow through this tutorial to learn how to integrate Suricata with Wazuh for log processing. With its ability to write its logs in YAML and JSON formats, Suricata can be integrated with other tools such as SIEMs, Splunk, Logstash\/Elasticsearch, Kibana for further logs processing and visualization. In this tutorial, we will see how you can easily integrated it with Wazuh<\/a>, an open-source threat detection, security monitoring, incident response and regulatory compliance<\/em> tool to process the Suricata generated alerts for better monitoring and visualization network traffic.<\/p>\n\n\n\n To begin with, ensure that you have a Wazuh manager up and running. You can check the sample tutorials below;<\/p>\n\n\n\n Install Wazuh Server on Rocky Linux 8<\/a><\/p>\n\n\n\n Install and Configure Wazuh Manager on Ubuntu 22.04<\/a><\/p>\n\n\n\n On the end point where you are monitoring Network traffic, install and configure Suricata. Sample tutorials<\/p>\n\n\n\n Install and Setup Suricata on Rocky Linux<\/a><\/p>\n\n\n\n Install and Setup Suricata on Ubuntu 22.04\/Ubuntu 20.04<\/a><\/p>\n\n\n\n On the hosts where Suricata is installed and monitoring network traffic, install Wazuh agents.<\/p>\n\n\n\n Wazuh agents are required to read and collect and push the Suricata alerts logs into Wazuh server\/manager for processing.<\/p>\n\n\n\n Sample tutorials to install Wazuh agents;<\/p>\n\n\n\n Install Wazuh Agent on Rocky Linux 8<\/a><\/p>\n\n\n\n Easy Way to Install Wazuh Agents on Ubuntu\/Debian<\/a><\/p>\n\n\n\n In this tutorial, we have two agents connected;<\/p>\n\n\n\n By default, Suricata logs alerts to two different files;<\/p>\n\n\n\n In order to be able to integrate Suricata with Wazuh, you need to configure Wazuh agent to read the Suricata EVE logs.<\/p>\n\n\n\n The Suricata EVE log file is usually Thus, open the Wazuh agent configuration file for editing;<\/p>\n\n\n\n Add the lines below, just before the last line, This basically instructs Wazuh agent to collect Suricata EVE logs and push them to Wazuh manager for processing.<\/p>\n\n\n\n Wazuh manager ships with preinstalled rules for processing Suricata EVE JSON logs by default. These rules are stored in the file Save and exit the file.<\/p>\n\n\n\n Before you can restart Wazuh agent, run the command below to check if any configuration syntax error;<\/p>\n\n\n\n exit status should be 0 if no error. Otherwise, you will see a message about the error.<\/p>\n\n\n\n Also ensure Suricata is running and monitoring traffic on the correct network interface.<\/p>\n\n\n\n It is now time to test if Wazuh can actually read and process Suricata event logs.<\/p>\n\n\n\n If Suricata is running on a live system with realtime traffic, there are high chances that you will sport the events related to network traffic on the respective Suricata server agent events.<\/p>\n\n\n\n See sample screenshot below;<\/p>\n\n\n\n That is evident enough to show that Wazuh is now collecting and processing Suricata events in realtime.<\/p>\n\n\n\n That brings us to a close of our tutorial on how to process Suricata logs with Wazuh.<\/p>\n\n\n\n Detecting Malicious Files with Wazuh and VirusTotal<\/a><\/p>\n\n\n\nHow to Integrate Suricata with Wazuh for Log Processing<\/h2>\n\n\n\n
Install and Setup Wazuh Server<\/h3>\n\n\n\n
Install and Setup Suricata<\/h3>\n\n\n\n
Install Wazuh Agents<\/h3>\n\n\n\n
Configure Suricata Logging<\/h3>\n\n\n\n
\n
fast.log<\/code><\/strong>: which contains line based alerts log<\/li>\n\n\n\n
eve.json<\/code><\/strong>: which stores the event logs in JSON format<\/li>\n<\/ul>\n\n\n\n
# Configure the type of alert (and other) logging you would like.\noutputs:\n - fast:\n enabled: yes\n filename: fast.log\n append: yes<\/strong>\n\n # Extensible Event Format (nicknamed EVE) event log in JSON format\n - eve-log:\n enabled: yes\n filetype: regular\n filename: eve.json<\/strong>\n...\n<\/code><\/pre>\n\n\n\n
Configure Wazuh Agent to Collect Suricata Logs<\/h3>\n\n\n\n
\/var\/log\/suricata\/eve.json<\/strong><\/code> by default.<\/p>\n\n\n\n
sudo vi \/var\/ossec\/etc\/ossec.conf<\/code><\/pre>\n\n\n\n
<\/ossec_config><\/code><\/strong>.<\/p>\n\n\n\n
<localfile>\n <log_format>json<\/log_format>\n <location>\/var\/log\/suricata\/eve.json<\/location>\n <\/localfile<\/strong>><\/code><\/pre>\n\n\n\n
\/var\/ossec\/ruleset\/rules\/0475-suricata_rules.xml.<\/code><\/strong><\/p>\n\n\n\n
<!--\n - Suricata rules\n - Created by Wazuh, Inc.\n - Copyright (C) 2015-2020, Wazuh Inc.\n - This program is a free software; you can redistribute it and\/or modify it under the terms of GPLv2.\n-->\n\n<!-- ID: 86600 - 86699 -->\n\n<group name=\"ids,suricata,\">\n\n <!--\n {\"timestamp\":\"2016-05-02T17:46:48.515262+0000\",\"flow_id\":1234,\"in_iface\":\"eth0\",\"event_type\":\"alert\",\"src_ip\":\"16.10.10.10\",\"src_port\":5555,\"dest_ip\":\"16.10.10.11\",\"dest_port\":80,\"proto\":\"TCP\",\"alert\":{\"action\":\"allowed\",\"gid\":1,\"signature_id\":2019236,\"rev\":3,\"signature\":\"ET WEB_SERVER Possible CVE-2014-6271 Attempt in HTTP Version Number\",\"category\":\"Attempted Administrator Privilege Gain\",\"severity\":1},\"payload\":\"abcde\",\"payload_printable\":\"hi test\",\"stream\":0,\"host\":\"suricata.com\"}\n -->\n <rule id=\"86600\" level=\"0\">\n <decoded_as>json<\/decoded_as>\n <field name=\"timestamp\">\\.+<\/field>\n <field name=\"event_type\">\\.+<\/field>\n <description>Suricata messages.<\/description>\n <options>no_full_log<\/options>\n <\/rule>\n\n <rule id=\"86601\" level=\"3\">\n <if_sid>86600<\/if_sid>\n <field name=\"event_type\">^alert$<\/field>\n <description>Suricata: Alert - $(alert.signature)<\/description>\n <options>no_full_log<\/options>\n <\/rule>\n\n <rule id=\"86602\" level=\"0\">\n <if_sid>86600<\/if_sid>\n <field name=\"event_type\">^http$<\/field>\n <description>Suricata: HTTP.<\/description>\n <options>no_full_log<\/options>\n <\/rule>\n\n <rule id=\"86603\" level=\"0\">\n <if_sid>86600<\/if_sid>\n <field name=\"event_type\">^dns$<\/field>\n <description>Suricata: DNS.<\/description>\n <options>no_full_log<\/options>\n <\/rule>\n\n <rule id=\"86604\" level=\"0\">\n <if_sid>86600<\/if_sid>\n <field name=\"event_type\">^tls$<\/field>\n <description>Suricata: TLS.<\/description>\n <options>no_full_log<\/options>\n <\/rule>\n\n<\/group>\n<\/code><\/pre>\n\n\n\n
Restart Wazuh agent service<\/h3>\n\n\n\n
sudo \/var\/ossec\/bin\/wazuh-syscheckd -t<\/code><\/pre>\n\n\n\n
sudo systemctl restart wazuh-agent<\/code><\/pre>\n\n\n\n
Test Wazuh Suricata Log Processing<\/h3>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n