Skip to content

Commit c45c3f1

Browse files
Merge branch 'main' into terrancedejesus/issue5501
2 parents 5f7c32b + 38e2e47 commit c45c3f1

File tree

122 files changed

+2676
-2365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+2676
-2365
lines changed

rules/cross-platform/command_and_control_curl_wget_spawn_via_nodejs_parent.toml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/09/18"
33
integration = ["endpoint", "windows", "system", "sentinel_one_cloud_funnel", "crowdstrike", "auditd_manager"]
44
maturity = "production"
5-
updated_date = "2025/11/26"
5+
updated_date = "2025/12/23"
66

77
[rule]
88
author = ["Elastic"]
@@ -105,17 +105,19 @@ timestamp_override = "event.ingested"
105105
type = "eql"
106106
query = '''
107107
process where event.type == "start" and
108-
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
109-
process.parent.name in ("node", "bun", "node.exe", "bun.exe") and (
110-
(
111-
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "cmd.exe", "bash.exe", "powershell.exe") and
112-
process.command_line like~ ("*curl*http*", "*wget*http*")
113-
) or
114-
(
115-
process.name in ("curl", "wget", "curl.exe", "wget.exe")
116-
)
117-
) and
118-
not process.command_line like ("*127.0.0.1*", "*localhost*")
108+
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
109+
process.parent.name in ("node", "bun", "node.exe", "bun.exe") and (
110+
(
111+
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "cmd.exe", "bash.exe", "powershell.exe") and
112+
process.command_line like~ ("*curl*http*", "*wget*http*")
113+
) or
114+
(
115+
process.name in ("curl", "wget", "curl.exe", "wget.exe")
116+
)
117+
) and not (
118+
process.command_line like ("*127.0.0.1*", "*localhost*", "*/home/*/.claude/shell-snapshots/*", "*/root/.claude/shell-snapshots/snapshot*") or
119+
process.parent.executable like ("/*/.cursor-server/*node", "/root/.nvm/*/node", "/*/.vscode-server/*/node", "/home/*/.nvm/*/node", "/home/*/cursor-agent/*/node")
120+
)
119121
'''
120122

121123
[[rule.threat]]

