Hi @AL3Z, Props to @richgalloway for pointing out the difference between my test data with quotes (") and live data with apostrophes ('). We can accommodate both in the regular expression. We can a...
See more...
Hi @AL3Z, Props to @richgalloway for pointing out the difference between my test data with quotes (") and live data with apostrophes ('). We can accommodate both in the regular expression. We can also accommodate multiple Data elements with different Name attributes; however, if the same value is in both elements, we only need to match one to filter the event. If you want match a value in either element, try: blacklist3 = $XmlRegex=%<Provider[^>]+Name=["']Microsoft-Windows-Security-Auditing["']% $XmlRegex=%<EventID>4688<\/EventID>% $XmlRegex=%<Data Name=["'](New|Parent)ProcessName["']>C:\\Program Files \(x86\)\\Tanium\\Tanium Client\\TaniumClient\.exe<\/Data>% (New|Parent)ProcessName matches both NewProcessName and ParentProcessName. If it's easier to read and maintain, you can also use (NewProcessName|ParentProcessName). If you only want to match events that do have the same value in both elements, add an additional $XmlRegex match: blacklist3 = $XmlRegex=%<Provider[^>]+Name=["']Microsoft-Windows-Security-Auditing["']% $XmlRegex=%<EventID>4688<\/EventID>% $XmlRegex=%<Data Name=["']NewProcessName["']>C:\\Program Files \(x86\)\\Tanium\\Tanium Client\\TaniumClient\.exe<\/Data>% $XmlRegex=%<Data Name=["']ParentProcessName["']>C:\\Program Files \(x86\)\\Tanium\\Tanium Client\\TaniumClient\.exe<\/Data>% Technically, the example also matches e.g. <Data Name="NewProcessName'> with different start and end characters, but it's not valid XML, and you shouldn't encounter this case in a live event stream. We can make the regular expression tighter with capture groups and back references, but I don't know if back references are supported in this context. Separate blacklist values will work as well. Combining them or separating them is up to your preference and administrative style.