-
Notifications
You must be signed in to change notification settings - Fork 612
[Rule Tuning] PowerShell Rules - Misc Tuning/Severity Bumps #5486
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| creation_date = "2025/04/15" | ||
| integration = ["windows"] | ||
| maturity = "production" | ||
| updated_date = "2025/12/09" | ||
| updated_date = "2025/12/17" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
|
|
@@ -117,8 +117,8 @@ from logs-windows.powershell_operational* metadata _id, _version, _index | |
| agent.id, | ||
| user.id | ||
|
|
||
| // Filter for scripts that match the pattern at least 10 times | ||
| | where Esql.script_block_pattern_count >= 10 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see many FPs with current count, any reason to bump it up ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not noisy, but from what I saw, there was like 1 TP below 20, and 110 FPs |
||
| // Filter for scripts that match the pattern at least 20 times | ||
| | where Esql.script_block_pattern_count >= 20 | ||
|
|
||
| | where file.name not like "TSS_*.psm1" | ||
| // ESQL requires this condition, otherwise it only returns matches where file.name exists. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| creation_date = "2025/04/16" | ||
| integration = ["windows"] | ||
| maturity = "production" | ||
| updated_date = "2025/12/09" | ||
| updated_date = "2025/12/17" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
|
|
@@ -119,12 +119,15 @@ from logs-windows.powershell_operational* metadata _id, _version, _index | |
| user.id | ||
|
|
||
| // Filter for scripts with high numeric character ratio | ||
| | where Esql.script_block_ratio > 0.30 | ||
| | where Esql.script_block_ratio > 0.35 | ||
|
|
||
| // Exclude Windows Defender Noisy Patterns | ||
| | where not ( | ||
| file.directory == "C:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Downloads" or | ||
| file.directory like "C:\\\\ProgramData\\\\Microsoft\\\\Windows Defender Advanced Threat Protection\\\\DataCollection*" | ||
| file.directory like ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should double check that this is not minstacked to a specific version (e.g. 9.1.0). It's hard to tell in the docs.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per the PR tags, it is 8.19 and up: elastic/elasticsearch#129170
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "C:\\\\ProgramData\\\\Microsoft\\\\Windows Defender Advanced Threat Protection\\\\DataCollection*", | ||
| "C:\\\\Program Files\\\\SentinelOne\\\\Sentinel Agent*" | ||
| ) | ||
| ) | ||
| // ESQL requires this condition, otherwise it only returns matches where file.directory exists. | ||
| or file.directory is null | ||
|
|
||
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.
see some execution error on some clusters like:
maybe agent.id is not always defined in Windows integration ?
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.
It should be, anything collected with using Elastic Agent has a agent.id (AFAIK)