Log data analysis

Automated log management and analysis accelerate threat detection. In many cases, evidence of an attack can be found in the log messages of devices, systems and applications. Wazuh can be used to automatically aggregate and analyze log data.

The Wazuh agent, running on the monitored endpoint, is usually the one in charge of reading operating system and application log messages, forwarding those to the Wazuh server, where the analysis takes place. When no agent is deployed, the server can also receive data via syslog from network devices or applications.

Wazuh uses decoders to identify the source application of the log message. Then, it analyzes the data using application-specific rules. This is an example of a rule used to detect SSH authentication failure events:

<rule id="5716" level="5">
  <match>^Failed|^error: PAM: Authentication</match>
  <description>SSHD authentication failed.</description>

Rules include a match field, used to define the pattern the rule is going to be looking for. They also have a level field that specifies the priority of the resulting alerts. Besides, rules do enrich events with technique identifiers from the Mitre ATT&CK framework, and with mapping to regulatory compliance controls.

The manager will generate an alert every time an event, collected by one of the agents or via syslog, matches a rule with a priority level higher than a predefined threshold (3 by default).

Here is an example found in /var/ossec/logs/alerts/alerts.json (some fields have been removed for reasons of brevity):

  "agent": {
      "id": "005",
      "ip": "",
      "name": "Centos"
  "predecoder": {
      "hostname": "ip-10-0-1-175",
      "program_name": "sshd",
      "timestamp": "Jul 12 15:32:41"
  "decoder": {
      "name": "sshd",
      "parent": "sshd"
  "full_log": "Jul 12 15:32:41 ip-10-0-1-175 sshd[21746]: Failed password for root from port 61658 ssh2",
  "location": "/var/log/secure",
  "data": {
      "dstuser": "root",
      "srcip": "",
      "srcport": "61658"
  "rule": {
      "description": "sshd: authentication failed.",
      "id": "5716",
      "level": 5,
      "mitre": {
          "id": [
          "tactic": [
              "Credential Access"
          "technique": [
              "Brute Force"
  "timestamp": "2020-07-12T15:32:41.756+0000"

Once generated by the Wazuh server, the alerts are sent to the Elastic Stack component where they are enriched with Geolocation information, stored and indexed. Kibana can then be used to search, analyze, and visualize the data. Below is an alert as displayed in the interface:

Wazuh provides a default ruleset, updated periodically, with over 3,000 rules for different systems and applications. In addition, Wazuh allows the creation of custom rules. Find more information in the user manual.