rules/cross-platform/command_and_control_non_standard_ssh_port.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2022/10/18"
33
integration = ["endpoint"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/12/23"
66

77
[rule]
88
author = ["Elastic"]
@@ -23,7 +23,7 @@ from = "now-9m"
2323
index = ["logs-endpoint.events.*"]
2424
language = "eql"
2525
license = "Elastic License v2"
26-
name = "Potential Non-Standard Port SSH connection"
26+
name = "Deprecated - Potential Non-Standard Port SSH connection"
2727
references = ["https://attack.mitre.org/techniques/T1571/"]
2828
risk_score = 21
2929
rule_id = "bc8ca7e0-92fd-4b7c-b11e-ee0266b8d9c9"
@@ -62,7 +62,7 @@ note = """## Triage and analysis
6262
> **Disclaimer**:
6363
> 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.
6464
65-
### Investigating Potential Non-Standard Port SSH connection
65+
### Investigating Deprecated - Potential Non-Standard Port SSH connection
6666
6767
SSH is a protocol used for secure remote access and management of systems. Typically, it operates over port 22. However, adversaries may exploit non-standard ports to evade detection and bypass network filters. The detection rule identifies unusual SSH activity by monitoring processes and network connections on ports other than 22, excluding common benign use cases, to flag potential threats.
6868

rules/cross-platform/defense_evasion_deletion_of_bash_command_line_history.toml

Lines changed: 52 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/05/04"
33
integration = ["endpoint", "auditd_manager"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/12/23"
66

77
[rule]
88
author = ["Elastic"]
@@ -15,46 +15,6 @@ index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_mana
1515
language = "eql"
1616
license = "Elastic License v2"
1717
name = "Tampering of Shell Command-Line History"
18-
references = ["https://www.elastic.co/security-labs/detecting-log4j2-with-elastic-security"]
19-
risk_score = 47
20-
rule_id = "7bcbb3ac-e533-41ad-a612-d6c3bf666aba"
21-
setup = """## Setup
22-
23-
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
24-
events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
25-
Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
26-
`event.ingested` to @timestamp.
27-
For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
28-
"""
29-
severity = "medium"
30-
tags = [
31-
"Domain: Endpoint",
32-
"OS: Linux",
33-
"OS: macOS",
34-
"Use Case: Threat Detection",
35-
"Tactic: Defense Evasion",
36-
"Data Source: Elastic Defend",
37-
"Data Source: Elastic Endgame",
38-
"Data Source: Auditd Manager",
39-
"Resources: Investigation Guide",
40-
]
41-
timestamp_override = "event.ingested"
42-
type = "eql"
43-
44-
query = '''
45-
process where event.action in ("exec", "exec_event", "executed", "process_started") and event.type == "start" and
46-
(
47-
((process.args : ("rm", "echo") or
48-
(process.args : "ln" and process.args : "-sf" and process.args : "/dev/null") or
49-
(process.args : "truncate" and process.args : "-s0"))
50-
and process.args : (".bash_history", "/root/.bash_history", "/home/*/.bash_history","/Users/.bash_history", "/Users/*/.bash_history",
51-
".zsh_history", "/root/.zsh_history", "/home/*/.zsh_history", "/Users/.zsh_history", "/Users/*/.zsh_history")) or
52-
(process.args : "history" and process.args : "-c") or
53-
(process.args : "export" and process.args : ("HISTFILE=/dev/null", "HISTFILESIZE=0")) or
54-
(process.args : "unset" and process.args : "HISTFILE") or
55-
(process.args : "set" and process.args : "history" and process.args : "+o")
56-
)
57-
'''
5818
note = """## Triage and analysis
5919
6020
> **Disclaimer**:
@@ -89,23 +49,71 @@ Shell command-line history is a crucial feature in Unix-like systems, recording
8949
- Implement stricter access controls and monitoring on the affected system to prevent unauthorized users from modifying shell history files in the future.
9050
- Escalate the incident to the security operations team for further investigation and to determine if additional systems may have been compromised.
9151
- Review and update endpoint detection and response (EDR) configurations to enhance monitoring for similar tampering attempts, ensuring alerts are generated for any future suspicious command patterns."""
52+
references = ["https://www.elastic.co/security-labs/detecting-log4j2-with-elastic-security"]
53+
risk_score = 47
54+
rule_id = "7bcbb3ac-e533-41ad-a612-d6c3bf666aba"
55+
setup = """## Setup
56+
57+
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
58+
events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
59+
Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
60+
`event.ingested` to @timestamp.
61+
For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
62+
"""
63+
severity = "medium"
64+
tags = [
65+
"Domain: Endpoint",
66+
"OS: Linux",
67+
"OS: macOS",
68+
"Use Case: Threat Detection",
69+
"Tactic: Defense Evasion",
70+
"Data Source: Elastic Defend",
71+
"Data Source: Elastic Endgame",
72+
"Data Source: Auditd Manager",
73+
"Resources: Investigation Guide",
74+
]
75+
timestamp_override = "event.ingested"
76+
type = "eql"
9277

78+
query = '''
79+
process where event.action in ("exec", "exec_event", "executed", "process_started") and event.type == "start" and
80+
(
81+
(
82+
(process.args : ("rm", "echo") or
83+
(process.args : "ln" and process.args : "-sf" and process.args : "/dev/null") or
84+
(process.args : "truncate" and process.args : "-s0")
85+
)
86+
and process.args : (
87+
".bash_history", "/root/.bash_history", "/home/*/.bash_history","/Users/.bash_history", "/Users/*/.bash_history",
88+
".zsh_history", "/root/.zsh_history", "/home/*/.zsh_history", "/Users/.zsh_history", "/Users/*/.zsh_history"
89+
)
90+
) or
91+
(process.args : "history" and process.args : "-c") or
92+
(process.args : "export" and process.args : ("HISTFILE=/dev/null", "HISTFILESIZE=0")) or
93+
(process.args : "unset" and process.args : "HISTFILE") or
94+
(process.args : "set" and process.args : "history" and process.args : "+o")
95+
) and not (
96+
process.executable like (
97+
"/usr/bin/timeout", "/usr/bin/kubectl", "/usr/bin/psql", "/usr/lib/postgresql/*/bin/psql", "/usr/bin/bazel", "/usr/bin/git", "/usr/bin/jq", "/bin/grep"
98+
) or
99+
process.command_line == "stat -c %s history"
100+
)
101+
'''
93102

94103
[[rule.threat]]
95104
framework = "MITRE ATT&CK"
105+
96106
[[rule.threat.technique]]
97107
id = "T1070"
98108
name = "Indicator Removal"
99109
reference = "https://attack.mitre.org/techniques/T1070/"
110+
100111
[[rule.threat.technique.subtechnique]]
101112
id = "T1070.003"
102113
name = "Clear Command History"
103114
reference = "https://attack.mitre.org/techniques/T1070/003/"
104115

105-
106-
107116
[rule.threat.tactic]
108117
id = "TA0005"
109118
name = "Defense Evasion"
110119
reference = "https://attack.mitre.org/tactics/TA0005/"
111-

rules/cross-platform/defense_evasion_masquerading_space_after_filename.toml

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2022/10/18"
33
integration = ["endpoint"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/12/23"
66

77
[rule]
88
author = ["Elastic"]
@@ -18,41 +18,6 @@ index = ["auditbeat-*", "logs-endpoint.events.*"]
1818
language = "eql"
1919
license = "Elastic License v2"
2020
name = "Masquerading Space After Filename"
21-
references = [
22-
"https://www.picussecurity.com/resource/blog/picus-10-critical-mitre-attck-techniques-t1036-masquerading",
23-
]
24-
risk_score = 47
25-
rule_id = "f5fb4598-4f10-11ed-bdc3-0242ac120002"
26-
setup = """## Setup
27-
28-
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
29-
events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
30-
Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
31-
`event.ingested` to @timestamp.
32-
For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
33-
"""
34-
severity = "medium"
35-
tags = [
36-
"Domain: Endpoint",
37-
"OS: Linux",
38-
"OS: macOS",
39-
"Use Case: Threat Detection",
40-
"Tactic: Defense Evasion",
41-
"Data Source: Elastic Defend",
42-
"Resources: Investigation Guide",
43-
]
44-
timestamp_override = "event.ingested"
45-
type = "eql"
46-
query = '''
47-
process where host.os.type:("linux","macos") and event.type == "start" and
48-
process.executable regex~ """/[a-z0-9\s_\-\\./]+\s""" and not (
49-
process.name in ("ls", "find", "grep", "xkbcomp") or
50-
process.executable like ("/opt/nessus_agent/*", "/opt/gitlab/sv/gitlab-exporter/*", "/tmp/ansible-admin/*") or
51-
process.parent.args in (
52-
"./check_rubrik", "/usr/bin/check_mk_agent", "/etc/rubrik/start_stop_bootstrap.sh", "/etc/rubrik/start_stop_agent.sh"
53-
)
54-
)
55-
'''
5621
note = """## Triage and analysis
5722
5823
> **Disclaimer**:
@@ -87,6 +52,42 @@ In Linux and macOS environments, file execution is determined by the file's true
8752
- Review and update endpoint protection settings to block execution of files with suspicious naming conventions, such as those ending with a space.
8853
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess potential impacts on other systems.
8954
- Implement additional monitoring for similar masquerading attempts by enhancing logging and alerting mechanisms to detect files with unusual naming patterns."""
55+
references = [
56+
"https://www.picussecurity.com/resource/blog/picus-10-critical-mitre-attck-techniques-t1036-masquerading",
57+
]
58+
risk_score = 47
59+
rule_id = "f5fb4598-4f10-11ed-bdc3-0242ac120002"
60+
setup = """## Setup
61+
62+
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
63+
events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
64+
Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
65+
`event.ingested` to @timestamp.
66+
For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
67+
"""
68+
severity = "medium"
69+
tags = [
70+
"Domain: Endpoint",
71+
"OS: Linux",
72+
"OS: macOS",
73+
"Use Case: Threat Detection",
74+
"Tactic: Defense Evasion",
75+
"Data Source: Elastic Defend",
76+
"Resources: Investigation Guide",
77+
]
78+
timestamp_override = "event.ingested"
79+
type = "eql"
80+
query = '''
81+
process where host.os.type:("linux","macos") and event.type == "start" and
82+
process.executable regex~ """/[a-z0-9\s_\-\\./]+\s""" and not (
83+
process.name in ("ls", "find", "grep", "xkbcomp") or
84+
process.executable like ("/opt/nessus_agent/*", "/opt/gitlab/sv/gitlab-exporter/*", "/tmp/ansible-admin/*") or
85+
process.parent.args in (
86+
"./check_rubrik", "/usr/bin/check_mk_agent", "/etc/rubrik/start_stop_bootstrap.sh", "/etc/rubrik/start_stop_agent.sh"
87+
) or
88+
process.args == "runc"
89+
)
90+
'''
9091

9192
[[rule.threat]]
9293
framework = "MITRE ATT&CK"

rules_building_block/defense_evasion_processes_with_trailing_spaces.toml renamed to rules/cross-platform/defense_evasion_processes_with_trailing_spaces.toml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22
creation_date = "2023/08/24"
33
integration = ["endpoint", "auditd_manager"]
44
maturity = "production"
5-
updated_date = "2024/05/21"
5+
updated_date = "2024/12/24"
66

77
[rule]
88
author = ["Elastic"]
9-
building_block_type = "default"
109
description = """
1110
Identify instances where adversaries include trailing space characters to mimic regular files, disguising their activity
1211
to evade default file handling mechanisms.
1312
"""
14-
from = "now-119m"
13+
from = "now-9m"
1514
index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_manager.auditd-*"]
16-
interval = "60m"
1715
language = "eql"
1816
license = "Elastic License v2"
1917
name = "Processes with Trailing Spaces"
@@ -26,35 +24,31 @@ tags = [
2624
"OS: macOS",
2725
"Use Case: Threat Detection",
2826
"Tactic: Defense Evasion",
29-
"Rule Type: BBR",
3027
"Data Source: Elastic Defend",
3128
"Data Source: Elastic Endgame",
3229
"Data Source: Auditd Manager",
3330
]
3431
timestamp_override = "event.ingested"
3532
type = "eql"
36-
3733
query = '''
3834
process where event.type == "start" and event.action in ("exec", "exec_event", "executed", "process_started") and
3935
process.name : "* "
4036
'''
4137

42-
4338
[[rule.threat]]
4439
framework = "MITRE ATT&CK"
40+
4541
[[rule.threat.technique]]
4642
id = "T1036"
4743
name = "Masquerading"
4844
reference = "https://attack.mitre.org/techniques/T1036/"
45+
4946
[[rule.threat.technique.subtechnique]]
5047
id = "T1036.006"
5148
name = "Space after Filename"
5249
reference = "https://attack.mitre.org/techniques/T1036/006/"
5350

54-
55-
5651
[rule.threat.tactic]
5752
id = "TA0005"
5853
name = "Defense Evasion"
5954
reference = "https://attack.mitre.org/tactics/TA0005/"
60-

0 commit comments

Comments
 (0)