Skip to content

Commit 3f7e43c

Browse files
Aegrahgithub-actions[bot]
authored andcommitted
[Rule Tuning] Q2 Linux DR Tuning - CP (#4170)
* [Rule Tuning] Q2 Linux DR Tuning - CP * Update command_and_control_non_standard_ssh_port.toml (cherry picked from commit 09bd4ce)
1 parent 71dcc43 commit 3f7e43c

6 files changed

+36
-98
lines changed

rules/cross-platform/command_and_control_non_standard_ssh_port.toml

Lines changed: 12 additions & 7 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 = "2024/05/21"
5+
updated_date = "2024/10/18"
66

77
[rule]
88
author = ["Elastic"]
@@ -37,30 +37,35 @@ tags = [
3737
"Data Source: Elastic Defend",
3838
]
3939
type = "eql"
40-
4140
query = '''
4241
sequence by process.entity_id with maxspan=1m
43-
[process where event.action == "exec" and process.name:"ssh" and not process.parent.name in (
42+
[process where event.action == "exec" and process.name in ("ssh", "sshd") and not process.parent.name in (
4443
"rsync", "pyznap", "git", "ansible-playbook", "scp", "pgbackrest", "git-lfs", "expect", "Sourcetree", "ssh-copy-id",
4544
"run"
4645
)
4746
]
4847
[network where process.name:"ssh" and event.action in ("connection_attempted", "connection_accepted") and
49-
destination.port != 22 and destination.ip != "127.0.0.1" and network.transport: "tcp"
48+
destination.port != 22 and network.transport == "tcp" and not (
49+
destination.ip == null or destination.ip == "0.0.0.0" or cidrmatch(
50+
destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
51+
"192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
52+
"192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
53+
"192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
54+
"FF00::/8"
55+
)
56+
)
5057
]
5158
'''
5259

53-
5460
[[rule.threat]]
5561
framework = "MITRE ATT&CK"
62+
5663
[[rule.threat.technique]]
5764
id = "T1571"
5865
name = "Non-Standard Port"
5966
reference = "https://attack.mitre.org/techniques/T1571/"
6067

61-
6268
[rule.threat.tactic]
6369
id = "TA0011"
6470
name = "Command and Control"
6571
reference = "https://attack.mitre.org/tactics/TA0011/"
66-

rules/cross-platform/defense_evasion_elastic_agent_service_terminated.toml

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

77
[rule]
88
author = ["Elastic"]
@@ -39,7 +39,6 @@ tags = [
3939
]
4040
timestamp_override = "event.ingested"
4141
type = "eql"
42-
4342
query = '''
4443
process where
4544
/* net, sc or wmic stopping or deleting Elastic Agent on Windows */
@@ -52,7 +51,7 @@ or
5251
(event.type == "end" and
5352
(process.name : ("systemctl", "service") and
5453
process.args : "elastic-agent" and
55-
process.args : "stop")
54+
process.args : ("stop", "disable"))
5655
or
5756
/* pkill , killall used to stop Elastic Agent on Linux */
5857
( event.type == "end" and process.name : ("pkill", "killall") and process.args: "elastic-agent")
@@ -63,22 +62,20 @@ or
6362
event.action : "end"))
6463
'''
6564

66-
6765
[[rule.threat]]
6866
framework = "MITRE ATT&CK"
67+
6968
[[rule.threat.technique]]
7069
id = "T1562"
7170
name = "Impair Defenses"
7271
reference = "https://attack.mitre.org/techniques/T1562/"
72+
7373
[[rule.threat.technique.subtechnique]]
7474
id = "T1562.001"
7575
name = "Disable or Modify Tools"
7676
reference = "https://attack.mitre.org/techniques/T1562/001/"
7777

78-
79-
8078
[rule.threat.tactic]
8179
id = "TA0005"
8280
name = "Defense Evasion"
8381
reference = "https://attack.mitre.org/tactics/TA0005/"
84-

rules/cross-platform/defense_evasion_masquerading_space_after_filename.toml

Lines changed: 11 additions & 10 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 = "2024/05/21"
5+
updated_date = "2024/10/18"
66

77
[rule]
88
author = ["Elastic"]
@@ -42,30 +42,31 @@ tags = [
4242
]
4343
timestamp_override = "event.ingested"
4444
type = "eql"
45-
4645
query = '''
47-
process where host.os.type:("linux","macos") and
48-
event.type == "start" and
49-
(process.executable regex~ """/[a-z0-9\s_\-\\./]+\s""") and not
50-
process.name in ("ls", "find", "grep", "xkbcomp")
46+
process where host.os.type:("linux","macos") and event.type == "start" and
47+
process.executable regex~ """/[a-z0-9\s_\-\\./]+\s""" and not (
48+
process.name in ("ls", "find", "grep", "xkbcomp") or
49+
process.executable like ("/opt/nessus_agent/*", "/opt/gitlab/sv/gitlab-exporter/*", "/tmp/ansible-admin/*") or
50+
process.parent.args in (
51+
"./check_rubrik", "/usr/bin/check_mk_agent", "/etc/rubrik/start_stop_bootstrap.sh", "/etc/rubrik/start_stop_agent.sh"
52+
)
53+
)
5154
'''
5255

53-
5456
[[rule.threat]]
5557
framework = "MITRE ATT&CK"
58+
5659
[[rule.threat.technique]]
5760
id = "T1036"
5861
name = "Masquerading"
5962
reference = "https://attack.mitre.org/techniques/T1036/"
63+
6064
[[rule.threat.technique.subtechnique]]
6165
id = "T1036.006"
6266
name = "Space after Filename"
6367
reference = "https://attack.mitre.org/techniques/T1036/006/"
6468

65-
66-
6769
[rule.threat.tactic]
6870
id = "TA0005"
6971
name = "Defense Evasion"
7072
reference = "https://attack.mitre.org/tactics/TA0005/"
71-

rules/cross-platform/discovery_security_software_grep.toml

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

77
[rule]
88
author = ["Elastic"]
@@ -68,7 +68,6 @@ tags = [
6868
]
6969
timestamp_override = "event.ingested"
7070
type = "eql"
71-
7271
query = '''
7372
process where event.type == "start" and
7473
process.name : "grep" and user.id != "0" and
@@ -106,6 +105,7 @@ process.name : "grep" and user.id != "0" and
106105
) and
107106
not (
108107
(process.args : "Avast" and process.args : "Passwords") or
108+
(process.args == "osquery.conf") or
109109
(process.parent.args : "/opt/McAfee/agent/scripts/ma" and process.parent.args : "checkhealth") or
110110
(process.command_line : (
111111
"grep ESET Command-line scanner, version %s -A2",
@@ -121,22 +121,20 @@ process.name : "grep" and user.id != "0" and
121121
)
122122
'''
123123

124-
125124
[[rule.threat]]
126125
framework = "MITRE ATT&CK"
126+
127127
[[rule.threat.technique]]
128128
id = "T1518"
129129
name = "Software Discovery"
130130
reference = "https://attack.mitre.org/techniques/T1518/"
131+
131132
[[rule.threat.technique.subtechnique]]
132133
id = "T1518.001"
133134
name = "Security Software Discovery"
134135
reference = "https://attack.mitre.org/techniques/T1518/001/"
135136

136-
137-
138137
[rule.threat.tactic]
139138
id = "TA0007"
140139
name = "Discovery"
141140
reference = "https://attack.mitre.org/tactics/TA0007/"
142-

rules/cross-platform/execution_python_script_in_cmdline.toml

Lines changed: 0 additions & 61 deletions
This file was deleted.

rules/cross-platform/execution_suspicious_jar_child_process.toml

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

77
[rule]
88
author = ["Elastic"]
@@ -14,7 +14,7 @@ from = "now-9m"
1414
index = ["auditbeat-*", "logs-endpoint.events.*"]
1515
language = "kuery"
1616
license = "Elastic License v2"
17-
name = "Suspicious JAVA Child Process"
17+
name = "Deprecated - Suspicious JAVA Child Process"
1818
note = """## Triage and analysis
1919
2020
### Investigating Suspicious Java Child Process
@@ -85,20 +85,19 @@ event.category:process and event.type:("start" or "process_started") and process
8585
)
8686
'''
8787

88-
8988
[[rule.threat]]
9089
framework = "MITRE ATT&CK"
90+
9191
[[rule.threat.technique]]
9292
id = "T1059"
9393
name = "Command and Scripting Interpreter"
9494
reference = "https://attack.mitre.org/techniques/T1059/"
95+
9596
[[rule.threat.technique.subtechnique]]
9697
id = "T1059.007"
9798
name = "JavaScript"
9899
reference = "https://attack.mitre.org/techniques/T1059/007/"
99100

100-
101-
102101
[rule.threat.tactic]
103102
id = "TA0002"
104103
name = "Execution"
@@ -107,8 +106,7 @@ reference = "https://attack.mitre.org/tactics/TA0002/"
107106
[rule.new_terms]
108107
field = "new_terms_fields"
109108
value = ["host.id", "process.command_line"]
109+
110110
[[rule.new_terms.history_window_start]]
111111
field = "history_window_start"
112112
value = "now-14d"
113-
114-

0 commit comments

Comments
 (0)