- Notifications
You must be signed in to change notification settings - Fork 603
[Rule Tuning] Fixes FPs related to a process.args_count bug #4971
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
Conversation
Rule: Tuning - GuidelinesThese guidelines serve as a reminder set of considerations when tuning an existing rule. Documentation and Context
Rule Metadata Checks
Testing and Validation
|
⛔️ Test failed Results
|
[process where host.os.type == "windows" and event.type:"start" and process.name : ("wermgr.exe", "WerFault.exe") and | ||
(process.args_count == 1 and | ||
/* Excludes bug where a missing closing quote sets args_count to 1 despite extra args */ | ||
not process.command_line regex~ """\".*\.exe[^\"].*""")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.args_count == 1 | ||
(process.args_count == 1 and | ||
/* Excludes bug where a missing closing quote sets args_count to 1 despite extra args */ | ||
not process.command_line regex~ """\".*\.exe[^\"].*""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.args_count == 1 and | ||
/* Excludes bug where a missing closing quote sets args_count to 1 despite extra args */ | ||
not process.command_line regex~ """\".*\.exe[^\"].*""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.args_count == 1 and | ||
/* Excludes bug where a missing closing quote sets args_count to 1 despite extra args */ | ||
not process.command_line regex~ """\".*\.exe[^\"].*""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
g2g (verified that there is no impact on TPs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea!
I guess having another |
@richlv I'm not sure if I got your point, can you elaborate? |
The change adds:
Assuming .* is greedy, would this also exclude cases like this?
|
@richlv, the expression requires a leading ![]() |
Ah, OK - with the regexp evaluated left-to-right, the first
But wouldn't somebody be able to trigger the exclusion by passing a parameter with
|
So the only edge case would be encountering the bug which goes args = 1 on something like this, right?
|
Yep, thus the matching would be:
It's not a huge concern, was just wondering whether there are some slightly unexpected matches possible. |
Issues
Resolves #4944
Endpoint dev issue: 16786
sdh-endpoint issue: 630
Community user on slack: https://elasticstack.slack.com/archives/CRGSUQC20/p1753795588123129
Summary
There’s a hard-to-reproduce bug in process events where a missing closing double quote in the command line causes it to be counted as a single argument. For more technical details, see Gabe’s explanation in the SDH.
This PR adds a regex pattern to exclude matches from this bug. The most affected rule is
Unusual Process Execution Path - Alternate Data Stream
, which has been triggering on commonly used software (e.g., browsers) and causing 130k+ false positives in the last 30 days.