-
Notifications
You must be signed in to change notification settings - Fork 557
[New Rule] Potential Malicious PowerShell Based on Alert Correlation #4635
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: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
⛔️ Test failed Results
|
"OS: Windows", | ||
"Use Case: Threat Detection", | ||
"Tactic: Execution", | ||
"Rule Type: Higher-Order Rule" |
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.
Add investigation guide and tag
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.
From what I understood, investigation guides are only required for critical alerts, otherwise we should add them as part of the release prep.
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.
Oh, I see. We are enforcing it for high too, I'll work on it
| KEEP kibana.alert.rule.name, powershell.file.script_block_id, _id | ||
|
||
// Count distinct alerts and filter for matches above the threshold | ||
| STATS distinct_alerts = COUNT_DISTINCT(kibana.alert.rule.name), rules_triggered = VALUES(kibana.alert.rule.name), alert_ids = VALUES(_id) BY powershell.file.script_block_id |
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.
Is it optimal to aggregate on a specific user ID or host?
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.
As these are like UUIDs, they are not likely to repeat between different hosts, so I think we don't need that - at least for now.
⛔️ Test failed Results
|
⛔️ Test failed Results
|
⛔️ Test failed Results
|
Summary
Alert correlation-like rule that parses the script_block_id from the message field so we can alert when PowerShell scripts trigger multiple PowerShell rules.
Shorter description:
Identifies PowerShell script blocks associated with multiple distinct detections, indicating likely malicious behavior.
Sample Match