Skip to content

Commit 2d947d4

Browse files
Aegrahgithub-actions[bot]
authored andcommitted
[BBR Promotion] Q2 Linux BBR Promotion (#4172)
* [BBR Promotion] Q2 Linux BBR Promotion * Update collection_linux_clipboard_activity.toml * Update defense_evasion_creation_of_hidden_files_directories.toml (cherry picked from commit 6012544)
1 parent 9fa4ac1 commit 2d947d4

6 files changed

+30
-58
lines changed

rules_building_block/collection_linux_suspicious_clipboard_activity.toml renamed to rules/linux/collection_linux_clipboard_activity.toml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
creation_date = "2023/07/27"
33
integration = ["endpoint", "auditd_manager"]
44
maturity = "production"
5-
updated_date = "2024/05/21"
5+
updated_date = "2024/10/18"
66

77
[rule]
88
author = ["Elastic"]
9-
building_block_type = "default"
109
description = """
1110
This rule monitors for the usage of the most common clipboard utilities on unix systems by an uncommon process group
1211
leader. Adversaries may collect data stored in the clipboard from users copying information within or between
1312
applications.
1413
"""
15-
from = "now-119m"
14+
from = "now-9m"
1615
index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_manager.auditd-*"]
17-
interval = "60m"
1816
language = "kuery"
1917
license = "Elastic License v2"
20-
name = "Potential Suspicious Clipboard Activity Detected"
18+
name = "Linux Clipboard Activity Detected"
2119
risk_score = 21
2220
rule_id = "884e87cc-c67b-4c90-a4ed-e1e24a940c82"
2321
severity = "low"
@@ -26,29 +24,27 @@ tags = [
2624
"OS: Linux",
2725
"Use Case: Threat Detection",
2826
"Tactic: Collection",
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 = "new_terms"
36-
3733
query = '''
38-
event.category:process and host.os.type:"linux" and
39-
event.type:"start" and event.action:("exec" or "exec_event" or "executed" or "process_started") and
40-
process.name:("xclip" or "xsel" or "wl-clipboard" or "clipman" or "copyq")
34+
event.category:process and host.os.type:"linux" and event.type:"start" and
35+
event.action:("exec" or "exec_event" or "executed" or "process_started") and
36+
process.name:("xclip" or "xsel" or "wl-clipboard" or "clipman" or "copyq") and
37+
not process.parent.name:("bwrap" or "micro")
4138
'''
4239

43-
4440
[[rule.threat]]
4541
framework = "MITRE ATT&CK"
42+
4643
[[rule.threat.technique]]
4744
id = "T1115"
4845
name = "Clipboard Data"
4946
reference = "https://attack.mitre.org/techniques/T1115/"
5047

51-
5248
[rule.threat.tactic]
5349
id = "TA0009"
5450
name = "Collection"
@@ -57,8 +53,7 @@ reference = "https://attack.mitre.org/tactics/TA0009/"
5753
[rule.new_terms]
5854
field = "new_terms_fields"
5955
value = ["host.id", "process.group_leader.executable"]
56+
6057
[[rule.new_terms.history_window_start]]
6158
field = "history_window_start"
6259
value = "now-7d"
63-
64-

rules_building_block/command_and_control_linux_ssh_x11_forwarding.toml renamed to rules/linux/command_and_control_linux_ssh_x11_forwarding.toml

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

77
[transform]
88
[[transform.osquery]]
@@ -32,19 +32,17 @@ query = "SELECT name, cmdline, parent, path, uid FROM processes"
3232

3333
[rule]
3434
author = ["Elastic"]
35-
building_block_type = "default"
3635
description = """
3736
This rule monitors for X11 forwarding via SSH. X11 forwarding is a feature that allows users to run graphical
3837
applications on a remote server and display the application's graphical user interface on their local machine. Attackers
3938
can abuse X11 forwarding for tunneling their GUI-based tools, pivot through compromised systems, and create covert
4039
communication channels, enabling lateral movement and facilitating remote control of systems within a network.
4140
"""
42-
from = "now-119m"
41+
from = "now-9m"
4342
index = ["logs-endpoint.events.*", "endgame-*"]
44-
interval = "60m"
4543
language = "eql"
4644
license = "Elastic License v2"
47-
name = "Potential Linux SSH X11 Forwarding"
45+
name = "Linux SSH X11 Forwarding"
4846
note = """## Triage and analysis
4947
5048
### Investigating Potential Linux SSH X11 Forwarding
@@ -115,28 +113,24 @@ tags = [
115113
"Tactic: Command and Control",
116114
"Data Source: Elastic Defend",
117115
"Data Source: Elastic Endgame",
118-
"Rule Type: BBR",
119116
]
120117
timestamp_override = "event.ingested"
121118
type = "eql"
122-
123119
query = '''
124120
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event") and
125121
process.name in ("ssh", "sshd") and process.args in ("-X", "-Y") and process.args_count >= 3 and
126122
process.parent.name in ("bash", "dash", "ash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")
127123
'''
128124

129-
130125
[[rule.threat]]
131126
framework = "MITRE ATT&CK"
127+
132128
[[rule.threat.technique]]
133129
id = "T1572"
134130
name = "Protocol Tunneling"
135131
reference = "https://attack.mitre.org/techniques/T1572/"
136132

137-
138133
[rule.threat.tactic]
139134
id = "TA0011"
140135
name = "Command and Control"
141136
reference = "https://attack.mitre.org/tactics/TA0011/"
142-

rules_building_block/defense_evasion_acl_modification_via_setfacl.toml renamed to rules/linux/defense_evasion_acl_modification_via_setfacl.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
[metadata]
2-
bypass_bbr_timing = true
32
creation_date = "2024/08/23"
43
integration = ["endpoint", "auditd_manager"]
54
maturity = "production"
6-
updated_date = "2024/08/23"
5+
updated_date = "2024/10/18"
76

87
[rule]
98
author = ["Elastic"]
10-
building_block_type = "default"
119
description = """
12-
This building block rule (BBR) detects Linux Access Control List (ACL) modification via the setfacl command.
10+
This rule detects Linux Access Control List (ACL) modification via the setfacl command.
1311
"""
1412
from = "now-9m"
1513
index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_manager.auditd-*"]
@@ -25,7 +23,6 @@ tags = [
2523
"OS: Linux",
2624
"Use Case: Threat Detection",
2725
"Tactic: Defense Evasion",
28-
"Rule Type: BBR",
2926
"Data Source: Elastic Defend",
3027
"Data Source: Elastic Endgame",
3128
"Data Source: Auditd Manager",
@@ -35,7 +32,10 @@ type = "eql"
3532
query = '''
3633
process where host.os.type == "linux" and event.type == "start" and
3734
event.action in ("exec", "exec_event", "executed", "process_started") and
38-
process.name == "setfacl"
35+
process.name == "setfacl" and not (
36+
process.command_line == "/bin/setfacl --restore=-" or
37+
process.args == "/var/log/journal/"
38+
)
3939
'''
4040

4141
[[rule.threat]]

rules_building_block/defense_evasion_creation_of_hidden_files_directories.toml renamed to rules/linux/defense_evasion_creation_of_hidden_files_directories.toml

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

77
[rule]
88
author = ["Elastic"]
9-
building_block_type = "default"
109
description = """
1110
Identify activity related where adversaries can add the 'hidden' flag to files to hide them from the user in an attempt
1211
to evade detection.
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 = "Hidden Files and Directories via Hidden Flag"
@@ -26,34 +24,30 @@ 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 = '''
38-
file where event.type == "creation" and process.name == "chflags"
34+
file where host.os.type == "linux" and event.type == "creation" and process.name == "chflags"
3935
'''
4036

41-
4237
[[rule.threat]]
4338
framework = "MITRE ATT&CK"
39+
4440
[[rule.threat.technique]]
4541
id = "T1564"
4642
name = "Hide Artifacts"
4743
reference = "https://attack.mitre.org/techniques/T1564/"
44+
4845
[[rule.threat.technique.subtechnique]]
4946
id = "T1564.001"
5047
name = "Hidden Files and Directories"
5148
reference = "https://attack.mitre.org/techniques/T1564/001/"
5249

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

rules_building_block/discovery_suspicious_memory_grep_activity.toml renamed to rules/linux/discovery_suspicious_memory_grep_activity.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
[metadata]
2-
bypass_bbr_timing = true
32
creation_date = "2024/02/05"
43
integration = ["endpoint"]
54
maturity = "production"
6-
updated_date = "2024/05/21"
5+
updated_date = "2024/10/18"
76

87
[rule]
98
author = ["Elastic"]
10-
building_block_type = "default"
119
description = """
1210
Monitors for grep activity related to memory mapping. The /proc/*/maps file in Linux provides a memory map for a
1311
specific process, detailing the memory segments, permissions, and what files are mapped to these segments. Attackers may
@@ -27,29 +25,25 @@ tags = [
2725
"OS: Linux",
2826
"Use Case: Threat Detection",
2927
"Tactic: Discovery",
30-
"Rule Type: BBR",
3128
"Data Source: Elastic Defend",
3229
"Data Source: Elastic Endgame",
3330
]
3431
timestamp_override = "event.ingested"
3532
type = "eql"
36-
3733
query = '''
3834
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event") and
3935
process.name in ("grep", "egrep", "fgrep", "rgrep") and process.args in ("[stack]", "[vdso]", "[heap]")
4036
'''
4137

42-
4338
[[rule.threat]]
4439
framework = "MITRE ATT&CK"
40+
4541
[[rule.threat.technique]]
4642
id = "T1057"
4743
name = "Process Discovery"
4844
reference = "https://attack.mitre.org/techniques/T1057/"
4945

50-
5146
[rule.threat.tactic]
5247
id = "TA0007"
5348
name = "Discovery"
5449
reference = "https://attack.mitre.org/tactics/TA0007/"
55-

rules_building_block/execution_unix_socket_communication.toml renamed to rules/linux/execution_unix_socket_communication.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
[metadata]
2-
bypass_bbr_timing = true
32
creation_date = "2023/09/04"
43
integration = ["endpoint", "auditd_manager"]
54
maturity = "production"
6-
updated_date = "2024/05/21"
5+
updated_date = "2024/10/18"
76

87
[rule]
98
author = ["Elastic"]
10-
building_block_type = "default"
119
description = """
1210
This rule monitors for inter-process communication via Unix sockets. Adversaries may attempt to communicate with local
1311
Unix sockets to enumerate application details, find vulnerabilities/configuration mistakes and potentially escalate
@@ -28,34 +26,31 @@ tags = [
2826
"Use Case: Threat Detection",
2927
"Tactic: Execution",
3028
"Data Source: Elastic Defend",
31-
"Rule Type: BBR",
3229
"Data Source: Elastic Endgame",
3330
"Data Source: Auditd Manager",
3431
]
3532
timestamp_override = "event.ingested"
3633
type = "eql"
37-
3834
query = '''
3935
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "executed", "process_started")
4036
and (
4137
(process.name in ("nc", "ncat", "netcat", "nc.openbsd") and
4238
process.args == "-U" and process.args : ("/usr/local/*", "/run/*", "/var/run/*")) or
4339
(process.name == "socat" and
4440
process.args == "-" and process.args : ("UNIX-CLIENT:/usr/local/*", "UNIX-CLIENT:/run/*", "UNIX-CLIENT:/var/run/*"))
45-
)
41+
) and
42+
not process.args == "/var/run/libvirt/libvirt-sock"
4643
'''
4744

48-
4945
[[rule.threat]]
5046
framework = "MITRE ATT&CK"
47+
5148
[[rule.threat.technique]]
5249
id = "T1559"
5350
name = "Inter-Process Communication"
5451
reference = "https://attack.mitre.org/techniques/T1559/"
5552

56-
5753
[rule.threat.tactic]
5854
id = "TA0002"
5955
name = "Execution"
6056
reference = "https://attack.mitre.org/tactics/TA0002/"
61-

0 commit comments

Comments
 (0)