Suricata is an open-source [[intrusion detection system]], intrusion prevention system, and network analysis tool. ## Suricata features There are three main ways Suricata can be used: - *Intrusion detection system* ([[Intrusion Detection System|IDS]]): As a network-based IDS, Suricata can monitor network traffic and alert on suspicious activities and intrusions. Suricata can also be set up as a host-based IDS to monitor the system and network activities of a single host like a computer. - *Intrusion prevention system* ([[Intrusion Prevention System|IPS]]): Suricata can also function as an intrusion prevention system (IPS) to detect and block malicious activity and traffic. Running Suricata in IPS mode requires additional configuration such as enabling IPS mode. - *Network security monitoring* ([[NSM]]): In this mode, Suricata helps keep networks safe by producing and saving relevant network logs. Suricata can analyse live network traffic, existing packet capture files, and create and save full or conditional packet captures. This can be useful for forensics, incident response, and for testing signatures. For example, you can trigger an alert and capture the live network traffic to generate traffic logs, which you can then analyse to refine detection signatures. ## Rules Rules or signatures are *used to identify specific patterns, behaviour, and conditions of network traffic* that might indicate malicious activity. The terms rule and signature are often used interchangeably in Suricata. Security analysts use signatures, or patterns associated with malicious activity, to detect and alert on specific malicious activity. Rules can also be used to provide additional context and visibility into systems and networks, helping to identify potential security threats or vulnerabilities. Suricata uses signatures analysis, which is a detection method used to find events of interest. *Signatures consist of three components*: - **Action**: The first component of a signature. It describes the action to take if network or system activity matches the signature. Examples include: alert, pass, drop, or reject. - **Header**: The header includes network traffic information like source and destination IP addresses, source and destination ports, protocol, and traffic direction. - **Rule options**: The rule options provide you with different options to customise signatures. ![[Suricata Rule.png]] ## Log files There are two log files that Suricata generates when alerts are triggered: - *eve.json*: The eve.json file is the standard Suricata log file. This file contains detailed information and metadata about the events and alerts generated by Suricata stored in JSON format. For example, events in this file contain a unique identifier called flow_id which is used to correlate related logs or alerts to a single network flow, making it easier to analyse network traffic. The eve.json file is used for more detailed analysis and is considered to be a better file format for log parsing and SIEM log ingestion. - *fast.log*: The fast.log file is used to record minimal alert information including basic IP address and port details about the network traffic. The fast.log file is used for basic logging and alerting and is considered a legacy file format and is not suitable for incident response or threat hunting tasks. The main difference between the eve.json file and the fast.log file is the level of detail that is recorded in each. The fast.log file records basic information, whereas the eve.json file contains additional verbose information.