Conversation
Contributor
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
|
w0rk3r
commented
May 1, 2026
Comment on lines
-115
to
-123
| "ipinfo.io", | ||
| "geoplugin.net", | ||
| "myip.dnsomatic.com", | ||
| "www.geoplugin.net", | ||
| "api64.ipify.org", | ||
| "ip4.seeip.org", | ||
| "*.geojs.io", | ||
| "*portmap.io", | ||
| "api.2ip.ua", |
w0rk3r
commented
May 1, 2026
|
|
||
| ( | ||
| (process.executable : ("?:\\Users\\*\\AppData\\*\\node.exe", "\\Device\\HarddiskVolume?\\\\Users\\*\\AppData\\*\\node.exe") and process.args : "*.js") or | ||
| (process.executable : ("?:\\Users\\*\\AppData\\*\\node.exe", "\\Device\\HarddiskVolume*\\Users\\*\\AppData\\*\\node.exe") and process.args : "*.js") or |
Contributor
Author
There was a problem hiding this comment.
\\Device\\HarddiskVolume?\\\\ would never trigger
w0rk3r
commented
May 1, 2026
Comment on lines
+42
to
+59
| | keep kibana.alert.rule.name, Esql.script_block_id, _id, user.id, process.pid, host.id | ||
|
|
||
| // count distinct alerts and filter for matches above the threshold | ||
| | stats | ||
| Esql.kibana_alert_rule_name_count_distinct = count_distinct(kibana.alert.rule.name), | ||
| Esql.kibana_alert_rule_name_values = values(kibana.alert.rule.name), | ||
| Esql._id_values = values(_id) | ||
| Esql._id_values = values(_id), | ||
| Esql.user_id_values = values(user.id), | ||
| Esql.process_pid_values = values(process.pid), | ||
| Esql.host_id_values = values(host.id) | ||
| by Esql.script_block_id | ||
|
|
||
| // Apply detection threshold | ||
| | where Esql.kibana_alert_rule_name_count_distinct >= 5 | ||
| | eval user.id = MV_MIN(Esql.user_id_values), | ||
| process.pid = MV_MIN(Esql.process_pid_values), | ||
| host.id = MV_MIN(Esql.host_id_values) | ||
| | keep host.id, user.id, process.pid, Esql.* |
Contributor
Author
There was a problem hiding this comment.
Adds some fields that will be used to help investigation/pivots
Contributor
There was a problem hiding this comment.
user.id --> Esql.user_id_values --> user.id 🥇
Mikaayenson
approved these changes
May 1, 2026
Comment on lines
+40
to
+48
| not dll.code_signature.status : ("errorExpired", "errorRevoked", "errorCode_endpoint:*") and | ||
|
|
||
| /* HP DOT4 printer driver family FPs (Dot4.sys, Dot4Prt.sys, Dot4usb.sys, Dot4Scan.sys) */ | ||
| not dll.hash.sha256 : ( | ||
| "f21c1d478180bc5e932bb2c2e4618e3ed463ca87acedeb139682d218435f82f1", | ||
| "7e2f2a139e897eae56038b920bda9381094bc0ae9e626f6634e6b444b8b0c91f", | ||
| "12ffdf5f48a79b1b4adbb88ba2cb6c59dd6719554e8ea6beefe99b3e3c66f1ac", | ||
| "dbc6afaf80141e2480e19878f581edfe9c2b018da2ec527c4025ff04d5587afd" | ||
| ) |
|
⛔️ Test failed Results
|
Aegrah
approved these changes
May 4, 2026
|
|
||
| - What resident service or device identity is tied to the loaded image? | ||
| - Focus: compare `dll.path`, `dll.hash.sha256`, and `dll.code_signature.subject_name` with current Osquery driver inventory and service output. | ||
| - Hint: Run `$osquery_0` for non-Microsoft drivers by `image`, `service`, `signed`, `subject_name`, and `VtLink`; use it as current-state context, and keep the alert as the historical load record if no matching image exists. |
Contributor
There was a problem hiding this comment.
How does this look with osquery investigation + investigations supplied in the docs? Was this tested/validated to look clean?
Contributor
Author
Comment on lines
+42
to
+59
| | keep kibana.alert.rule.name, Esql.script_block_id, _id, user.id, process.pid, host.id | ||
|
|
||
| // count distinct alerts and filter for matches above the threshold | ||
| | stats | ||
| Esql.kibana_alert_rule_name_count_distinct = count_distinct(kibana.alert.rule.name), | ||
| Esql.kibana_alert_rule_name_values = values(kibana.alert.rule.name), | ||
| Esql._id_values = values(_id) | ||
| Esql._id_values = values(_id), | ||
| Esql.user_id_values = values(user.id), | ||
| Esql.process_pid_values = values(process.pid), | ||
| Esql.host_id_values = values(host.id) | ||
| by Esql.script_block_id | ||
|
|
||
| // Apply detection threshold | ||
| | where Esql.kibana_alert_rule_name_count_distinct >= 5 | ||
| | eval user.id = MV_MIN(Esql.user_id_values), | ||
| process.pid = MV_MIN(Esql.process_pid_values), | ||
| host.id = MV_MIN(Esql.host_id_values) | ||
| | keep host.id, user.id, process.pid, Esql.* |
Contributor
There was a problem hiding this comment.
user.id --> Esql.user_id_values --> user.id 🥇
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
w0rk3r
commented
May 4, 2026
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
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.

Issues
Part of https://github.com/elastic/ia-trade-team/issues/619
Part of https://github.com/elastic/ia-trade-team/issues/844
Part of https://github.com/elastic/ia-trade-team/issues/205
Part of https://github.com/elastic/ia-trade-team/issues/636
Summary
This PR fixes/improves our Windows rules by:
Screenshots / Sample
Highlighted Fields:

Investigation Guides: Investigate Plugin
Clicking the investigation plugins launches Timeline with field values populated dynamically from alert fields.