Behavior - Detected - Elastic Defend
Generates a detection alert each time an Elastic Defend alert for malicious behavior is received. Enabling this rule allows you to immediately begin investigating your Endpoint behavior alerts. This rule identifies Elastic Defend behavior detections only, and does not include prevention alerts.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2024/03/24"
3integration = ["endpoint"]
4maturity = "production"
5min_stack_comments = "Defend alerting adjustments patch to distinguish prevention and detection."
6min_stack_version = "8.16.0"
7promotion = true
8updated_date = "2025/03/21"
9
10[rule]
11author = ["Elastic"]
12description = """
13Generates a detection alert each time an Elastic Defend alert for malicious behavior is received. Enabling this rule
14allows you to immediately begin investigating your Endpoint behavior alerts. This rule identifies Elastic Defend
15behavior detections only, and does not include prevention alerts.
16"""
17enabled = false
18from = "now-2m"
19index = ["logs-endpoint.alerts-*"]
20interval = "1m"
21language = "kuery"
22license = "Elastic License v2"
23max_signals = 1000
24name = "Behavior - Detected - Elastic Defend"
25note = """## Triage and analysis
26
27### Investigating Behavior - Detected - Elastic Defend
28
29Malicious behavior protection is a foundational feature which can be used to protect against all manner of attacks on the endpoint. For example, it provides coverage against phishing such as malicious macros, many malware families based on their activities, privilege escalation attacks such as user account control bypasses (UAC), credential theft, and much more. It works by consuming an unfiltered feed of all events that are captured on the system (process, file, registry, network, dns, etc). These events are processed against a routinely updated set of rules written by Elastic threat experts. From there, malicious behaviors are identified and offending processes are terminated. The protection operates on the event stream asynchronously, but has been designed to be extremely efficient and typically requires just milliseconds (under standard load) to stop malicious activity.
30
31### Possible investigation steps
32
33- Assess whether this activity is prevalent in your environment by looking for similar occurrences across hosts.
34- Verify the detailed activity of the process that triggered the alert (process tree, child process, process arguments, network, files, libraries and registry events).
35- Verify the activity of the `user.name` associated with the alert (local or remote actity, privileged or standard user).
36- Particular attention should be paid to instances where the same process is triggering multiple alerts (more than 2 or 3) within a short period of time.
37- Even the the process is signed by a valid certificate, verify the if it's running from the expected location or if it's loading any suspicious libraries or any sign of code injection.
38
39### False positive analysis
40
41- Same alert observed on a high number of hosts with similar details.
42- High count of the same alert on a specific host over a long period of time.
43
44### Response and Remediation
45
46- Initiate the incident response process based on the outcome of the triage.
47 - If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
48- Implement Elastic Endpoint Security to detect and prevent further post exploitation activities in the environment.
49 - Contain the affected system by isolating it from the network to prevent further spread of the attack.
50- If the triage identified malware, search the environment for additional compromised hosts.
51 - Implement temporary network rules, procedures, and segmentation to contain the malware.
52 - Stop suspicious processes.
53 - Immediately block the identified indicators of compromise (IoCs).
54 - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
55- Remove and block malicious artifacts identified during triage.
56- Restore the affected system to its operational state by applying any necessary patches, updates, or configuration changes.
57- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
58- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
59- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
60- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
61"""
62references = [
63 "https://github.com/elastic/protections-artifacts/tree/main/behavior",
64 "https://docs.elastic.co/en/integrations/endpoint",
65]
66risk_score = 47
67rule_id = "0f615fe4-eaa2-11ee-ae33-f661ea17fbce"
68rule_name_override = "message"
69setup = """## Setup
70
71### Elastic Defend Alerts
72This rule is designed to capture specific alerts generated by Elastic Defend.
73
74To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules:
75
76Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce)
77Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce)
78Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce)
79Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce)
80Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce)
81Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce)
82Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce)
83Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce)
84
85To avoid generating duplicate alerts, you should enable either all feature-specific protection rules or the Endpoint Security (Elastic Defend) rule (UUID: 9a1a2dae-0b5f-4c3d-8305-a268d404c306).
86
87### Additional notes
88
89For information on troubleshooting the maximum alerts warning please refer to this [guide](https://www.elastic.co/guide/en/security/current/alerts-ui-monitor.html#troubleshoot-max-alerts).
90"""
91severity = "medium"
92tags = ["Data Source: Elastic Defend", "Resources: Investigation Guide"]
93timestamp_override = "event.ingested"
94type = "query"
95
96query = '''
97event.kind : alert and event.code : behavior and (event.type : allowed or (event.type: denied and event.outcome: failure))
98'''
99
100
101[[rule.exceptions_list]]
102id = "endpoint_list"
103list_id = "endpoint_list"
104namespace_type = "agnostic"
105type = "endpoint"
106
107[[rule.risk_score_mapping]]
108field = "event.risk_score"
109operator = "equals"
110value = ""
111
112[[rule.severity_mapping]]
113field = "event.severity"
114operator = "equals"
115severity = "low"
116value = "21"
117
118[[rule.severity_mapping]]
119field = "event.severity"
120operator = "equals"
121severity = "medium"
122value = "47"
123
124[[rule.severity_mapping]]
125field = "event.severity"
126operator = "equals"
127severity = "high"
128value = "73"
129
130[[rule.severity_mapping]]
131field = "event.severity"
132operator = "equals"
133severity = "critical"
134value = "99"
Triage and analysis
Investigating Behavior - Detected - Elastic Defend
Malicious behavior protection is a foundational feature which can be used to protect against all manner of attacks on the endpoint. For example, it provides coverage against phishing such as malicious macros, many malware families based on their activities, privilege escalation attacks such as user account control bypasses (UAC), credential theft, and much more. It works by consuming an unfiltered feed of all events that are captured on the system (process, file, registry, network, dns, etc). These events are processed against a routinely updated set of rules written by Elastic threat experts. From there, malicious behaviors are identified and offending processes are terminated. The protection operates on the event stream asynchronously, but has been designed to be extremely efficient and typically requires just milliseconds (under standard load) to stop malicious activity.
Possible investigation steps
- Assess whether this activity is prevalent in your environment by looking for similar occurrences across hosts.
- Verify the detailed activity of the process that triggered the alert (process tree, child process, process arguments, network, files, libraries and registry events).
- Verify the activity of the
user.name
associated with the alert (local or remote actity, privileged or standard user). - Particular attention should be paid to instances where the same process is triggering multiple alerts (more than 2 or 3) within a short period of time.
- Even the the process is signed by a valid certificate, verify the if it's running from the expected location or if it's loading any suspicious libraries or any sign of code injection.
False positive analysis
- Same alert observed on a high number of hosts with similar details.
- High count of the same alert on a specific host over a long period of time.
Response and Remediation
- Initiate the incident response process based on the outcome of the triage.
- If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
- Implement Elastic Endpoint Security to detect and prevent further post exploitation activities in the environment.
- Contain the affected system by isolating it from the network to prevent further spread of the attack.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Restore the affected system to its operational state by applying any necessary patches, updates, or configuration changes.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
References
Related rules
- Behavior - Prevented - Elastic Defend
- Endpoint Security (Elastic Defend)
- Malicious File - Detected - Elastic Defend
- Malicious File - Prevented - Elastic Defend
- Memory Threat - Detected - Elastic Defend