Closed fukusuket closed 8 months ago
Thanks for reporting
That's interesting - We do have the field mapping defined in the config file so it should be able to find it
Ok after investigation the rule is
detection:
selection:
Channel: 'System'
Provider_Name: 'Microsoft-Windows-Eventlog'
EventID: 104
LogFileClearedChannel:
- 'Application'
- 'Microsoft-Windows-Windows Defender/Operational'
- 'Microsoft-Windows-AppLocker/EXE and DLL'
- 'Microsoft-Windows-PowerShell/Operational'
- 'Microsoft-Windows-Sysmon/Operational'
- 'Microsoft-Windows-TaskScheduler/Operational'
- 'OpenSSH/Operational'
- 'Security'
- 'System'
- 'Windows PowerShell'
condition: selection
But the field mapping for Provider_Name is defined as https://github.com/Velocidex/velociraptor-sigma-rules/blob/33dafd964c27c697fc6dba63681be867fbbe768b/config/windows_hayabusa_rules.yaml#L208
Which is wrong - it should be "x=>x.System.Provider.Name"
Its interesting - the alias actually comes from Hayabusa itself https://github.com/Yamato-Security/hayabusa-rules/blob/09dba13950cb849d320d76ae63707496c5947f14/config/eventkey_alias.txt#L139
From the README file of Hayabusa it says the _attributes notation is a special case
To specify XML attributes in an eventkey, use the format
{eventkey}_attributes.{attribute_name}
.
So we need to consider that when converting the field mappings from Hayabusa (In Velociraptor we just merge the attribute names directly so there is no need to use this notation).
Thank you so much for quick investigation. I see, it was an Attribute notation issue :)
This should be fixed now by #18
Thanks for reporting and testing!
I confirmed Important Log File Cleared
rule detect 2
logs with fixed rule set:) Thank you!
Hello, I found a Hayabusa rules related issue, so I' ll report it :)
Describe the issue Some hayabusa-rules use alias fields name. Therefore, rules that use alias are not correctly detecting logs. For example, The following
Important Log File Cleared
rule uses theLogFileClearedChannel
field,However,
LogFileClearedChannel
field is an alias, and the actual field name in the EVTX file are mapped based on the txt below.Therefore, when using hayabusa-rules, it is necessary to perform the above alias mapping.
Step to Reproduce
C:/tmp/all-evtx/win2022-0-20348-azure
Server.Import.CuratedSigma
server artifactSigma.Windows.Hayabusa.Rules
with following optionC:/tmp/all-evtx/win2022-0-20348-azure
Critical and High
Expected behavior
Important Log File Cleared
rule detect2
logs.Actual behavior
Important Log File Cleared
rule does not detect log.Screenshot System.evtx with EventID: 104 sample event.
Environment
Thank you for your time.