Hey all,
I'm trying to filter out Windows security events in Wazuh that are triggered by system or service accounts like:
SYSTEM
UMFD*
DWM*
LOCAL SERVICE
NETWORK SERVICE
ANONYMOUS LOGON
Accounts ending with $
MSOL_*, azureconnect, IUSR*, IWAM*, etc.
I tried using this rule:
But it's not working — the alerts still show up (e.g. for MSOL_136fe95c1a8f or LOCAL SERVICE), even though the field is definitely present in the alert payload (win.eventdata.subjectUserName).
I also tried specifying <if_sid> with the rule that originally fired (e.g., 60104), but even that doesn't seem to help.
Using data.win.eventdata.subjectUserName instead of win.eventdata.subjectUserName also makes no difference.
What am I doing wrong?
Do I need to use match instead of regex?
Is this maybe due to rule chaining and I need to attach this directly to the original rule as if_sid?
Any help appreciated!
Hi,
Thanks for the suggestions! A few quick updates on my end:
My <field name="win.eventdata.targetUserName"> filter is firing correctly—I’m already dropping all the SYSTEM, UMFD*, DWM*, LOCAL SERVICE, etc., events as expected.
I’ve double-checked the XML and removed the stray < you pointed out, so the <field> blocks are properly formed now.
I verified with wazuh-logtest that rule ID 102010 matches on targetUserName, but the <field name="win.eventdata.subjectUserName"> block still never fires, even when I use a permissive regex like .*SYSTEM.*.
These are plain Windows Security EventChannel logs (not Sysmon), so <if_group>windows</if_group> is definitely correct.
Yet I still see alerts where eventdata.subjectUserName is “SYSTEM.” I’m wondering:
Rule scope or order: Could the subjectUserName condition be evaluated too late?
Decoder nuance: Should I explicitly add <if_decoder>windows</if_decoder> or include a sysmon group?
Event JSON: Is there any chance the field is nested differently or has hidden whitespace/quotes?
If it helps, I can share a sanitized snippet of the exact eventdata JSON for you to reference. Appreciate any further pointers!
Thanks,
Sander