Skip to content

Commit 8c1cd8a

Browse files
Merge branch 'main' into terrancedejesus/issue5353
2 parents 072e31d + fda139f commit 8c1cd8a

27 files changed

+1662
-373
lines changed
1013 Bytes
Binary file not shown.
24.5 KB
Binary file not shown.

detection_rules/etc/non-ecs-schema.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@
145145
"kibana.alert.rule.threat.tactic.id": "keyword",
146146
"kibana.alert.workflow_status": "keyword",
147147
"kibana.alert.rule.rule_id": "keyword",
148-
"kibana.alert.rule.name": "keyword"
148+
"kibana.alert.rule.name": "keyword",
149+
"kibana.alert.risk_score": "long",
150+
"kibana.alert.rule.type": "keyword",
151+
"kibana.alert.rule.threat.tactic.name": "keyword"
149152
},
150153
"logs-google_workspace*": {
151154
"gsuite.admin": "keyword",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "detection_rules"
3-
version = "1.5.13"
3+
version = "1.5.15"
44
description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Security’s Detection Engine."
55
readme = "README.md"
66
requires-python = ">=3.12"

rules/integrations/aws/privilege_escalation_root_login_without_mfa.toml renamed to rules/_deprecated/privilege_escalation_root_login_without_mfa.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[metadata]
22
creation_date = "2020/07/06"
33
integration = ["aws"]
4-
maturity = "production"
5-
updated_date = "2025/10/10"
4+
deprecation_date = "2025/11/21"
5+
maturity = "deprecated"
6+
updated_date = "2025/11/21"
67

78
[rule]
89
author = ["Elastic"]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
[metadata]
2+
creation_date = "2025/11/18"
3+
integration = ["endpoint", "panw"]
4+
maturity = "production"
5+
updated_date = "2025/11/18"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
This detection correlates Palo Alto Networks (PANW) command and control events with Elastic Defend network events to identify
11+
the source process performing the network activity.
12+
"""
13+
from = "now-9m"
14+
index = ["logs-endpoint.events.network-*", "logs-panw.panos-*"]
15+
language = "eql"
16+
license = "Elastic License v2"
17+
name = "PANW and Elastic Defend - Command and Control Correlation"
18+
references = [
19+
"https://attack.mitre.org/tactics/TA0011/",
20+
"https://www.elastic.co/docs/reference/integrations/panw",
21+
"https://www.elastic.co/docs/reference/integrations/endpoint"
22+
]
23+
risk_score = 47
24+
rule_id = "da4f56b8-9bc5-4003-a46c-d23616fbc691"
25+
severity = "medium"
26+
tags = [
27+
"Domain: Endpoint",
28+
"OS: Linux",
29+
"OS: Windows",
30+
"OS: macOS",
31+
"Use Case: Threat Detection",
32+
"Tactic: Command and Control",
33+
"Data Source: Elastic Defend",
34+
"Data Source: PAN-OS",
35+
"Resources: Investigation Guide",
36+
]
37+
type = "eql"
38+
query = '''
39+
sequence by source.port, source.ip, destination.ip with maxspan=1m
40+
[network where event.module == "panw" and event.action == "c2_communication"]
41+
[network where event.module == "endpoint" and event.action in ("disconnect_received", "connection_attempted")]
42+
'''
43+
note = """## Triage and analysis
44+
45+
### Investigating PANW and Elastic Defend - Command and Control Correlation
46+
47+
### Possible investigation steps
48+
49+
- Investigate in the Timeline feature the two events matching this correlation (PANW and Elastic Defend).
50+
- Review the process details like command_line, privileges, global relevance and reputation.
51+
- Assess the destination.ip reputation and global relevance.
52+
- Review the parent process execution details like command_line, global relevance and reputation.
53+
- Examine all network connection details performed by the process during last 48h.
54+
- Correlate the alert with other security events or logs to identify any patterns or additional indicators of compromise related to the same process or network activity.
55+
56+
### False positive analysis
57+
58+
- Trusted system or third party processes performing network activity that looks like beaconing.
59+
60+
### Response and remediation
61+
62+
- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
63+
- Terminate the suspicious processes and all associated children and parents.
64+
- Implement network-level controls to block traffic to the destination.ip.
65+
- Conduct a thorough review of the system's configuration files to identify unauthorized changes.
66+
- Reset credentials for any accounts associated with the source machine.
67+
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
68+
"""
69+
70+
[[rule.threat]]
71+
framework = "MITRE ATT&CK"
72+
73+
[rule.threat.tactic]
74+
id = "TA0011"
75+
name = "Command and Control"
76+
reference = "https://attack.mitre.org/tactics/TA0011/"
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[metadata]
2+
creation_date = "2025/11/17"
3+
integration = ["endpoint", "fortinet_fortigate"]
4+
maturity = "production"
5+
updated_date = "2025/11/17"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
This detection correlates FortiGate's application control SOCKS events with Elastic Defend network event to identify the
11+
source process performing SOCKS traffic. Adversaries may use a connection proxy to direct network traffic between systems
12+
or act as an intermediary for network communications to a command and control server to avoid direct connections to their
13+
infrastructure.
14+
"""
15+
from = "now-9m"
16+
index = ["logs-endpoint.events.network-*", "logs-fortinet_fortigate.log-*"]
17+
language = "eql"
18+
license = "Elastic License v2"
19+
name = "SOCKS Traffic from an Unusual Process"
20+
references = [
21+
"https://attack.mitre.org/techniques/T1090/",
22+
"https://www.elastic.co/docs/reference/integrations/fortinet_fortigate",
23+
"https://www.elastic.co/docs/reference/integrations/endpoint"
24+
]
25+
risk_score = 47
26+
rule_id = "6926b708-7964-425f-bed8-6e006379df08"
27+
severity = "medium"
28+
tags = [
29+
"Domain: Endpoint",
30+
"OS: Linux",
31+
"OS: Windows",
32+
"OS: macOS",
33+
"Use Case: Threat Detection",
34+
"Tactic: Command and Control",
35+
"Data Source: Elastic Defend",
36+
"Data Source: Fortinet",
37+
"Resources: Investigation Guide",
38+
]
39+
type = "eql"
40+
query = '''
41+
sequence by source.port, source.ip, destination.ip with maxspan=1m
42+
[network where event.dataset == "fortinet_fortigate.log" and event.action == "signature" and network.application in ("SOCKS4", "SOCKS5")]
43+
[network where event.module == "endpoint" and event.action in ("disconnect_received", "connection_attempted")]
44+
'''
45+
note = """## Triage and analysis
46+
47+
### Investigating SOCKS Traffic from an Unusual Process
48+
49+
### Possible investigation steps
50+
51+
- Review the process details like command_line, privileges, global relevance and reputation.
52+
- Review the parent process execution details like command_line, global relevance and reputation.
53+
- Examine all network connection details performed by the process during last 48h.
54+
- Examine all localhost network connections performed by the same process to verify if there is any port forwarding with another process on the same machine.
55+
- Correlate the alert with other security events or logs to identify any patterns or additional indicators of compromise related to the same process or network activity.
56+
57+
### False positive analysis
58+
59+
- Browser proxy extensions and Add-ons.
60+
- Development and deployment tools.
61+
- Third party trusted tools using SOCKS for network communication.
62+
63+
### Response and remediation
64+
65+
- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
66+
- Terminate the suspicious processes and all associated children and parents.
67+
- Conduct a thorough review of the system's configuration files to identify unauthorized changes.
68+
- Reset credentials for any accounts associated with the source machine.
69+
- Implement network-level controls to block traffic via SOCKS unless authorized.
70+
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
71+
"""
72+
73+
[[rule.threat]]
74+
framework = "MITRE ATT&CK"
75+
76+
[[rule.threat.technique]]
77+
id = "T1090"
78+
name = "Proxy"
79+
reference = "https://attack.mitre.org/techniques/T1090/"
80+
81+
82+
[rule.threat.tactic]
83+
id = "TA0011"
84+
name = "Command and Control"
85+
reference = "https://attack.mitre.org/tactics/TA0011/"

rules/cross-platform/defense_evasion_agent_spoofing_multiple_hosts.toml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[metadata]
22
creation_date = "2021/07/14"
3+
integration = ["endpoint"]
34
maturity = "production"
4-
updated_date = "2025/01/15"
5+
updated_date = "2025/11/13"
56

67
[rule]
78
author = ["Elastic"]
@@ -17,19 +18,22 @@ false_positives = [
1718
""",
1819
]
1920
from = "now-9m"
20-
index = ["logs-*", "metrics-*", "traces-*"]
21-
language = "kuery"
21+
language = "esql"
2222
license = "Elastic License v2"
2323
name = "Agent Spoofing - Multiple Hosts Using Same Agent"
2424
risk_score = 73
2525
rule_id = "493834ca-f861-414c-8602-150d5505b777"
2626
severity = "high"
2727
tags = ["Use Case: Threat Detection", "Tactic: Defense Evasion", "Resources: Investigation Guide"]
2828
timestamp_override = "event.ingested"
29-
type = "threshold"
29+
type = "esql"
3030

3131
query = '''
32-
event.agent_id_status:* and not tags:forwarded
32+
from logs-endpoint.* metadata _id
33+
| where event.agent_id_status is not null
34+
| stats Esql.count_distinct_host_ids = count_distinct(host.id), Esql.host_id_values = values(host.id), Esql.user_id_values_user_id = values(user.id) by agent.id
35+
| where Esql.count_distinct_host_ids >= 2
36+
| keep Esql.count_distinct_host_ids, Esql.host_id_values, Esql.user_id_values_user_id, agent.id
3337
'''
3438
note = """## Triage and analysis
3539
@@ -80,11 +84,4 @@ id = "TA0005"
8084
name = "Defense Evasion"
8185
reference = "https://attack.mitre.org/tactics/TA0005/"
8286

83-
[rule.threshold]
84-
field = ["agent.id"]
85-
value = 2
86-
[[rule.threshold.cardinality]]
87-
field = "host.id"
88-
value = 2
89-
9087

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 from Elastic Defend involving the same host are triggered.
10+
Analysts can use this to prioritize triage and response, as these hosts are more likely to be compromised.
11+
"""
12+
from = "now-60m"
13+
interval = "30m"
14+
language = "esql"
15+
license = "Elastic License v2"
16+
name = "Multiple Elastic Defend Alerts by Agent"
17+
risk_score = 73
18+
rule_id = "ab25369e-ea5e-46f1-9cd5-478a0a4a131a"
19+
severity = "high"
20+
tags = ["Use Case: Threat Detection", "Rule Type: Higher-Order Rule", "Resources: Investigation Guide", "Data Source: Elastic Defend"]
21+
timestamp_override = "event.ingested"
22+
type = "esql"
23+
24+
query = '''
25+
from logs-endpoint.alerts-* metadata _id
26+
| eval target_time_window = DATE_TRUNC(24 hours, @timestamp)
27+
| where event.code in ("malicious_file", "memory_signature", "shellcode_thread", "behavior") and
28+
agent.id is not null and not rule.name in ("Multi.EICAR.Not-a-virus")
29+
| stats Esql.alerts_count = COUNT(*),
30+
Esql.event_code_distinct_count = count_distinct(event.code),
31+
Esql.rule_name_distinct_count = COUNT_DISTINCT(rule.name),
32+
Esql.file_hash_distinct_count = COUNT_DISTINCT(file.hash.sha256),
33+
Esql.process_name_distinct_count = COUNT_DISTINCT(process.entity_id),
34+
Esql.event_code_values = VALUES(event.code),
35+
Esql.rule_name_values = VALUES(rule.name),
36+
Esql.message_values = VALUES(message),
37+
Esql.file_path_values = VALUES(file.path),
38+
Esql.dll_path_values = VALUES(dll.path),
39+
Esql.process_executable_values = VALUES(process.executable),
40+
Esql.process_parent_executable_values = VALUES(process.parent.executable),
41+
Esql.process_command_line_values = VALUES(process.command_line),
42+
Esql.process_hash_sha256_values = VALUES(process.hash.sha256),
43+
Esql.file_hash_sha256_values = VALUES(file.hash.sha256),
44+
Esql.dll_hash_sha256_values = VALUES(dll.hash.sha256) by agent.id
45+
| where (Esql.event_code_distinct_count >= 2 or Esql.rule_name_distinct_count >= 3 or Esql.file_hash_distinct_count >= 2)
46+
| keep agent.id,
47+
Esql.alerts_count,
48+
Esql.event_code_distinct_count,
49+
Esql.rule_name_distinct_count,
50+
Esql.message_values,
51+
Esql.event_code_values,
52+
Esql.rule_name_values,
53+
Esql.process_executable_values,
54+
Esql.process_parent_executable_values,
55+
Esql.process_command_line_values,
56+
Esql.file_path_values,
57+
Esql.dll_path_values,
58+
Esql.process_hash_sha256_values,
59+
Esql.file_hash_sha256_values,
60+
Esql.dll_hash_sha256_values
61+
'''
62+
note = """## Triage and analysis
63+
64+
> **Disclaimer**:
65+
> 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.
66+
67+
### Investigating Multiple Elastic Defend Alerts by Agent
68+
69+
Endpoint security technologies monitor and analyze activities on devices to detect malicious behavior. Adversaries exploit these systems by deploying malware that triggers specific signatures across multiple hosts, indicating a coordinated attack. The detection rule identifies such threats by analyzing alert data for specific malware signatures across several hosts, flagging potential widespread infections for prioritized investigation.
70+
71+
### Possible investigation steps
72+
73+
- Review the alert details to identify the specific host involved and the different ATT&CK tactics that triggered the alerts.
74+
- 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.
75+
- 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.
76+
- Investigate any known vulnerabilities or misconfigurations on the host that could have been exploited by the adversary.
77+
- 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.
78+
- Assess the impact and scope of the potential compromise by determining if other hosts or systems have similar alerts or related activity.
79+
80+
### False positive analysis
81+
82+
- Alerts from routine administrative tasks may trigger multiple tactics. Review and exclude known benign activities such as scheduled software updates or system maintenance.
83+
- Security tools running on the host might generate alerts across different tactics. Identify and exclude alerts from trusted security applications to reduce noise.
84+
- Automated scripts or batch processes can mimic adversarial behavior. Analyze and whitelist these processes if they are verified as non-threatening.
85+
- Frequent alerts from development or testing environments can be misleading. Consider excluding these environments from the rule or applying a different risk score.
86+
- User behavior anomalies, such as accessing multiple systems or applications, might trigger alerts. Implement user behavior baselines to differentiate between normal and suspicious activities.
87+
88+
### Response and remediation
89+
90+
- Isolate the affected host from the network immediately to prevent further lateral movement by the adversary.
91+
- Conduct a thorough forensic analysis of the host to identify the specific vulnerabilities exploited and gather evidence of the attack phases involved.
92+
- Remove any identified malicious software or unauthorized access tools from the host, ensuring all persistence mechanisms are eradicated.
93+
- Apply security patches and updates to the host to address any exploited vulnerabilities and prevent similar attacks.
94+
- Restore the host from a known good backup if necessary, ensuring that the backup is free from compromise.
95+
- 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.
96+
- 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."""
97+
references = ["https://github.com/elastic/protections-artifacts/tree/main/yara/rules"]

0 commit comments

Comments
 (0)