Behavior - Prevented - 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 preventions only, and does not include detection only alerts.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2024/03/24"
3integration = ["endpoint"]
4maturity = "production"
5promotion = true
6updated_date = "2025/07/02"
7
8[rule]
9author = ["Elastic"]
10description = """
11Generates a detection alert each time an Elastic Defend alert for malicious behavior is received. Enabling this rule
12allows you to immediately begin investigating your Endpoint behavior alerts. This rule identifies Elastic Defend
13behavior preventions only, and does not include detection only alerts.
14"""
15enabled = false
16from = "now-2m"
17index = ["logs-endpoint.alerts-*"]
18interval = "1m"
19language = "kuery"
20license = "Elastic License v2"
21max_signals = 1000
22name = "Behavior - Prevented - Elastic Defend"
23note = """## Triage and analysis
24
25### Investigating Behavior - Prevented - Elastic Defend
26
27Malicious 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.
28
29### Possible investigation steps
30
31- Assess whether this activity is prevalent in your environment by looking for similar occurrences across hosts.
32- Verify the detailed activity of the process that triggered the alert (process tree, child process, process arguments, network, files, libraries and registry events).
33- Verify the activity of the `user.name` associated with the alert (local or remote actity, privileged or standard user).
34- 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.
35- 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.
36
37
38### False positive analysis
39
40- Same alert observed on a high number of hosts with similar details.
41- High count of the same alert on a specific host over a long period of time.
42
43### Response and Remediation
44
45- Initiate the incident response process based on the outcome of the triage.
46 - If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
47- Implement Elastic Endpoint Security to detect and prevent further post exploitation activities in the environment.
48 - Contain the affected system by isolating it from the network to prevent further spread of the attack.
49- If the triage identified malware, search the environment for additional compromised hosts.
50 - Implement temporary network rules, procedures, and segmentation to contain the malware.
51 - Stop suspicious processes.
52 - Immediately block the identified indicators of compromise (IoCs).
53 - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
54- Remove and block malicious artifacts identified during triage.
55- Restore the affected system to its operational state by applying any necessary patches, updates, or configuration changes.
56- 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.
57- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
58- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
59- 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).
60"""
61references = [
62 "https://github.com/elastic/protections-artifacts/tree/main/behavior",
63 "https://docs.elastic.co/en/integrations/endpoint",
64]
65risk_score = 21
66rule_id = "eb804972-ea34-11ee-a417-f661ea17fbce"
67rule_name_override = "message"
68setup = """## Setup
69
70### Elastic Defend Alerts
71This rule is designed to capture specific alerts generated by Elastic Defend.
72
73To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules:
74
75Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce)
76Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce)
77Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce)
78Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce)
79Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce)
80Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce)
81Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce)
82Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce)
83
84To 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).
85
86### Additional notes
87
88For 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).
89"""
90severity = "low"
91tags = ["Data Source: Elastic Defend", "Resources: Investigation Guide"]
92timestamp_override = "event.ingested"
93type = "query"
94
95query = '''
96event.kind : alert and event.code : behavior and event.type : denied and event.outcome : success
97'''
98
99
100[[rule.exceptions_list]]
101id = "endpoint_list"
102list_id = "endpoint_list"
103namespace_type = "agnostic"
104type = "endpoint"
105
106[[rule.risk_score_mapping]]
107field = "event.risk_score"
108operator = "equals"
109value = ""
110
111[[rule.severity_mapping]]
112field = "event.severity"
113operator = "equals"
114severity = "low"
115value = "21"
116
117[[rule.severity_mapping]]
118field = "event.severity"
119operator = "equals"
120severity = "medium"
121value = "47"
122
123[[rule.severity_mapping]]
124field = "event.severity"
125operator = "equals"
126severity = "high"
127value = "73"
128
129[[rule.severity_mapping]]
130field = "event.severity"
131operator = "equals"
132severity = "critical"
133value = "99"
Triage and analysis
Investigating Behavior - Prevented - 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 - Detected - Elastic Defend
- File Creation in /var/log via Suspicious Process
- Malicious File - Detected - Elastic Defend
- Malicious File - Prevented - Elastic Defend
- Memory Threat - Detected - Elastic Defend