Skip to content

Commit 587b16c

Browse files
committed
[Rule Tuning] File Deletion via Shred
1 parent c3d0916 commit 587b16c

File tree

2 files changed

+119
-3
lines changed

2 files changed

+119
-3
lines changed

rules/linux/defense_evasion_file_deletion_via_shred.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/04/27"
33
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
44
maturity = "production"
5-
updated_date = "2025/03/20"
5+
updated_date = "2025/12/01"
66

77
[rule]
88
author = ["Elastic"]
@@ -98,8 +98,8 @@ timestamp_override = "event.ingested"
9898
type = "eql"
9999

100100
query = '''
101-
process where host.os.type == "linux" and event.type == "start" and process.name == "shred" and process.args in (
102-
"-u", "--remove", "-z", "--zero"
101+
process where host.os.type == "linux" and event.type == "start" and process.name == "shred" and process.args like (
102+
"-*u*", "--remove", "-*z*", "--zero"
103103
) and not process.parent.name == "logrotate"
104104
'''
105105

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
[metadata]
2+
creation_date = "2025/12/01"
3+
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
4+
maturity = "production"
5+
updated_date = "2025/12/01"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
This rule detects the creation of pods or containers that execute suspicious commands often associated with persistence or
11+
privilege escalation techniques. Attackers may use container orchestration tools like Kubernetes ("kubectl") or container
12+
runtimes like Docker ("docker") to create pods or containers that run shell commands (e.g., "bash", "sh", "zsh") with
13+
arguments that indicate attempts to establish persistence (e.g., modifying startup scripts, creating backdoors).
14+
"""
15+
from = "now-9m"
16+
index = [
17+
"auditbeat-*",
18+
"endgame-*",
19+
"logs-auditd_manager.auditd-*",
20+
"logs-crowdstrike.fdr*",
21+
"logs-endpoint.events.process*",
22+
"logs-sentinel_one_cloud_funnel.*",
23+
]
24+
language = "eql"
25+
license = "Elastic License v2"
26+
name = "Pod or Container Creation with Suspicious Command-Line"
27+
risk_score = 47
28+
rule_id = "c595363f-52a6-49e1-9257-0e08ae043dbd"
29+
severity = "medium"
30+
tags = [
31+
"Domain: Endpoint",
32+
"Domain: Container",
33+
"OS: Linux",
34+
"Use Case: Threat Detection",
35+
"Tactic: Execution",
36+
"Tactic: Privilege Escalation",
37+
"Tactic: Persistence",
38+
"Data Source: Elastic Defend",
39+
"Data Source: Elastic Endgame",
40+
"Data Source: Auditd Manager",
41+
"Data Source: Crowdstrike",
42+
"Data Source: SentinelOne",
43+
]
44+
timestamp_override = "event.ingested"
45+
type = "eql"
46+
query = '''
47+
process where event.type == "start" and event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and (
48+
(process.name == "kubectl" and process.args == "run" and process.args == "--restart=Never" and process.args == "--" and process.args in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")) or
49+
(process.name == "docker")
50+
) and process.command_line like~ (
51+
"*atd*", "*cron*", "*/etc/rc.local*", "*/dev/tcp/*", "*/etc/init.d*", "*/etc/update-motd.d*", "*/etc/ld.so*", "*/etc/sudoers*", "*base64 *",
52+
"*/etc/profile*", "*/etc/ssh*", "*/home/*/.ssh/*", "*/root/.ssh*" , "*~/.ssh/*", "*autostart*", "*xxd *", "*/etc/shadow*", "*./.*",
53+
"*import*pty*spawn*", "*import*subprocess*call*", "*TCPSocket.new*", "*TCPSocket.open*", "*io.popen*", "*os.execute*", "*fsockopen*",
54+
"*disown*", "* ncat *", "* nc *", "* netcat *", "* nc.traditional *", "*socat*", "*telnet*", "*/tmp/*", "*/dev/shm/*", "*/var/tmp/*",
55+
"*/boot/*", "*/sys/*", "*/lost+found/*", "*/media/*", "*/proc/*", "*/var/backups/*", "*/var/log/*", "*/var/mail/*", "*/var/spool/*"
56+
)
57+
'''
58+
59+
[[rule.threat]]
60+
framework = "MITRE ATT&CK"
61+
62+
[[rule.threat.technique]]
63+
id = "T1059"
64+
name = "Command and Scripting Interpreter"
65+
reference = "https://attack.mitre.org/techniques/T1059/"
66+
67+
[[rule.threat.technique.subtechnique]]
68+
id = "T1059.004"
69+
name = "Unix Shell"
70+
reference = "https://attack.mitre.org/techniques/T1059/004/"
71+
72+
[[rule.threat.technique]]
73+
id = "T1609"
74+
name = "Container Administration Command"
75+
reference = "https://attack.mitre.org/techniques/T1609/"
76+
77+
[rule.threat.tactic]
78+
id = "TA0002"
79+
name = "Execution"
80+
reference = "https://attack.mitre.org/tactics/TA0002/"
81+
82+
[[rule.threat]]
83+
framework = "MITRE ATT&CK"
84+
85+
[[rule.threat.technique]]
86+
id = "T1611"
87+
name = "Escape to Host"
88+
reference = "https://attack.mitre.org/techniques/T1611/"
89+
90+
[rule.threat.tactic]
91+
id = "TA0004"
92+
name = "Privilege Escalation"
93+
reference = "https://attack.mitre.org/tactics/TA0004/"
94+
95+
[[rule.threat]]
96+
framework = "MITRE ATT&CK"
97+
98+
[[rule.threat.technique]]
99+
id = "T1053"
100+
name = "Scheduled Task/Job"
101+
reference = "https://attack.mitre.org/techniques/T1053/"
102+
103+
[[rule.threat.technique.subtechnique]]
104+
id = "T1053.002"
105+
name = "At"
106+
reference = "https://attack.mitre.org/techniques/T1053/002/"
107+
108+
[[rule.threat.technique.subtechnique]]
109+
id = "T1053.003"
110+
name = "Cron"
111+
reference = "https://attack.mitre.org/techniques/T1053/003/"
112+
113+
[rule.threat.tactic]
114+
id = "TA0003"
115+
name = "Persistence"
116+
reference = "https://attack.mitre.org/tactics/TA0003/"

0 commit comments

Comments
 (0)