Server-side Sigma/Hayabusa analysis of collected EVTX (VQL-native successor to #1064) - #1292
Merged
Merged
Conversation
…gacy endpoint artifact
Collaborator
|
This looks great! Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds server-side analysis of already-collected Windows event logs using Velociraptor's built-in Sigma engine and the curated Hayabusa ruleset — and adds a risk warning to the legacy endpoint-binary artifact.
It resurrects the intent of #1064 (credit to @shortstack for the original design), rebuilt to address each reason that PR was closed:
copy(accessor="fs"), which reads through the file store API and decompresses transparently. No raw paths, no external binary touching the datastore.uploads()/file_store()instead of path reconstructionuploads(); nothing is reconstructed.Windows.Hayabusa.Rulesartifact via a runtimecollect()call, so rules stay current with the curated pack and are never duplicated.What's included
Server.Analysis.Windows.EventLogs.Hayabusa(SERVER) — takes aClientId/FlowIdof any completed collection that uploaded.evtxfiles (Windows.Triage.Targets,Windows.KapeFiles.Targets, etc.), stages the EVTX from the file store into atempdir(), and evaluates the curated Hayabusa ruleset over it. Pass-through tuning:RuleLevel(all five upstream tiers),RuleStatus,RuleTitleFilter,DateAfter/DateBefore. Results carryClientId/FlowId/Fqdncontext.Robustness behaviors:
ClientId/FlowId, or a flow with no matching EVTX each log an actionable message and return zero rows rather than failing silently or running the ruleset against nothing.Server.Monitor.Windows.EventLogs.Hayabusa(SERVER_EVENT) — watchesSystem.Flow.Completionand automatically analyzes matching flows (default regex:Windows\.KapeFiles\.Targets|Windows\.Triage\.Targets). Results appear under Server Events. Analyses run inline and serialized; this is documented as a deliberate simplicity tradeoff.Windows.EventLogs.Hayabusa(existing) — description now carries a warning after the summary paragraph: the deployed binary is commonly flagged/quarantined by AV/EDR,UpdateRulesmakes the endpoint reach out to GitHub, and on-endpoint analysis modifies forensic state — with a pointer to the native alternative. Functionality unchanged.Why server-side
Deploying
hayabusa.exeto endpoints routinely trips third-party security tooling (alerting defenders, quarantining the tool mid-collection) and pollutes endpoint forensic state. Collecting raw EVTX and analyzing centrally avoids all of that, works retroactively on collections already sitting on the server, and needs no per-endpoint tool staging.Tested
End-to-end on a Windows Server 2022 VM running Velociraptor 0.77.1 in GUI mode:
Windows.Triage.TargetsEventLogs collection: 604 detections in ~14 seconds, includingPotentially Malicious PwSh,Windows Defender Threat Detected,Permanent WMI Event Consumer.uploads() → copy(fs://…) → sigmapipeline executing.Critical, High, Medium, and Lowtier filters correctly, and all failure-path guards produce clean log messages with zero rows.velociraptor-0.77.1 -v artifacts verify ./content/exchange/artifacts/*yamlpasses (exit 0) with these files included. The dynamiccollect()invocation is deliberate: a staticArtifact.Windows.Hayabusa.Rulesreference failsartifacts verifysince the curated artifact is not built-in.Notes
Windows.Hayabusa.Rulesresolves —Server.Import.CuratedSigmaon 0.74,Server.Import.Extrason 0.75+.required_permissions: [SERVER_ADMIN](thefsaccessor requires it).Windows.Sigma.Baselog-source model).