Hi Team,
We recently upgraded our Wazuh Manager and agents to 4.14.7 and are using a custom software policy rule based on a CDB list of approved software vendors.
Rule:
Company field is not present in the CDB whitelist.Most whitelist entries work correctly.
However, we occasionally receive Rule 100500 alerts for vendors that already exist in the CDB list.
Examples:
Microsoft Corporation
Sysmon Event:
Example process:
Amazon.com Inc.
Sysmon Event:
List entry:
Alert still generated:
Example process:
win.eventdata.company exists in incoming Sysmon events.lookup="not_match_key"?<list> condition during rule matching?Any guidance would be appreciated.
Thanks.
Arun S
Hi Arun,
There's no confirmed 4.14.x bug I know of where not_match_key fails on one occasion and works on another.
I would like you to review whether this fails only for some specific company names.
If this works for the same company name sometimes and also fails for the company with the same name. Review the two different events. Check if the company name has a similar value.
For the CDB list to match, the field value needs to be the same as the decoded field. If there is any additional whitespace or a different case of the alphabet, the CDB list will not work.
The issue also might be related to a high EPS (events per second) rate in your Wazuh environment. This could cause wazuh-analysisd to miss or fail to properly evaluate the CDB list, resulting in false positive alerts. There are similar discussions on GitHub regarding this behavior. You may refer to the linked GitHub thread for more context.
Workaround:
If your CDB list is relatively short, you can use the <field> tag with negate="yes" instead of a CDB list to achieve similar logic. For example:
<group name="allowapplication,">
<rule id="100500" level="16">
<if_sid>61603</if_sid>
<field name="win.eventdata.company" negate="yes" type="pcre2">value1|value2|value3</field>
<description>Sysmon - Event 1: Process $(win.eventdata.description) started but not allowed by the software policy</description>
<group>software_policy</group>
</rule>
</group>
In this rule:
If the table field matches any of the listed values (value1, value2, value3), the rule will not trigger due to the negate="yes" option.
If the value does not match any of the listed values, the rule will trigger as expected.
You can replace value1, value2, etc., with your actual company names.
Refer to these documents for more details.
Wazuh rule syntax documentation
Regular Expression Syntax
Perl-compatible Regular Expressions