One mistyped SSH password does not make anyone panic. Eight times from the same address in two minutes, that's a different story. In Wazuh, the difference between these two states is recorded with a number: alert level. A SOC analyst who understands how that number increases will be quicker to distinguish a user who forgot their password from someone who is guessing passwords.
Alert Levels and Their Meanings
Wazuh documentation organizes rule levels from 0 to 16, complete with the meaning of each level. Some of the most common ones you will encounter:
| Level | Title in Documentation | Example Events |
|---|---|---|
| 0 | Ignored | No action taken, used to suppress false positives |
| 3 | Successful/Authorized events | Successful login, allowed traffic by the firewall |
| 5 | User generated error | Incorrect password, action denied. Alone, it means nothing for security |
| 10 | Multiple user generated errors | Incorrect password multiple times. Could be an attack, or a user who forgot |
| 12 | High importance event | Error messages or warnings from the system and kernel |
| 15 | Severe attack | No chance of false positives, requires immediate attention |
Level 0 has special treatment. Level 0 rules are scanned before other rules and do not appear on the security event dashboard.
From Level 5 to Level 10: Count-Based Rules
The default SSH rules in the 0095-sshd_rules.xml file clearly show the pattern. A regular failed login is captured by rules 5760 and 5716 at level 5. Attempts to log in with non-existent usernames are captured by rule 5710, also at level 5.
Then there are rules that do not read new logs, but rather count old alerts. Rule 5763 states level="10" frequency="8" timeframe="120" ignore="60", depending on if_matched_sid 5760, and using same_source_ip. This means: if rule 5760 is triggered 8 times within 120 seconds from the same source IP address, an alert level 10 will be generated stating brute force trying to get access to the system. Its counterpart, rule 5712, does the same for non-existent usernames.
These three attributes determine when the alert level increases:
frequencyis the number of matches required before an alert is created, with values ranging from 2 to 9999.timeframeis the time window in seconds.ignoreis how long the rule is ignored after being triggered, to prevent alert flooding. In 5763, this value is 60 seconds.
There is a consequence you need to remember from same_source_ip. The counts are collected per source address. Attempts coming from many different addresses do not count towards the same total.
Two Often Overlooked Thresholds
The level also determines the fate of alerts after they are created. In the <alerts> section of ossec.conf, there are two thresholds:
log_alert_levelis set to 3: alerts below this level are not stored inalerts.logoralerts.json.email_alert_levelis set to 12 in theossec.conffile installed with the Wazuh manager: alerts below this level do not send emails. Documentation notes that the default value for this option is 7, which applies if that line is not written.
Try comparing the numbers. The SSH brute force alert is at level 10, two levels below the earlier number 12. So with the default installation configuration, that alert is recorded and displayed on the dashboard, but does not reach anyone's inbox. Documentation mentions that certain rules can force emails through the alert_by_email option, regardless of the global thresholds.
MITRE Labels on Each Alert
Alerts 5763 and 5712 carry the MITRE ATT&CK label T1110 Brute Force. The base rules are more specific: 5710 and 5760 are labeled T1110.001 Password Guessing. In the MITRE catalog, T1110 has four sub-techniques: Password Guessing, Password Cracking, Password Spraying, and Credential Stuffing. These labels are useful when you report, as supervisors or auditors read the technique names faster than rule numbers.
Changing Levels Without Losing on Upgrade
If the default levels do not fit your environment, do not edit the file in /var/ossec/ruleset/rules. Wazuh documentation warns that changes there will be overwritten during upgrades. Copy the rules to /var/ossec/etc/rules/, change their values, and then add overwrite="yes". Custom rules use IDs from 100000 to 120000.
Before activating them, test with /var/ossec/bin/wazuh-logtest. This tool uses the same rules as the analysis engine and displays three phases: pre-decoding, decoding, and filtering (rules). Paste the repeatedly failed login logs, and the firedtimes counter will increase until the brute force rule takes over. For other modules in Wazuh, the file monitoring functionality has been discussed in the Wazuh FIM article.
Sources
- Rules classification, Wazuh documentation
- alerts, Local configuration (ossec.conf), Wazuh documentation
- Rules Syntax, Ruleset XML syntax, Wazuh documentation
- Custom rules, Wazuh documentation
- Testing decoders and rules (wazuh-logtest), Wazuh documentation
- 0095-sshd_rules.xml, official wazuh/wazuh repository on GitHub
- T1110 Brute Force, MITRE ATT&CK