Skip to content

Commit 949cb75

Browse files
authored
[New Rule] Attempt to Clear Logs via Journalctl (#5170)
1 parent 1833d2e commit 949cb75

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
[metadata]
2+
creation_date = "2025/10/01"
3+
integration = ["endpoint", "auditd_manager", "crowdstrike", "sentinel_one_cloud_funnel"]
4+
maturity = "production"
5+
updated_date = "2025/10/01"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
This rule monitors for attempts to clear logs using the "journalctl" command on Linux systems. Adversaries may use this
11+
technique to cover their tracks by deleting or truncating log files, making it harder for defenders to investigate their
12+
activities. The rule looks for the execution of "journalctl" with arguments that indicate log clearing actions, such as
13+
"--vacuum-time", "--vacuum-size", or "--vacuum-files".
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 = "Attempt to Clear Logs via Journalctl"
27+
risk_score = 21
28+
rule_id = "09073bf4-a8ea-4bce-9fd5-2bb56b4d31f4"
29+
setup = """## Setup
30+
31+
This rule requires data coming in from Elastic Defend.
32+
33+
### Elastic Defend Integration Setup
34+
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
35+
36+
#### Prerequisite Requirements:
37+
- Fleet is required for Elastic Defend.
38+
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
39+
40+
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
41+
- Go to the Kibana home page and click "Add integrations".
42+
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
43+
- Click "Add Elastic Defend".
44+
- Configure the integration name and optionally add a description.
45+
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
46+
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
47+
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
48+
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
49+
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
50+
- Click "Save and Continue".
51+
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
52+
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
53+
"""
54+
severity = "low"
55+
tags = [
56+
"Domain: Endpoint",
57+
"OS: Linux",
58+
"Use Case: Threat Detection",
59+
"Tactic: Defense Evasion",
60+
"Data Source: Elastic Defend",
61+
"Data Source: Elastic Endgame",
62+
"Data Source: Auditd Manager",
63+
"Data Source: Crowdstrike",
64+
"Data Source: SentinelOne",
65+
]
66+
timestamp_override = "event.ingested"
67+
type = "eql"
68+
query = '''
69+
process where host.os.type == "linux" and event.type == "start" and
70+
event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
71+
process.name == "journalctl" and process.args like ("--vacuum-time=*", "--vacuum-size=*", "--vacuum-files=*")
72+
'''
73+
74+
[[rule.threat]]
75+
framework = "MITRE ATT&CK"
76+
77+
[[rule.threat.technique]]
78+
id = "T1070"
79+
name = "Indicator Removal"
80+
reference = "https://attack.mitre.org/techniques/T1070/"
81+
82+
[[rule.threat.technique.subtechnique]]
83+
id = "T1070.002"
84+
name = "Clear Linux or Mac System Logs"
85+
reference = "https://attack.mitre.org/techniques/T1070/002/"
86+
87+
[[rule.threat.technique]]
88+
id = "T1562"
89+
name = "Impair Defenses"
90+
reference = "https://attack.mitre.org/techniques/T1562/"
91+
92+
[[rule.threat.technique.subtechnique]]
93+
id = "T1562.001"
94+
name = "Disable or Modify Tools"
95+
reference = "https://attack.mitre.org/techniques/T1562/001/"
96+
97+
[rule.threat.tactic]
98+
id = "TA0005"
99+
name = "Defense Evasion"
100+
reference = "https://attack.mitre.org/tactics/TA0005/"

0 commit comments

Comments
 (0)