Multiple Rare Elastic Defend Behavior Rules by Host
Identifies hosts that triggered multiple distinct Elastic Defend behavior rules, while reducing false positives by considering only behavior rules that appear on a single host globally (via INLINE STATS). Hosts with two or more such rare behavior rules are more likely to be compromised and warrant prioritized triage.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/02/19"
3maturity = "production"
4min_stack_comments = "ES|QL inline stats became generally available in 9.3.0"
5min_stack_version = "9.4.0"
6updated_date = "2026/11/03"
7
8[rule]
9author = ["Elastic"]
10description = """
11Identifies hosts that triggered multiple distinct Elastic Defend behavior rules, while reducing false positives by
12considering only behavior rules that appear on a single host globally (via INLINE STATS). Hosts with two or more
13such rare behavior rules are more likely to be compromised and warrant prioritized triage.
14"""
15from = "now-60m"
16interval = "30m"
17language = "esql"
18license = "Elastic License v2"
19name = "Multiple Rare Elastic Defend Behavior Rules by Host"
20risk_score = 99
21rule_id = "c4f7a2b1-5d8e-4c3a-9b6e-2f1a0d8c7e5b"
22severity = "critical"
23tags = [
24 "Use Case: Threat Detection",
25 "Rule Type: Higher-Order Rule",
26 "Resources: Investigation Guide",
27 "Data Source: Elastic Defend",
28 "Noise: Medium",
29 "Performance: Fast",
30 "Rule Type: ES|QL",
31 "Domain: Endpoint",
32]
33timestamp_override = "event.ingested"
34type = "esql"
35
36query = '''
37from logs-endpoint.alerts-* metadata _id
38| where data_stream.dataset == "endpoint.alerts" and event.code == "behavior"
39| INLINE STATS hosts = COUNT_DISTINCT(host.id) BY rule.name
40// excludes rules triggering on multiple hosts to reduce potential FPs
41| where hosts == 1
42| stats Esql.rule_name_count_distinct = COUNT_DISTINCT(rule.name),
43 Esql.rule_name_values = VALUES(rule.name),
44 Esql.process_executable_values = VALUES(process.executable),
45 Esql.process_parent_executable_values = VALUES(process.parent.executable),
46 Esql.process_command_line_values = VALUES(process.command_line),
47 Esql.process_parent_command_line_values = VALUES(process.parent.command_line),
48 Esql.process_hash_sha256_values = VALUES(process.hash.sha256),
49 Esql.file_path_values = VALUES(file.path),
50 Esql.dll_path_values = VALUES(dll.path),
51 Esql.dll_hash_sha256_values = VALUES(dll.hash.sha256),
52 Esql.user_name_values = VALUES(user.name) by host.id
53// at least 2 unique rules
54| where Esql.rule_name_count_distinct >= 2
55// populate fields to use in rule exceptions
56| eval process.hash.sha256 = MV_FIRST(Esql.process_hash_sha256_values),
57 process.executable = MV_FIRST(Esql.process_executable_values),
58 process.parent.executable = MV_FIRST(Esql.process_parent_executable_values),
59 process.command_line = MV_FIRST(Esql.process_command_line_values),
60 user.name = MV_FIRST(Esql.user_name_values)
61| Keep host.id, user.name, process.executable, process.parent.executable, process.hash.sha256, process.command_line, Esql.*
62'''
63note = """## Triage and analysis
64
65> **Disclaimer**:
66> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
67
68### Investigating Multiple Rare Elastic Defend Behavior Rules by Host
69
70This rule correlates Elastic Defend behavior alerts by host and applies a global prevalence filter: only behavior rules that fire on a single host in the lookback window are considered. Hosts that trigger two or more such rare behavior rules are flagged, as this pattern is more likely to indicate real compromise than commonly seen behavior rules.
71
72### Possible investigation steps
73
74- Review the listed behavior rule names and the associated process command lines (and parent command lines) to understand what actions triggered the alerts.
75- Identify the user(s) associated with the activity and confirm whether the behavior is expected for that role or host.
76- Correlate with other endpoint and network data for the host (process, network, file events) to assess scope and persistence.
77- Compare timestamps of the alerts to determine if activity is part of a single campaign or staged execution.
78
79### False positive analysis
80
81- The global prevalence filter (rules seen on only one host) reduces noise from behavior rules that fire widely (e.g., common software or policy). If legitimate single-host tools or scripts trigger multiple rare behavior rules, consider documenting and excluding known-good rule names or hosts.
82- Development or testing hosts may exhibit multiple rare behaviors; consider lowering severity or excluding those hosts if appropriate.
83
84### Response and remediation
85
86- Isolate the host if triage indicates compromise, then follow standard incident response procedures.
87- Collect and preserve artifacts (process hashes, command lines, files) for further analysis.
88- Escalate to the security team for full investigation and potential containment or eradication actions.
89"""
90references = [
91"https://www.elastic.co/docs/reference/query-languages/esql/commands/inlinestats-by",
92"https://github.com/elastic/protections-artifacts/tree/main/behavior"
93]
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating Multiple Rare Elastic Defend Behavior Rules by Host
This rule correlates Elastic Defend behavior alerts by host and applies a global prevalence filter: only behavior rules that fire on a single host in the lookback window are considered. Hosts that trigger two or more such rare behavior rules are flagged, as this pattern is more likely to indicate real compromise than commonly seen behavior rules.
Possible investigation steps
- Review the listed behavior rule names and the associated process command lines (and parent command lines) to understand what actions triggered the alerts.
- Identify the user(s) associated with the activity and confirm whether the behavior is expected for that role or host.
- Correlate with other endpoint and network data for the host (process, network, file events) to assess scope and persistence.
- Compare timestamps of the alerts to determine if activity is part of a single campaign or staged execution.
False positive analysis
- The global prevalence filter (rules seen on only one host) reduces noise from behavior rules that fire widely (e.g., common software or policy). If legitimate single-host tools or scripts trigger multiple rare behavior rules, consider documenting and excluding known-good rule names or hosts.
- Development or testing hosts may exhibit multiple rare behaviors; consider lowering severity or excluding those hosts if appropriate.
Response and remediation
- Isolate the host if triage indicates compromise, then follow standard incident response procedures.
- Collect and preserve artifacts (process hashes, command lines, files) for further analysis.
- Escalate to the security team for full investigation and potential containment or eradication actions.
References
Related rules
- Elastic Defend Alert from GenAI Utility or Descendant
- LLM-Based Attack Chain Triage by Host
- Newly Observed Elastic Defend Behavior Alert
- Elastic Defend and Email Alerts Correlation
- Elastic Defend and Network Security Alerts Correlation