Trying to convert sigma rules to an elasticsearch backend with the sysmon pipeline does not convert regular expressions. Consider the following example:
title: Test Rule with Regular Expression
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\svchost.exe'
filter_main_flags:
CommandLine|re: '-k\s\w{1,64}(\s?(-p|-s))?'
condition: selection and not 1 of filter_main_*
The following command line is used for conversion:
sigma convert -t lucene -p sysmon -p ecs_windows rule.yaml
Converting the rule currently yields the following:
winlog.channel:Microsoft\-Windows\-Sysmon\/Operational AND (event.code:1 AND (process.executable:*\\svchost.exe AND (NOT process.command_line:SigmaRegularExpression\(regexp\=SigmaString\(\['\-k\\s\\w\{1,64\}\(\\s',\ \<SpecialChars.WILDCARD_SINGLE\:\ 2\>,\ '\(\-p\|\-s\)\)',\ \<SpecialChars.WILDCARD_SINGLE\:\ 2\>\]\),\ flags\=set\(\)\))))
Reverting changes from 8914d68 however yields the following:
winlog.channel:Microsoft\-Windows\-Sysmon\/Operational AND (event.code:1 AND (process.executable:*\\svchost.exe AND (NOT process.command_line:/-k\s\w{1,64}(\s?(-p|-s))?/)))
Trying to convert sigma rules to an elasticsearch backend with the sysmon pipeline does not convert regular expressions. Consider the following example:
The following command line is used for conversion:
Converting the rule currently yields the following:
Reverting changes from 8914d68 however yields the following: