Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added logic to improve Sysmon KQL generation #126

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

0xffhh
Copy link

@0xffhh 0xffhh commented Oct 25, 2022

The current Sysmon "AllVersions" parser is incredibly slow, probably due to the mv-expand or other run-time inefficiencies. Hence, I prefer to use the "old" static but fast runtime parser.

This PR fixes the issue where all KQL columns generated are of type dynamic. This prevents easy joins and other operations which are not allowed on dynamics.

The code takes the type defined in the XML and performs the correct typecasting when generating the columns. Now, the output looks like this:

...
let SYSMONEVENT_IMAGE_LOAD_7=() {
let processEvents = EventData
| where EventID == 7
| extend RuleName = tostring(EventDetail.[0].["#text"]), 
UtcTime = tostring(EventDetail.[1].["#text"]), 
ProcessGuid = tostring(EventDetail.[2].["#text"]), 
ProcessId = toint(EventDetail.[3].["#text"]), 
Image = tostring(EventDetail.[4].["#text"]), 
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant