Wazuh 5: Sigma rules, detectors and findings instead of alerts
Sigma rules in Wazuh 5: required fields, modifiers, logsource.product, the draft, test and custom spaces, detectors, findings and case statuses.
Wazuh 5 no longer uses the XML rules known from 4.x to generate alerts: detection is described by rules in the Sigma format, detectors in the Wazuh indexer run them, and the result is a finding instead of an alert. This article describes the rule structure, the content lifecycle across spaces, and where findings go and how to manage them.
The description is based on the 5.0-rc documentation (documentation.wazuh.com/5.0-rc). This is a release candidate, so setting names and interface paths may still change before the stable version. Installation and architecture of Wazuh 5 are covered in a separate article, Wazuh 5: installation, and the list of all changes compared to 4.x in Wazuh 5 as a next-gen SIEM.
From a 4.x alert to a 5.x finding
In Wazuh 4.x, an XML rule in wazuh-analysisd produced an alert with a level from 0 to 16. In 5.0 the documentation describes a different flow: a raw log passes through a decoder, becomes a normalized event in the Wazuh Common Schema (WCS), and a detector checks it against Sigma rules. A match creates a finding. The documentation states directly that findings in Wazuh 5.0 play the same role that alerts played in 4.x.
| Stage | Wazuh 4.x | Wazuh 5.0-rc |
|---|---|---|
| Detection logic | XML rule with if_sid, a level and groups | Sigma rule in YAML |
| Who runs it | wazuh-analysisd on the manager | Security Analytics detector in the indexer |
| Result | Alert in wazuh-alerts-* | Finding in wazuh-findings-v5-<category> |
| Severity | Level 0 to 16 | level: informational, low, medium, high, critical |
| Handling by the analyst | Outside the product | wazuh.case.* fields in the finding |
Decoders still exist and still decide the quality of detection, because a rule sees only normalized fields. The rules for writing decoders in 4.x are covered in Wazuh custom decoders, and the detection engineering approach that carries over to the new version in Wazuh detection engineering.
Rule structure
A rule has three required blocks: detection, logsource and metadata, and the required top-level fields id, status and level. The mitre and compliance blocks are optional. The example from the documentation shows all blocks at once:
metadata:
title: Python SQL Exceptions
author: Thomas Patzke
description: Detects SQL exceptions in Python applications according to PEP 249.
id: 9c1c1e3f-21ad-4db0-9bb4-5cf2e9c1b901
sigma_id: 19aefed0-ffd4-47dc-a7fc-f8b1425e84f9
status: stable
level: medium
enabled: true
tags:
- attack.initial-access
- attack.t1190
logsource:
category: application
product: python
detection:
keywords:
- DataError
- IntegrityError
- ProgrammingError
- OperationalError
condition: keywords
falsepositives:
- Application bugs
mitre:
tactic:
id:
- TA0001
name:
- Initial Access
technique:
id:
- T1190
name:
- Exploit Public-Facing Application
subtechnique:
id: []
name: []
compliance:
pci_dss:
- "6.5.1"
gdpr:
- Art. 32
| Field | Required | Meaning |
|---|---|---|
id | yes | UUIDv4. When a rule is created, Wazuh assigns a new random UUID and replaces the value you entered |
sigma_id | no | The original Sigma rule identifier, kept when importing from upstream |
status | yes | Rule maturity. The rules page lists experimental, test and stable, the indexer page adds deprecated and unsupported, and case does not matter |
level | yes | informational, low, medium, high or critical |
enabled | no | A disabled rule stays in the catalog, but detectors do not run it |
tags, falsepositives | no | ATT&CK tags and known sources of false positives |
Treat the id field as owned by the system: references to a rule in internal documentation are better based on metadata.title or on sigma_id, if the rule comes from the Sigma repository. This is a recommendation, not a product requirement.
Detection: selections, conditions and modifiers
The detection block contains named selections and a condition field that combines them with the operators and, or, not and with parentheses. A list of values under one field means OR, several fields in one selection mean AND. A keywords list without a field name also works as OR. The example with parentheses from the documentation:
detection:
sel_high:
event.severity|gte: 8
sel_critical:
log.level: CRITICAL
filter:
process.name: monitor
condition: (sel_high or sel_critical) and not filter
Every field used in detection is checked against WCS. A rule that refers to a field missing from the schema is rejected at validation. So a typo in a field name ends in a validation error, not in a rule that never matches. WCS categories, streams and templates are covered in Wazuh Common Schema and wazuh-events-v5 indices.
Modifiers are appended after the field name with a pipe character and can be chained:
| Modifier | Effect |
|---|---|
contains, startswith, endswith | Match a fragment, the beginning or the end of a value |
base64, base64offset | Compare with a Base64-encoded value |
wide | Convert to UTF-16 before encoding, must come before base64 or base64offset |
windash | Dash variants in Windows command line switches |
re | Regular expression, flags i, m, s |
cidr | IP address within the given network |
exists | The field exists (true) or does not exist (false) |
all | All values from the list must match, not for a single-element list |
lt, lte, gt, gte | Numeric comparisons |
Examples of chains from the documentation: process.command_line|base64offset|contains: "/bin/bash" and process.command_line|wide|base64offset|contains: "ping".
logsource.product ties a rule to an integration
logsource has one required field: product. Its value must be identical to the integration title (the integration’s metadata.title) in which you create the rule. This decides which detector runs the rule. Content Manager rejects a rule with a non-matching product with a 400 Bad Request code. The category, service and definition fields are optional and, according to the documentation, do not affect matching.
Integration categories in WCS also determine the name of the events and findings index:
| WCS category | Example integrations |
|---|---|
| access-management | okta, keycloak, jumpcloud |
| applications | apache-http, nginx, google-workspace |
| cloud-services | aws, azure, gcp, github |
| network-activity | cisco-asa, fortinet, pfsense, netflow |
| security | crowdstrike, suricata, m365-defender, sentinel-one |
| system-activity | system events, including the windows integration |
Below is a synthetic rule for the apache-http integration. It looks for a segmentation fault message, skips events from the 192.0.2.0/24 test network, and inserts the agent identifier into the finding title:
id: 00000000-0000-4000-8000-000000000001
status: experimental
level: high
logsource:
product: apache-http
detection:
selection:
message|contains:
- exit signal Segmentation Fault
wazuh.integration.name: apache-http
filter:
source.ip|cidr: 192.0.2.0/24
condition: selection and not filter
metadata:
title: "Apache segmentation fault in agent {{ wazuh.agent.id }}"
description: Example rule for a lab integration.
tags:
- attack.impact
- attack.t1499.004
Placeholders in metadata
The {{ field.path }} syntax inserts a field value from the event into the finding. For an event with wazuh.agent.id = "001", the title from the example above is saved as “Apache segmentation fault in agent 001”. Interpolation rules:
- It works only in
title,tags, themitre.*fields and allcompliance.*arrays. - Nothing in
detectionis interpolated, neither selections norcondition. - Text, a number and a boolean are converted to text, an array is expanded.
- A missing field, null or an object gives empty text. A value that comes out entirely empty is omitted.
- The substitution happens before writing to
wazuh-findings-v5-<category>. The rule document itself does not change.
MITRE and compliance
The mitre block has three levels: tactic, technique and subtechnique. Each contains parallel id and name arrays in the same order. When a rule has no subtechnique, both arrays stay empty, as in the Python SQL Exceptions example.
The compliance block accepts compliance framework keys with a list of identifiers:
| Key | Example from the documentation |
|---|---|
gdpr | Art. 32 |
pci_dss | 2.2.1 |
nist_800_53 | AC-3, AU-2 |
nist_800_171 | 3.1.1 |
iso_27001 | A.8.16 |
nis2 | Art. 21, Art. 23 |
hipaa | 164.312(a)(1) |
tsc | CC6.1 |
fedramp | AC-2, SI-4 |
cmmc | AC.1.001 |
The Article 21 measures and Article 23 reporting duties of NIS2 are covered in the post on Wazuh and NIS2.
Spaces: draft, test, custom, standard
Detection content (decoders, KVDBs, filters, integrations, rules) lives in four spaces:
| Space | Write | Role |
|---|---|---|
| draft | yes | The only place to create and edit your own content |
| test | read only | Validation and testing in the Log test tool |
| custom | read only | Your own content, active in production |
| standard | read only | Official Wazuh content synchronized from CTI |
Content moves along the path draft, test, custom. At every promotion, Content Manager deploys the content to the analysis engine, validates the configuration, triggers a reload, and only then updates the target space. Before promotion it shows a preview of new, changed and deleted resources, checks syntax and references, and on a partial failure protects against leaving an inconsistent state.
In 4.x you had to build this discipline yourself around wazuh-logtest and rule reloading, as described in Wazuh logtest. In 5.0 the testing stage is part of the product.
The draft has limits, changeable dynamically in the Content Manager settings:
| Setting | Default |
|---|---|
max_rules | 200 |
max_decoders | 200 |
max_integrations | 100 |
max_kvdbs | 100 |
max_filters | 100 per space |
Creating a resource over the limit ends with a 400 Bad Request code. The module API is available under /_plugins/_content_manager/. Content Manager sends a telemetry ping once a day with the cluster UUID and version, and you turn it off with the plugins.content_manager.telemetry.enabled setting set to false.
Detectors
A detector runs rules on indexed events on a given schedule. Detectors are not subject to promotion: they exist only in the custom or standard space. You create a new detector in Ruleset management, Detection, Detectors, with the Create Detector button: name, data source, indices, space, integration, rule selection and schedule.
Limits from the indexer documentation:
- A detector uses Standard or Custom rules, never both at once.
- By default it holds up to 50 rules, and the
plugins.security_analytics.max_rules_per_detectorlimit changes this. - A request that breaks any of the restrictions on create or update gets 400 Bad Request.
- A rule change takes effect from the next detector run. Existing findings are not modified.
A rule from standard cannot be edited or disabled, because the space synchronizes with CTI. To silence a single rule, you stop the standard detector and create your own. The example from the documentation for the rule “Event log cleared via command line” from the windows integration:
- In Detectors, with the Standard space, select the windows detector and use Stop detector in the Actions menu. Note the Data source and Integration.
- Create a windows-Custom detector on the
wazuh-events-v5-system-activityindex with the windows integration. - In Selected rules, leave the rules from Standard selected and clear “Event log cleared via command line”.
- Save. Wazuh places the new detector in the custom space.
The original detector stays in standard and still receives CTI updates. Your own detector does not update automatically, so you must attach new standard rules for this integration to it yourself.
Findings: where they go and what they contain
A match first creates a raw finding with the fields id, detector_id, related_doc_ids, queries, index and timestamp. Then, asynchronously, an enriched finding is created: the full event, the rule metadata in wazuh.rule, and enrichments such as source.geo, source.as or wazuh.threat. Enriched findings go to the wazuh-findings-v5-{category}* indices.
The module settings have the plugins.security_analytics prefix in /etc/wazuh-indexer/opensearch.yml, and most can be changed dynamically through _cluster/settings. The plugins.security_analytics.enriched_findings_index_enabled: false setting turns off writing to wazuh-findings-v5-*. Raw findings are still created in .opensearch-sap-{category}-findings-*.
Case handling in a finding
A finding carries case fields: wazuh.case.title, wazuh.case.description, wazuh.case.status, as well as severity, priority, TLP, tags and comments. The typical flow according to the documentation: a rule creates a finding, the analyst changes the status to acknowledged, adds notes and tags, and sets completed when done. A bulk update covers up to 10 findings by default (plugins.security_analytics.max_case_management_bulk_size) and returns 200, 207 on partial success, or 400.
A query for findings in the acknowledged status, in the documentation version:
curl -k -u <WAZUH_INDEXER_USERNAME>:<WAZUH_INDEXER_PASSWORD> -X GET "https://<WAZUH_INDEXER_IP>:9200/wazuh-findings-v5-*/_search" \
-H "Content-Type: application/json" \
-d '{
"query": {
"term": {
"wazuh.case.status": {
"value": "acknowledged"
}
}
}
}'
In 4.x, alert handling statuses usually lived in an external ticketing system. In 5.0 part of this process can be kept at the finding itself. How to choose weights and thresholds so the analyst’s queue does not drown in noise is covered in Wazuh rule levels and thresholds, and the rules also apply to the level values in Sigma.
What the documentation does not specify
The 5.0-rc documentation does not describe a tool for converting 4.x XML rules to Sigma, nor an equivalent of the frequency and timeframe attributes of XML rules in the Sigma rule syntax. It also does not say how long the enrichment of a finding can lag behind the raw finding. Before migrating production rules, these questions must be checked on the stable release.
Sources
- https://documentation.wazuh.com/5.0-rc/user-manual/data-analysis/rules.html
- https://documentation.wazuh.com/5.0-rc/user-manual/data-analysis/detectors.html
- https://documentation.wazuh.com/5.0-rc/user-manual/data-analysis/findings.html
- https://documentation.wazuh.com/5.0-rc/user-manual/data-analysis/space.html
- https://documentation.wazuh.com/5.0-rc/user-manual/data-analysis/content-management.html
- https://documentation.wazuh.com/5.0-rc/user-manual/wazuh-indexer/wazuh-sigma-rules.html
- https://documentation.wazuh.com/5.0-rc/user-manual/wazuh-indexer/modules/security-analytics.html
- https://documentation.wazuh.com/5.0-rc/user-manual/wazuh-indexer/modules/content-manager.html
- https://documentation.wazuh.com/5.0-rc/user-manual/wazuh-indexer/wazuh-common-schema.html