diff --git a/rules/integrations/endpoint/defense_evasion_elastic_memory_threat_detected.toml b/rules/integrations/endpoint/defense_evasion_elastic_memory_threat_detected.toml new file mode 100644 index 00000000000..75cc6cf6a57 --- /dev/null +++ b/rules/integrations/endpoint/defense_evasion_elastic_memory_threat_detected.toml @@ -0,0 +1,175 @@ +[metadata] +creation_date = "2024/03/24" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "Defend alerting adjustments patch to distinguish prevention and detection." +min_stack_version = "8.16.0" +promotion = true +updated_date = "2024/11/26" + +[rule] +author = ["Elastic"] +description = """ +Generates a detection alert each time an Elastic Defend alert for memory signatures are received. Enabling this rule +allows you to immediately begin investigating your Endpoint memory signature alerts. This rule identifies Elastic Defend +memory signature detections only, and does not include prevention alerts. +""" +enabled = false +from = "now-10m" +index = ["logs-endpoint.alerts-*"] +interval = "5m" +language = "kuery" +license = "Elastic License v2" +max_signals = 10000 +name = "Memory Threat - Detected - Elastic Defend" +note = """## Triage and analysis + +### Investigating Memory Threat Alerts + +Elastic Endpoint’s memory threat protection adds a layer of coverage for advanced attacks which avoid the traditional approach of writing payloads to disk. Instead, the malicious code runs only in-memory, an effective technique for evading legacy security products. There are currently two sub-categories of memory threat protection. + +The first category is referred to as memory signatures and is available on all supported OS. It operates by periodically scanning process executable memory regions based on their activity to identify and terminate known bad malware. + +The second category is referred to as shellcode thread and is unique to Windows endpoints today. A common technique of in-memory malware is to load the payload in a memory region not backed by a file on disk and create a thread to execute it. + + +### Possible investigation steps + +- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures. +- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts : + - For shellcode alerts, the key for bucketing alerts is stored in the `Memory_protection.unique_key_v1` field. + - For Memory signature alerts, bucket based on the signatures which match `rule.name`. +- Examine the following fields if there are any matches on known Yara signatures: + - `process.Ext.memory_region.malware_signature.all_names` + - `Target.process.Ext.memory_region.malware_signature.all_names` + - `process.Ext.memory_region.malware_signature.primary.signature.name` +- Review the memory region strings for any suspicious or unique keywords captured in `process.Ext.memory_region.strings` and `Target.process.Ext.memory_region.strings`. +- For signature matches review the `process.Ext.memory_region.malware_signature.primary.matches` and `process.Ext.memory_region.malware_signature.secondary.matches` to understand which keywords or byte sequences matched on the memory Yara signature. +- For shellcode alerts, check the field `Memory_protection.self_injection` value, if it's false it means it's a remote shellcode injection and you need to review the Target process details like `Target.process.executable` fields. +- Even if the acting process is signed, review any unsigned or suspicious loaded libraries (adversaries may use `DLL Side-Loading`) captured in: + - `process.thread.Ext.call_stack.module_path` + - `process.Ext.dll.path and process.Ext.dll.hash.sha256` + - `Target.process.Ext.dll.hash.sha256` + - `Target.process.Ext.dll.path` +- If you have access to VirusTotal of similar services, you can also perform vGrep searches to look for files with bytes matching on `process.thread.Ext.start_address_bytes` or `Target.process.thread.Ext.start_address_bytes`. +- Investigate any abnormal behavior by the subject process, such as network connections, registry or file modifications, and any spawned child processes. + +### False positive analysis + +- False positives may include Yara signature matches on generic keywords or some third party softwares performing code injection (often all involved files are signed and by the same vendor). + +### 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 = [ + "https://github.com/elastic/protections-artifacts/tree/main/yara", + "https://docs.elastic.co/en/integrations/endpoint", +] +risk_score = 73 +rule_id = "017de1e4-ea35-11ee-a417-f661ea17fbce" +rule_name_override = "message" +setup = """## Setup + +### Elastic Defend Alerts +This rule is designed to capture specific alerts generated by Elastic Defend. + +To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules: + +Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce) +Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce) +Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce) +Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce) +Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce) +Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce) +Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce) +Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce) + +To 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). + +### Additional notes +This rule is configured to generate more **Max alerts per run** than the default 1000 alerts per run set for all rules. This is to ensure that it captures as many alerts as possible. + +**IMPORTANT:** The rule's **Max alerts per run** setting can be superseded by the `xpack.alerting.rules.run.alerts.max` Kibana config setting, which determines the maximum alerts generated by _any_ rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, this rule will still generate no more than 1000 alerts even if its own **Max alerts per run** is set higher. + +To make sure this rule can generate as many alerts as it's configured in its own **Max alerts per run** setting, increase the `xpack.alerting.rules.run.alerts.max` system setting accordingly. + +**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects. +""" +severity = "high" +tags = ["Data Source: Elastic Defend", "Tactic: Defense Evasion"] +timestamp_override = "event.ingested" +type = "query" + +query = ''' +event.kind : alert and event.code : (memory_signature or shellcode_thread) and (event.type : allowed or (event.type: denied and event.outcome: failure)) +''' + + +[[rule.exceptions_list]] +id = "endpoint_list" +list_id = "endpoint_list" +namespace_type = "agnostic" +type = "endpoint" + +[[rule.risk_score_mapping]] +field = "event.risk_score" +operator = "equals" +value = "" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "low" +value = "21" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "medium" +value = "47" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "high" +value = "73" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "critical" +value = "99" + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1055" +name = "Process Injection" +reference = "https://attack.mitre.org/techniques/T1055/" + +[[rule.threat.technique]] +id = "T1620" +name = "Reflective Code Loading" +reference = "https://attack.mitre.org/techniques/T1620/" + + +[rule.threat.tactic] +id = "TA0005" +name = "Defense Evasion" +reference = "https://attack.mitre.org/tactics/TA0005/" + diff --git a/rules/integrations/endpoint/defense_evasion_elastic_memory_threat_prevented.toml b/rules/integrations/endpoint/defense_evasion_elastic_memory_threat_prevented.toml new file mode 100644 index 00000000000..448200a5aa2 --- /dev/null +++ b/rules/integrations/endpoint/defense_evasion_elastic_memory_threat_prevented.toml @@ -0,0 +1,174 @@ +[metadata] +creation_date = "2024/03/24" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "Defend alerting adjustments patch to distinguish prevention and detection." +min_stack_version = "8.16.0" +promotion = true +updated_date = "2024/11/26" + +[rule] +author = ["Elastic"] +description = """ +Generates a detection alert each time an Elastic Defend alert for memory signatures are received. Enabling this rule +allows you to immediately begin investigating your Endpoint memory signature alerts. This rule identifies Elastic Defend +memory signature preventions only, and does not include detection only alerts. +""" +enabled = false +from = "now-10m" +index = ["logs-endpoint.alerts-*"] +interval = "5m" +language = "kuery" +license = "Elastic License v2" +max_signals = 10000 +name = "Memory Threat - Prevented- Elastic Defend" +note = """## Triage and analysis + +### Investigating Memory Threat Alerts + +Elastic Endpoint’s memory threat protection adds a layer of coverage for advanced attacks which avoid the traditional approach of writing payloads to disk. Instead, the malicious code runs only in-memory, an effective technique for evading legacy security products. There are currently two sub-categories of memory threat protection. + +The first category is referred to as memory signatures and is available on all supported OS. It operates by periodically scanning process executable memory regions based on their activity to identify and terminate known bad malware. + +The second category is referred to as shellcode thread and is unique to Windows endpoints today. A common technique of in-memory malware is to load the payload in a memory region not backed by a file on disk and create a thread to execute it. + +### Possible investigation steps + +- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures. +- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts : + - For shellcode alerts, the key for bucketing alerts is stored in the `Memory_protection.unique_key_v1` field. + - For Memory signature alerts, bucket based on the signatures which match `rule.name`. +- Examine the following fields if there are any matches on known Yara signatures: + - `process.Ext.memory_region.malware_signature.all_names` + - `Target.process.Ext.memory_region.malware_signature.all_names` + - `process.Ext.memory_region.malware_signature.primary.signature.name` +- Review the memory region strings for any suspicious or unique keywords captured in `process.Ext.memory_region.strings` and `Target.process.Ext.memory_region.strings`. +- For signature matches review the `process.Ext.memory_region.malware_signature.primary.matches` and `process.Ext.memory_region.malware_signature.secondary.matches` to understand which keywords or byte sequences matched on the memory Yara signature. +- For shellcode alerts, check the field `Memory_protection.self_injection` value, if it's false it means it's a remote shellcode injection and you need to review the Target process details like `Target.process.executable` fields. +- Even if the acting process is signed, review any unsigned or suspicious loaded libraries (adversaries may use `DLL Side-Loading`) captured in: + - `process.thread.Ext.call_stack.module_path` + - `process.Ext.dll.path and process.Ext.dll.hash.sha256` + - `Target.process.Ext.dll.hash.sha256` + - `Target.process.Ext.dll.path` +- If you have access to VirusTotal of similar services, you can also perform vGrep searches to look for files with bytes matching on `process.thread.Ext.start_address_bytes` or `Target.process.thread.Ext.start_address_bytes`. +- Investigate any abnormal behavior by the subject process, such as network connections, registry or file modifications, and any spawned child processes. + +### False positive analysis + +- False positives may include Yara signature matches on generic keywords or some third party software performing code injection (often all involved files are signed and by the same vendor). + +### 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 = [ + "https://github.com/elastic/protections-artifacts/tree/main/yara", + "https://docs.elastic.co/en/integrations/endpoint", +] +risk_score = 73 +rule_id = "06f3a26c-ea35-11ee-a417-f661ea17fbce" +rule_name_override = "message" +setup = """## Setup + +### Elastic Defend Alerts +This rule is designed to capture specific alerts generated by Elastic Defend. + +To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules: + +Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce) +Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce) +Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce) +Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce) +Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce) +Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce) +Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce) +Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce) + +To 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). + +### Additional notes +This rule is configured to generate more **Max alerts per run** than the default 1000 alerts per run set for all rules. This is to ensure that it captures as many alerts as possible. + +**IMPORTANT:** The rule's **Max alerts per run** setting can be superseded by the `xpack.alerting.rules.run.alerts.max` Kibana config setting, which determines the maximum alerts generated by _any_ rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, this rule will still generate no more than 1000 alerts even if its own **Max alerts per run** is set higher. + +To make sure this rule can generate as many alerts as it's configured in its own **Max alerts per run** setting, increase the `xpack.alerting.rules.run.alerts.max` system setting accordingly. + +**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects. +""" +severity = "high" +tags = ["Data Source: Elastic Defend", "Tactic: Defense Evasion"] +timestamp_override = "event.ingested" +type = "query" + +query = ''' +event.kind : alert and event.code : (memory_signature or shellcode_thread) and event.type : denied and event.outcome : success +''' + + +[[rule.exceptions_list]] +id = "endpoint_list" +list_id = "endpoint_list" +namespace_type = "agnostic" +type = "endpoint" + +[[rule.risk_score_mapping]] +field = "event.risk_score" +operator = "equals" +value = "" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "low" +value = "21" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "medium" +value = "47" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "high" +value = "73" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "critical" +value = "99" + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1055" +name = "Process Injection" +reference = "https://attack.mitre.org/techniques/T1055/" + +[[rule.threat.technique]] +id = "T1620" +name = "Reflective Code Loading" +reference = "https://attack.mitre.org/techniques/T1620/" + + +[rule.threat.tactic] +id = "TA0005" +name = "Defense Evasion" +reference = "https://attack.mitre.org/tactics/TA0005/" + diff --git a/rules/integrations/endpoint/elastic_endpoint_security.toml b/rules/integrations/endpoint/elastic_endpoint_security.toml index 7353bf7fcc6..37be3ddc9b9 100644 --- a/rules/integrations/endpoint/elastic_endpoint_security.toml +++ b/rules/integrations/endpoint/elastic_endpoint_security.toml @@ -2,13 +2,15 @@ creation_date = "2020/07/08" integration = ["endpoint"] maturity = "production" +min_stack_comments = "New fields added: required_fields, related_integrations, setup" +min_stack_version = "8.3.0" promotion = true -updated_date = "2024/05/21" +updated_date = "2024/11/27" [rule] author = ["Elastic"] description = """ -Generates a detection alert each time an Elastic Endpoint Security alert is received. Enabling this rule allows you to +Generates a detection alert each time an Elastic Defend alert is received. Enabling this rule allows you to immediately begin investigating your Endpoint alerts. """ enabled = true @@ -17,19 +19,38 @@ index = ["logs-endpoint.alerts-*"] language = "kuery" license = "Elastic License v2" max_signals = 10000 -name = "Endpoint Security" +name = "Endpoint Security (Elastic Defend)" + risk_score = 47 rule_id = "9a1a2dae-0b5f-4c3d-8305-a268d404c306" rule_name_override = "message" -setup = """## Setup +setup = """ +## Setup + +### Elastic Defend Alerts +If this rule is disabled, you will not receive alerts for Elastic Defend alerts. This rule is designed to capture all alerts generated by Elastic Defend. For more granular alerting, consider using additional prebuilt-rules that capture specific Elastic Defend alerts. + +If this rule is enabled, along with the related rules listed below, you will receive duplicate alerts for the same events. To avoid this, it is recommended to disable this generic rule and enable the more specific rules that capture these alerts separately. +Related rules: +- Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce) +- Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce) +- Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce) +- Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce) +- Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce) +- Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce) +- Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce) +- Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce) + +### Additional notes This rule is configured to generate more **Max alerts per run** than the default 1000 alerts per run set for all rules. This is to ensure that it captures as many alerts as possible. **IMPORTANT:** The rule's **Max alerts per run** setting can be superseded by the `xpack.alerting.rules.run.alerts.max` Kibana config setting, which determines the maximum alerts generated by _any_ rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, this rule will still generate no more than 1000 alerts even if its own **Max alerts per run** is set higher. To make sure this rule can generate as many alerts as it's configured in its own **Max alerts per run** setting, increase the `xpack.alerting.rules.run.alerts.max` system setting accordingly. -**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects.""" +**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects. +""" severity = "medium" tags = ["Data Source: Elastic Defend"] timestamp_override = "event.ingested" diff --git a/rules/integrations/endpoint/elastic_endpoint_security_behavior_detected.toml b/rules/integrations/endpoint/elastic_endpoint_security_behavior_detected.toml new file mode 100644 index 00000000000..b68ab164cce --- /dev/null +++ b/rules/integrations/endpoint/elastic_endpoint_security_behavior_detected.toml @@ -0,0 +1,141 @@ +[metadata] +creation_date = "2024/03/24" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "Defend alerting adjustments patch to distinguish prevention and detection." +min_stack_version = "8.16.0" +promotion = true +updated_date = "2024/11/26" + +[rule] +author = ["Elastic"] +description = """ +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. +""" +enabled = false +from = "now-10m" +index = ["logs-endpoint.alerts-*"] +interval = "5m" +language = "kuery" +license = "Elastic License v2" +max_signals = 10000 +name = "Behavior - Detected - Elastic Defend" +note = """## Triage and analysis + +### Investigating Behavior Alerts + +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 = [ + "https://github.com/elastic/protections-artifacts/tree/main/behavior", + "https://docs.elastic.co/en/integrations/endpoint", +] +risk_score = 47 +rule_id = "0f615fe4-eaa2-11ee-ae33-f661ea17fbce" +rule_name_override = "message" +setup = """## Setup + +### Elastic Defend Alerts +This rule is designed to capture specific alerts generated by Elastic Defend. + +To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules: + +Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce) +Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce) +Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce) +Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce) +Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce) +Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce) +Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce) +Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce) + +To 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). + +### Additional notes +This rule is configured to generate more **Max alerts per run** than the default 1000 alerts per run set for all rules. This is to ensure that it captures as many alerts as possible. + +**IMPORTANT:** The rule's **Max alerts per run** setting can be superseded by the `xpack.alerting.rules.run.alerts.max` Kibana config setting, which determines the maximum alerts generated by _any_ rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, this rule will still generate no more than 1000 alerts even if its own **Max alerts per run** is set higher. + +To make sure this rule can generate as many alerts as it's configured in its own **Max alerts per run** setting, increase the `xpack.alerting.rules.run.alerts.max` system setting accordingly. + +**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects. +""" +severity = "medium" +tags = ["Data Source: Elastic Defend"] +timestamp_override = "event.ingested" +type = "query" + +query = ''' +event.kind : alert and event.code : behavior and (event.type : allowed or (event.type: denied and event.outcome: failure)) +''' + + +[[rule.exceptions_list]] +id = "endpoint_list" +list_id = "endpoint_list" +namespace_type = "agnostic" +type = "endpoint" + +[[rule.risk_score_mapping]] +field = "event.risk_score" +operator = "equals" +value = "" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "low" +value = "21" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "medium" +value = "47" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "high" +value = "73" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "critical" +value = "99" + + diff --git a/rules/integrations/endpoint/elastic_endpoint_security_behavior_prevented.toml b/rules/integrations/endpoint/elastic_endpoint_security_behavior_prevented.toml new file mode 100644 index 00000000000..abaa4e2b2d5 --- /dev/null +++ b/rules/integrations/endpoint/elastic_endpoint_security_behavior_prevented.toml @@ -0,0 +1,142 @@ +[metadata] +creation_date = "2024/03/24" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "Defend alerting adjustments patch to distinguish prevention and detection." +min_stack_version = "8.16.0" +promotion = true +updated_date = "2024/11/26" + +[rule] +author = ["Elastic"] +description = """ +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. +""" +enabled = false +from = "now-10m" +index = ["logs-endpoint.alerts-*"] +interval = "5m" +language = "kuery" +license = "Elastic License v2" +max_signals = 10000 +name = "Behavior - Prevented - Elastic Defend" +note = """## Triage and analysis + +### Investigating Behavior Alerts + +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 = [ + "https://github.com/elastic/protections-artifacts/tree/main/behavior", + "https://docs.elastic.co/en/integrations/endpoint", +] +risk_score = 21 +rule_id = "eb804972-ea34-11ee-a417-f661ea17fbce" +rule_name_override = "message" +setup = """## Setup + +### Elastic Defend Alerts +This rule is designed to capture specific alerts generated by Elastic Defend. + +To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules: + +Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce) +Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce) +Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce) +Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce) +Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce) +Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce) +Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce) +Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce) + +To 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). + +### Additional notes +This rule is configured to generate more **Max alerts per run** than the default 1000 alerts per run set for all rules. This is to ensure that it captures as many alerts as possible. + +**IMPORTANT:** The rule's **Max alerts per run** setting can be superseded by the `xpack.alerting.rules.run.alerts.max` Kibana config setting, which determines the maximum alerts generated by _any_ rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, this rule will still generate no more than 1000 alerts even if its own **Max alerts per run** is set higher. + +To make sure this rule can generate as many alerts as it's configured in its own **Max alerts per run** setting, increase the `xpack.alerting.rules.run.alerts.max` system setting accordingly. + +**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects. +""" +severity = "low" +tags = ["Data Source: Elastic Defend"] +timestamp_override = "event.ingested" +type = "query" + +query = ''' +event.kind : alert and event.code : behavior and event.type : denied and event.outcome : success +''' + + +[[rule.exceptions_list]] +id = "endpoint_list" +list_id = "endpoint_list" +namespace_type = "agnostic" +type = "endpoint" + +[[rule.risk_score_mapping]] +field = "event.risk_score" +operator = "equals" +value = "" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "low" +value = "21" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "medium" +value = "47" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "high" +value = "73" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "critical" +value = "99" + + diff --git a/rules/integrations/endpoint/execution_elastic_malicious_file_detected.toml b/rules/integrations/endpoint/execution_elastic_malicious_file_detected.toml new file mode 100644 index 00000000000..e47f9f8b57e --- /dev/null +++ b/rules/integrations/endpoint/execution_elastic_malicious_file_detected.toml @@ -0,0 +1,166 @@ +[metadata] +creation_date = "2024/03/24" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "Defend alerting adjustments patch to distinguish prevention and detection." +min_stack_version = "8.16.0" +promotion = true +updated_date = "2024/11/26" + +[rule] +author = ["Elastic"] +description = """ +Generates a detection alert each time an Elastic Defend alert for malicious files is received. Enabling this rule allows +you to immediately begin investigating your Endpoint malicious file alerts. This rule identifies Elastic Defend +malicious file detections only, and does not include prevention alerts. +""" +enabled = false +from = "now-10m" +index = ["logs-endpoint.alerts-*"] +interval = "5m" +language = "kuery" +license = "Elastic License v2" +max_signals = 10000 +name = "Malicious File - Detected - Elastic Defend" +note = """## Triage and analysis + +### Investigating Malware Alerts + +Elastic Endpoint malware protection leverages a combination of supervised machine learning (ML) models (PE, MachO) and yara signatures. Our ML models are trained on hundreds of millions of executables and model updates are released approximately monthly. Our yara signatures are created with automated signature creation technologies built in-house along with hand-written rules by our threat researchers. + +Files are scanned on write or deletion, process executables are scanned on executions and libraries are scanned on load. You can differentiate these types by looking at the `event.action` field in the alert. It can be execution, `load`, `creation`, `modification`, or `deletion`. Scanning files written to disk is best effort, while execution or load scanning is done ‘in-line’ for true prevention. + +### Possible investigation steps + +- For machine learning (ML) malware alerts the `file.Ext.malware_classification.score` and `file.Ext.malware_classification.version` fields indicate which model version was used to classify the file and the classification score (0 to 1). +- For malware signature hits, `threat_name` is an important field which will guide the user on what malware family the sample belongs to. +- For Yara matches, Malware alerts do provide the specific binary content identified by the yara rule in the alert metadata (it is base64 encoded and stored in the `matches` field). +- A file can also hit on multiple Yara signatures. In the alert metadata, the `primary` signature (`malware_signature.primary`) will be whichever we determine to have the highest severity. +- Malicious file alerts for files in download directories or written by browsers, office applications, script interpreters or other lolbins are especially correlated with malicious activity. +- Particular attention should be paid to files located in suspicious directories like `Public` folder, `Downloads`, `Temp` and `ProgramData`. +- Verify if the file is signed or not using the `file.Ext.code_signature` field. Even if the file is signed with a valid certificate verify the global prevalance of that signed in your environment. +- Verify the malicious file timestamp metadata using `file.created`, `file.mtime` and `file.accessed` to asses exactly if it's an old or new infection. +- Investigate the activity of the process that created, modified or loaded the malicious file (parent process tree, process.command_line, child processes, network, registry and files events). +- Assess whether this file is prevalent in the environment by looking for similar occurrences across hosts by `file.hash.sha256` or by `file.name` patterns. +- Verify the activity of the `user.name` associated with Malware alert (local or remote actity, privileged or standard user). +- Verify if there are any other Alert types (Behavior or Memory Threat) associated with the same host or user or process within the same time. +### False positive analysis + +- Other endpoint security vendors especially with their quarantine folders. +- Dynamically generated or compiled executables such as from csc.exe or other compilers. Due to the dynamic nature, each instance will likely have a unique hash and no signer + +### 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 = [ + "https://github.com/elastic/protections-artifacts/tree/main/yara", + "https://docs.elastic.co/en/integrations/endpoint", +] +risk_score = 47 +rule_id = "f2c3caa6-ea34-11ee-a417-f661ea17fbce" +rule_name_override = "message" +setup = """## Setup + +### Elastic Defend Alerts +This rule is designed to capture specific alerts generated by Elastic Defend. + +To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules: + +Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce) +Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce) +Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce) +Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce) +Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce) +Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce) +Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce) +Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce) + +To 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). + +### Additional notes +This rule is configured to generate more **Max alerts per run** than the default 1000 alerts per run set for all rules. This is to ensure that it captures as many alerts as possible. + +**IMPORTANT:** The rule's **Max alerts per run** setting can be superseded by the `xpack.alerting.rules.run.alerts.max` Kibana config setting, which determines the maximum alerts generated by _any_ rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, this rule will still generate no more than 1000 alerts even if its own **Max alerts per run** is set higher. + +To make sure this rule can generate as many alerts as it's configured in its own **Max alerts per run** setting, increase the `xpack.alerting.rules.run.alerts.max` system setting accordingly. + +**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects. +""" +severity = "medium" +tags = ["Data Source: Elastic Defend", "Tactic: Execution"] +timestamp_override = "event.ingested" +type = "query" + +query = ''' +event.kind : alert and event.code : malicious_file and (event.type : allowed or (event.type: denied and event.outcome: failure)) +''' + + +[[rule.exceptions_list]] +id = "endpoint_list" +list_id = "endpoint_list" +namespace_type = "agnostic" +type = "endpoint" + +[[rule.risk_score_mapping]] +field = "event.risk_score" +operator = "equals" +value = "" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "low" +value = "21" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "medium" +value = "47" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "high" +value = "73" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "critical" +value = "99" + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1204" +name = "User Execution" +reference = "https://attack.mitre.org/techniques/T1204/" +[[rule.threat.technique.subtechnique]] +id = "T1204.002" +name = "Malicious File" +reference = "https://attack.mitre.org/techniques/T1204/002/" + + + +[rule.threat.tactic] +id = "TA0002" +name = "Execution" +reference = "https://attack.mitre.org/tactics/TA0002/" + diff --git a/rules/integrations/endpoint/execution_elastic_malicious_file_prevented.toml b/rules/integrations/endpoint/execution_elastic_malicious_file_prevented.toml new file mode 100644 index 00000000000..d85a79e2282 --- /dev/null +++ b/rules/integrations/endpoint/execution_elastic_malicious_file_prevented.toml @@ -0,0 +1,166 @@ +[metadata] +creation_date = "2024/03/24" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "Defend alerting adjustments patch to distinguish prevention and detection." +min_stack_version = "8.16.0" +promotion = true +updated_date = "2024/11/26" + +[rule] +author = ["Elastic"] +description = """ +Generates a detection alert each time an Elastic Defend alert for malicious files is received. Enabling this rule allows +you to immediately begin investigating your Endpoint malicious file alerts. This rule identifies Elastic Defend +malicious file preventions only, and does not include detection only alerts. +""" +enabled = false +from = "now-10m" +index = ["logs-endpoint.alerts-*"] +interval = "5m" +language = "kuery" +license = "Elastic License v2" +max_signals = 10000 +name = "Malicious File - Prevented - Elastic Defend" +note = """## Triage and analysis + +### Investigating Malware Alerts + +Elastic Endpoint malware protection leverages a combination of supervised machine learning (ML) models (PE, MachO) and yara signatures. Our ML models are trained on hundreds of millions of executables and model updates are released approximately monthly. Our yara signatures are created with automated signature creation technologies built in-house along with hand-written rules by our threat researchers. + +Files are scanned on write or deletion, process executables are scanned on executions and libraries are scanned on load. You can differentiate these types by looking at the `event.action` field in the alert. It can be execution, `load`, `creation`, `modification`, or `deletion`. Scanning files written to disk is best effort, while execution or load scanning is done ‘in-line’ for true prevention. + +### Possible investigation steps + +- For machine learning (ML) malware alerts the `file.Ext.malware_classification.score` and `file.Ext.malware_classification.version` fields indicate which model version was used to classify the file and the classification score (0 to 1). +- For malware signature hits, `threat_name` is an important field which will guide the user on what malware family the sample belongs to. +- For Yara matches, Malware alerts do provide the specific binary content identified by the yara rule in the alert metadata (it is base64 encoded and stored in the `matches` field). +- A file can also hit on multiple Yara signatures. In the alert metadata, the `primary` signature (`malware_signature.primary`) will be whichever we determine to have the highest severity. +- Malicious file alerts for files in download directories or written by browsers, office applications, script interpreters or other lolbins are especially correlated with malicious activity. +- Particular attention should be paid to files located in suspicious directories like `Public` folder, `Downloads`, `Temp` and `ProgramData`. +- Verify if the file is signed or not using the `file.Ext.code_signature` field. Even if the file is signed with a valid certificate verify the global prevalance of that signed in your environment. +- Verify the malicious file timestamp metadata using `file.created`, `file.mtime` and `file.accessed` to asses exactly if it's an old or new infection. +- Investigate the activity of the process that created, modified or loaded the malicious file (parent process tree, process.command_line, child processes, network, registry and files events). +- Assess whether this file is prevalent in the environment by looking for similar occurrences across hosts by `file.hash.sha256` or by `file.name` patterns. +- Verify the activity of the `user.name` associated with Malware alert (local or remote actity, privileged or standard user). +- Verify if there are any other Alert types (Behavior or Memory Threat) associated with the same host or user or process within the same time. +### False positive analysis + +- Other endpoint security vendors especially with their quarantine folders. +- Dynamically generated or compiled executables such as from csc.exe or other compilers. Due to the dynamic nature, each instance will likely have a unique hash and no signer + +### 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 = [ + "https://github.com/elastic/protections-artifacts/tree/main/yara", + "https://docs.elastic.co/en/integrations/endpoint", +] +risk_score = 21 +rule_id = "f87e6122-ea34-11ee-a417-f661ea17fbce" +rule_name_override = "message" +setup = """## Setup + +### Elastic Defend Alerts +This rule is designed to capture specific alerts generated by Elastic Defend. + +To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules: + +Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce) +Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce) +Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce) +Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce) +Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce) +Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce) +Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce) +Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce) + +To 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). + +### Additional notes +This rule is configured to generate more **Max alerts per run** than the default 1000 alerts per run set for all rules. This is to ensure that it captures as many alerts as possible. + +**IMPORTANT:** The rule's **Max alerts per run** setting can be superseded by the `xpack.alerting.rules.run.alerts.max` Kibana config setting, which determines the maximum alerts generated by _any_ rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, this rule will still generate no more than 1000 alerts even if its own **Max alerts per run** is set higher. + +To make sure this rule can generate as many alerts as it's configured in its own **Max alerts per run** setting, increase the `xpack.alerting.rules.run.alerts.max` system setting accordingly. + +**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects. +""" +severity = "low" +tags = ["Data Source: Elastic Defend", "Tactic: Execution"] +timestamp_override = "event.ingested" +type = "query" + +query = ''' +event.kind : alert and event.code : malicious_file and event.type : denied and event.outcome : success +''' + + +[[rule.exceptions_list]] +id = "endpoint_list" +list_id = "endpoint_list" +namespace_type = "agnostic" +type = "endpoint" + +[[rule.risk_score_mapping]] +field = "event.risk_score" +operator = "equals" +value = "" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "low" +value = "21" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "medium" +value = "47" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "high" +value = "73" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "critical" +value = "99" + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1204" +name = "User Execution" +reference = "https://attack.mitre.org/techniques/T1204/" +[[rule.threat.technique.subtechnique]] +id = "T1204.002" +name = "Malicious File" +reference = "https://attack.mitre.org/techniques/T1204/002/" + + + +[rule.threat.tactic] +id = "TA0002" +name = "Execution" +reference = "https://attack.mitre.org/tactics/TA0002/" + diff --git a/rules/integrations/endpoint/impact_elastic_ransomware_detected.toml b/rules/integrations/endpoint/impact_elastic_ransomware_detected.toml new file mode 100644 index 00000000000..af5a8d251c9 --- /dev/null +++ b/rules/integrations/endpoint/impact_elastic_ransomware_detected.toml @@ -0,0 +1,152 @@ +[metadata] +creation_date = "2024/03/24" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "Defend alerting adjustments patch to distinguish prevention and detection." +min_stack_version = "8.16.0" +promotion = true +updated_date = "2024/11/26" + +[rule] +author = ["Elastic"] +description = """ +Generates a detection alert each time an Elastic Defend alert for ransomware are received. Enabling this rule allows you +to immediately begin investigating your Endpoint ransomware alerts. This rule identifies Elastic Defend ransomware +detections only, and does not include prevention alerts. +""" +enabled = false +from = "now-10m" +index = ["logs-endpoint.alerts-*"] +interval = "5m" +language = "kuery" +license = "Elastic License v2" +max_signals = 10000 +name = "Ransomware - Detected - Elastic Defend" +note = """## Triage and analysis + +### Investigating Ransomware Alerts + +Ransomware protection adds a dedicated layer of detection and prevention against ransomware attacks. Our Ransomware protection consists of 3 subtypes: `behavioral`, `canary files`, and `MBR`. Our behavioral ransomware protection monitors the low level file system activity of all processes on the system to identify generic file encryption techniques. We include signals such as file header information, entropy calculations, known and suspicious extensions, and more to make verdicts. Canary files serve as a high confidence short-cut to other behavior techniques. Our endpoint places hidden files in select directories on the system and will trigger on any process attempting to tamper with the files. Finally, we protect the Master Boot Record (MBR) with our kernel minifilter driver to prevent this type of ransomware attack. + +Generally, our ransomware protection is tuned to have extremely low false positives rates. We understand how alarming and disruptive ransomware false positives can be which has factored into its design goals. More likely than not, if this protection fires, it is a true positive. However, certain categories of software do behave similarly to ransomware from the perspective of this protection. That includes installers and backup software, which can make a large number of modifications to documents (especially during a restore operation). Further, encryption or system utilities which modify the system’s MBR may also trigger our MBR protection. + +### Possible investigation steps + +- The `Ransomware.files` field provides details about files modifications (paths, entropy, extension and file headers). +- Investigate the metadata and the activity of the process or processes that triggered the alert. +- Assess whether this activity prevalent in the environment by looking for similar occurrences across hosts. +- Some Ransomware attacks tend to execute the operation on multiple hosts at the same time for maximum impact. +- Verify the activity of the `user.name` associated with the alert (local or remote actity, privileged or standard user). +- Quickly identifying the compromised credentials is critical to remediate Ransomware attacks. +- Verify if there are any other alert types (Behavior or Memory Threat) associated with the same host or user or process within the same time. + +### False positive analysis + +- Installers and backup software, which can make a large number of modifications to documents (especially during a restore operation). +- Encryption or system utilities which modify the system’s MBR may also trigger our MBR protection. +### Response and Remediation + +- Immediate Isolation and Containment: Quickly disconnect affected systems from the network, including both wired and wireless connections, to prevent the ransomware from spreading. This includes disabling network cards and removing network cables if necessary, while keeping the systems powered on for forensic purposes. +- Activate Incident Response Team and Plan: Assemble your incident response team and implement your incident response plan. Contact necessary stakeholders including IT security, legal counsel, and executive management. Document all actions taken from the moment of detection. +Initial Assessment and Evidence Preservation: Identify the scope of the infection and the type of ransomware. +- Take screenshots of ransom messages and create disk images of affected systems. Record all observable indicators of compromise (IOCs) before any remediation begins. +- Business Impact Analysis: Evaluate which critical business operations are affected and establish priority systems for recovery. Determine regulatory reporting requirements based on the type of data potentially compromised. +- Secure Backup Verification: Identify and verify the integrity of your latest clean backups. Check backup systems for potential compromise and ensure they were disconnected during the attack to prevent encryption of backup data. +- System Recovery Preparation: Build a clean environment for recovery operations, including secured networks and validated clean systems. Prepare tools and resources needed for system restoration. +- Malware Eradication: Remove the ransomware from infected systems using appropriate security tools. This may involve complete system rebuilds from known clean sources rather than attempting to clean infected systems. +- Data Restoration: Begin restoring systems from verified clean backups, starting with the most critical business operations. Implement additional security controls and monitoring during the restoration process. +- Security Posture Strengthening: Update all security systems including firewalls, antivirus, and endpoint protection. Reset all credentials across the organization and implement additional access controls like multi-factor authentication where needed. +- Post-Incident Activities: Conduct a detailed post-incident analysis to identify how the ransomware entered the environment. Update security policies and incident response plans based on lessons learned, and provide additional security awareness training to staff. +""" +references = [ + "https://github.com/elastic/protections-artifacts/tree/main/ransomware", + "https://docs.elastic.co/en/integrations/endpoint", +] +risk_score = 73 +rule_id = "0c74cd7e-ea35-11ee-a417-f661ea17fbce" +rule_name_override = "message" +setup = """## Setup + +### Elastic Defend Alerts +This rule is designed to capture specific alerts generated by Elastic Defend. + +To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules: + +Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce) +Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce) +Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce) +Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce) +Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce) +Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce) +Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce) +Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce) + +To 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). + +### Additional notes +This rule is configured to generate more **Max alerts per run** than the default 1000 alerts per run set for all rules. This is to ensure that it captures as many alerts as possible. + +**IMPORTANT:** The rule's **Max alerts per run** setting can be superseded by the `xpack.alerting.rules.run.alerts.max` Kibana config setting, which determines the maximum alerts generated by _any_ rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, this rule will still generate no more than 1000 alerts even if its own **Max alerts per run** is set higher. + +To make sure this rule can generate as many alerts as it's configured in its own **Max alerts per run** setting, increase the `xpack.alerting.rules.run.alerts.max` system setting accordingly. + +**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects. +""" +severity = "high" +tags = ["Data Source: Elastic Defend", "Tactic: Impact"] +timestamp_override = "event.ingested" +type = "query" + +query = ''' +event.kind : alert and event.code : ransomware and (event.type : allowed or (event.type: denied and event.outcome: failure)) +''' + + +[[rule.exceptions_list]] +id = "endpoint_list" +list_id = "endpoint_list" +namespace_type = "agnostic" +type = "endpoint" + +[[rule.risk_score_mapping]] +field = "event.risk_score" +operator = "equals" +value = "" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "low" +value = "21" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "medium" +value = "47" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "high" +value = "73" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "critical" +value = "99" + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1486" +name = "Data Encrypted for Impact" +reference = "https://attack.mitre.org/techniques/T1486/" + + +[rule.threat.tactic] +id = "TA0040" +name = "Impact" +reference = "https://attack.mitre.org/tactics/TA0040/" + diff --git a/rules/integrations/endpoint/impact_elastic_ransomware_prevented.toml b/rules/integrations/endpoint/impact_elastic_ransomware_prevented.toml new file mode 100644 index 00000000000..6a4e817e337 --- /dev/null +++ b/rules/integrations/endpoint/impact_elastic_ransomware_prevented.toml @@ -0,0 +1,153 @@ +[metadata] +creation_date = "2024/03/24" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "Defend alerting adjustments patch to distinguish prevention and detection." +min_stack_version = "8.16.0" +promotion = true +updated_date = "2024/11/26" + +[rule] +author = ["Elastic"] +description = """ +Generates a detection alert each time an Elastic Defend alert for ransomware are received. Enabling this rule allows you +to immediately begin investigating your Endpoint ransomware alerts. This rule identifies Elastic Defend ransomware +preventions only, and does not include detection only alerts. +""" +enabled = false +from = "now-10m" +index = ["logs-endpoint.alerts-*"] +interval = "5m" +language = "kuery" +license = "Elastic License v2" +max_signals = 10000 +name = "Ransomware - Prevented - Elastic Defend" +note = """## Triage and analysis + +### Investigating Ransomware Alerts + +Ransomware protection adds a dedicated layer of detection and prevention against ransomware attacks. Our Ransomware protection consists of 3 subtypes: `behavioral`, `canary files`, and `MBR`. Our behavioral ransomware protection monitors the low level file system activity of all processes on the system to identify generic file encryption techniques. We include signals such as file header information, entropy calculations, known and suspicious extensions, and more to make verdicts. Canary files serve as a high confidence short-cut to other behavior techniques. Our endpoint places hidden files in select directories on the system and will trigger on any process attempting to tamper with the files. Finally, we protect the Master Boot Record (MBR) with our kernel minifilter driver to prevent this type of ransomware attack. + +Generally, our ransomware protection is tuned to have extremely low false positives rates. We understand how alarming and disruptive ransomware false positives can be which has factored into its design goals. More likely than not, if this protection fires, it is a true positive. However, certain categories of software do behave similarly to ransomware from the perspective of this protection. That includes installers and backup software, which can make a large number of modifications to documents (especially during a restore operation). Further, encryption or system utilities which modify the system’s MBR may also trigger our MBR protection. + +### Possible investigation steps + +- The `Ransomware.files` field provides details about files modification (paths, entropy, extension and file headers). +- Investigate the metadata and the activity of the process or processes that triggered the alert. +- Assess whether this activity is prevalent in your environment by looking for similar occurrences across hosts. +- Some Ransomware attacks tend to execute the operation on multiple hosts at the same time for maximum impact. +- Verify the activity of the `user.name` associated with the alert (local or remote actity, privileged or standard user). +- Quickly identifying the compromised credentials is critical to remediate Ransomware attacks. +- Verify if there are any other alert types (Behavior or Memory Threat) associated with the same host or user or process within the same time. + +### False positive analysis + +- Installers and backup software, which can make a large number of modifications to documents (especially during a restore operation). +- Encryption or system utilities which modify the system’s MBR may also trigger our MBR protection. + +### Response and Remediation + +- Immediate Isolation and Containment: Quickly disconnect affected systems from the network, including both wired and wireless connections, to prevent the ransomware from spreading. This includes disabling network cards and removing network cables if necessary, while keeping the systems powered on for forensic purposes. +- Activate Incident Response Team and Plan: Assemble your incident response team and implement your incident response plan. Contact necessary stakeholders including IT security, legal counsel, and executive management. Document all actions taken from the moment of detection. +Initial Assessment and Evidence Preservation: Identify the scope of the infection and the type of ransomware. +- Take screenshots of ransom messages and create disk images of affected systems. Record all observable indicators of compromise (IOCs) before any remediation begins. +- Business Impact Analysis: Evaluate which critical business operations are affected and establish priority systems for recovery. Determine regulatory reporting requirements based on the type of data potentially compromised. +- Secure Backup Verification: Identify and verify the integrity of your latest clean backups. Check backup systems for potential compromise and ensure they were disconnected during the attack to prevent encryption of backup data. +- System Recovery Preparation: Build a clean environment for recovery operations, including secured networks and validated clean systems. Prepare tools and resources needed for system restoration. +- Malware Eradication: Remove the ransomware from infected systems using appropriate security tools. This may involve complete system rebuilds from known clean sources rather than attempting to clean infected systems. +- Data Restoration: Begin restoring systems from verified clean backups, starting with the most critical business operations. Implement additional security controls and monitoring during the restoration process. +- Security Posture Strengthening: Update all security systems including firewalls, antivirus, and endpoint protection. Reset all credentials across the organization and implement additional access controls like multi-factor authentication where needed. +- Post-Incident Activities: Conduct a detailed post-incident analysis to identify how the ransomware entered the environment. Update security policies and incident response plans based on lessons learned, and provide additional security awareness training to staff. +""" +references = [ + "https://github.com/elastic/protections-artifacts/tree/main/ransomware", + "https://docs.elastic.co/en/integrations/endpoint", +] +risk_score = 73 +rule_id = "10f3d520-ea35-11ee-a417-f661ea17fbce" +rule_name_override = "message" +setup = """## Setup + +### Elastic Defend Alerts +This rule is designed to capture specific alerts generated by Elastic Defend. + +To capture all the Elastic Defend alerts, it is recommended to use all of the Elastic Defend feature-specific protection rules: + +Behavior - Detected - Elastic Defend (UUID: 0f615fe4-eaa2-11ee-ae33-f661ea17fbce) +Behavior - Prevented - Elastic Defend (UUID: eb804972-ea34-11ee-a417-f661ea17fbce) +Malicious File - Detected - Elastic Defend (UUID: f2c3caa6-ea34-11ee-a417-f661ea17fbce) +Malicious File - Prevented - Elastic Defend (UUID: f87e6122-ea34-11ee-a417-f661ea17fbce) +Memory Threat - Detected - Elastic Defend (UUID: 017de1e4-ea35-11ee-a417-f661ea17fbce) +Memory Threat - Prevented - Elastic Defend (UUID: 06f3a26c-ea35-11ee-a417-f661ea17fbce) +Ransomware - Detected - Elastic Defend (UUID: 0c74cd7e-ea35-11ee-a417-f661ea17fbce) +Ransomware - Prevented - Elastic Defend (UUID: 10f3d520-ea35-11ee-a417-f661ea17fbce) + +To 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). + +### Additional notes +This rule is configured to generate more **Max alerts per run** than the default 1000 alerts per run set for all rules. This is to ensure that it captures as many alerts as possible. + +**IMPORTANT:** The rule's **Max alerts per run** setting can be superseded by the `xpack.alerting.rules.run.alerts.max` Kibana config setting, which determines the maximum alerts generated by _any_ rule in the Kibana alerting framework. For example, if `xpack.alerting.rules.run.alerts.max` is set to 1000, this rule will still generate no more than 1000 alerts even if its own **Max alerts per run** is set higher. + +To make sure this rule can generate as many alerts as it's configured in its own **Max alerts per run** setting, increase the `xpack.alerting.rules.run.alerts.max` system setting accordingly. + +**NOTE:** Changing `xpack.alerting.rules.run.alerts.max` is not possible in Serverless projects. +""" +severity = "high" +tags = ["Data Source: Elastic Defend", "Tactic: Impact"] +timestamp_override = "event.ingested" +type = "query" + +query = ''' +event.kind : alert and event.code : ransomware and event.type : denied and event.outcome : success +''' + + +[[rule.exceptions_list]] +id = "endpoint_list" +list_id = "endpoint_list" +namespace_type = "agnostic" +type = "endpoint" + +[[rule.risk_score_mapping]] +field = "event.risk_score" +operator = "equals" +value = "" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "low" +value = "21" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "medium" +value = "47" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "high" +value = "73" + +[[rule.severity_mapping]] +field = "event.severity" +operator = "equals" +severity = "critical" +value = "99" + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1486" +name = "Data Encrypted for Impact" +reference = "https://attack.mitre.org/techniques/T1486/" + + +[rule.threat.tactic] +id = "TA0040" +name = "Impact" +reference = "https://attack.mitre.org/tactics/TA0040/" +