Skip to content

Commit 64dfae9

Browse files
committed
[New] Alerts in Different ATT&CK Tactics by Host
Using ES|QL and alerts risk score to identify top risky hosts based on presence of multiple alert touching at least 4 unique tactics in a 24h time Window.
1 parent f0e9281 commit 64dfae9

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
[metadata]
2+
creation_date = "2025/11/19"
3+
maturity = "production"
4+
updated_date = "2025/11/19"
5+
6+
[rule]
7+
author = ["Elastic"]
8+
description = """
9+
This rule uses alert data to determine when multiple alerts in different phases of an attack involving the same host are
10+
triggered and where the accumulated risk score is higher than a defined threshold. Analysts can use this to prioritize
11+
triage and response, as these hosts are more likely to be compromised.
12+
"""
13+
from = "now-24h"
14+
index = [".alerts-security.*"]
15+
interval = "1h"
16+
language = "esql"
17+
license = "Elastic License v2"
18+
name = "Alerts in Different ATT&CK Tactics by Host"
19+
risk_score = 73
20+
rule_id = "29531d20-0e80-41d4-9ec6-d6b58e4a475c"
21+
severity = "high"
22+
tags = ["Use Case: Threat Detection", "Rule Type: Higher-Order Rule", "Resources: Investigation Guide"]
23+
timestamp_override = "event.ingested"
24+
type = "esql"
25+
26+
query = '''
27+
from .alerts-security.alerts*
28+
29+
// filter for alerts with populated risk score, excluding threat_match rules, deprecated and some other noisy ones.
30+
| where kibana.alert.risk_score > 0 and
31+
kibana.alert.rule.name IS NOT NULL and
32+
host.id is not null and event.dataset is not null and
33+
kibana.alert.rule.type != "threat_match" and
34+
not kibana.alert.rule.name in ("Agent Spoofing - Mismatched Agent ID") and
35+
not kibana.alert.rule.name like "Deprecated - *"
36+
37+
// extract unique counts and values by host.id
38+
| stats Esql.alerts_count = COUNT(*),
39+
Esql.kibana_alert_rule_name_distinct_count = COUNT_DISTINCT(kibana.alert.rule.name),
40+
Esql.event_module_distinct_count = COUNT_DISTINCT(event.module),
41+
Esql.event_module_values = VALUES(event.module),
42+
Esql.kibana_alert_rule_name_values = VALUES(kibana.alert.rule.name),
43+
Esql.threat_tactic_id_distinct_count = COUNT_DISTINCT(kibana.alert.rule.threat.tactic.id),
44+
Esql.threat_tactic_name_values = VALUES(kibana.alert.rule.threat.tactic.name),
45+
Esql.kibana_alert_risk_score_sum = sum(kibana.alert.risk_score),
46+
Esql.process_executable_values = VALUES(process.executable),
47+
Esql.process_parent_executable_values = VALUES(process.parent.executable),
48+
Esql.process_command_line_values = VALUES(process.command_line),
49+
Esql.process_entity_id_distinct_count = COUNT_DISTINCT(process.entity_id) by host.id
50+
51+
// filter hosts with more than 5 unique rules and 4 different tactics and less than 25 unique PID to avoid noisy FPs
52+
| where Esql.kibana_alert_rule_name_distinct_count >= 5 and Esql.threat_tactic_id_distinct_count >= 4 and
53+
Esql.process_entity_id_distinct_count <= 25
54+
55+
// divide the sum of risk scores by the total number of alerts
56+
| eval Esql.risk_alerts_count_ratio = Esql.kibana_alert_risk_score_sum/Esql.alerts_count
57+
58+
// filter for risk_alerts_count_ratio more than 50 and total number of alerts is less than 500 to avoid very noisy rules influencing risk score
59+
| where Esql.risk_alerts_count_ratio >= 50 and Esql.alerts_count <= 500
60+
61+
// fiels populated in the resulting alert
62+
| keep host.id,
63+
Esql.alerts_count,
64+
Esql.kibana_alert_risk_score_sum,
65+
Esql.risk_alerts_count_ratio,
66+
Esql.kibana_alert_rule_name_distinct_count,
67+
Esql.event_module_values,
68+
Esql.kibana_alert_rule_name_values,
69+
Esql.threat_tactic_name_values,
70+
Esql.process_executable_values,
71+
Esql.process_parent_executable_values,
72+
Esql.process_command_line_values
73+
'''
74+
note = """## Triage and analysis
75+
76+
> **Disclaimer**:
77+
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
78+
79+
### Investigating Alerts in Different ATT&CK Tactics by Host
80+
81+
The detection rule identifies hosts with alerts across various attack phases, indicating potential compromise. Adversaries exploit system vulnerabilities, moving through different tactics like execution, persistence, and exfiltration. This rule prioritizes hosts with diverse tactic alerts, aiding analysts in focusing on high-risk threats by correlating alert data to detect complex attack patterns.
82+
83+
### Possible investigation steps
84+
85+
- Review the alert details to identify the specific host involved and the different ATT&CK tactics that triggered the alerts.
86+
- Examine the timeline of the alerts to understand the sequence of events and determine if there is a pattern or progression in the tactics used.
87+
- Correlate the alert data with other logs and telemetry from the host, such as process creation, network connections, and file modifications, to gather additional context.
88+
- Investigate any known vulnerabilities or misconfigurations on the host that could have been exploited by the adversary.
89+
- Check for any indicators of compromise (IOCs) associated with the alerts, such as suspicious IP addresses, domains, or file hashes, and search for these across the network.
90+
- Assess the impact and scope of the potential compromise by determining if other hosts or systems have similar alerts or related activity.
91+
92+
### False positive analysis
93+
94+
- Alerts from routine administrative tasks may trigger multiple tactics. Review and exclude known benign activities such as scheduled software updates or system maintenance.
95+
- Security tools running on the host might generate alerts across different tactics. Identify and exclude alerts from trusted security applications to reduce noise.
96+
- Automated scripts or batch processes can mimic adversarial behavior. Analyze and whitelist these processes if they are verified as non-threatening.
97+
- Frequent alerts from development or testing environments can be misleading. Consider excluding these environments from the rule or applying a different risk score.
98+
- User behavior anomalies, such as accessing multiple systems or applications, might trigger alerts. Implement user behavior baselines to differentiate between normal and suspicious activities.
99+
100+
### Response and remediation
101+
102+
- Isolate the affected host from the network immediately to prevent further lateral movement by the adversary.
103+
- Conduct a thorough forensic analysis of the host to identify the specific vulnerabilities exploited and gather evidence of the attack phases involved.
104+
- Remove any identified malicious software or unauthorized access tools from the host, ensuring all persistence mechanisms are eradicated.
105+
- Apply security patches and updates to the host to address any exploited vulnerabilities and prevent similar attacks.
106+
- Restore the host from a known good backup if necessary, ensuring that the backup is free from compromise.
107+
- Monitor the host and network for any signs of re-infection or further suspicious activity, using enhanced logging and alerting based on the identified attack patterns.
108+
- Escalate the incident to the appropriate internal or external cybersecurity teams for further investigation and potential legal action if the attack is part of a larger campaign."""
109+
110+

0 commit comments

Comments
 (0)