System Log File Deletion

Identifies the deletion of sensitive Linux system logs. This may indicate an attempt to evade detection or destroy forensic evidence on a system.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/11/03"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/06/22"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies the deletion of sensitive Linux system logs. This may indicate an attempt to evade detection or destroy
13forensic evidence on a system.
14"""
15from = "now-9m"
16index = ["auditbeat-*", "logs-endpoint.events.*", "endgame-*"]
17language = "eql"
18license = "Elastic License v2"
19name = "System Log File Deletion"
20note = """## Setup
21
22If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
23"""
24references = [
25    "https://www.fireeye.com/blog/threat-research/2020/11/live-off-the-land-an-overview-of-unc1945.html",
26]
27risk_score = 47
28rule_id = "aa895aea-b69c-4411-b110-8d7599634b30"
29severity = "medium"
30tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Defense Evasion", "Data Source: Elastic Endgame", "Data Source: Elastic Defend"]
31timestamp_override = "event.ingested"
32type = "eql"
33
34query = '''
35file where host.os.type == "linux" and event.type == "deletion" and
36  file.path :
37    (
38    "/var/run/utmp",
39    "/var/log/wtmp",
40    "/var/log/btmp",
41    "/var/log/lastlog",
42    "/var/log/faillog",
43    "/var/log/syslog",
44    "/var/log/messages",
45    "/var/log/secure",
46    "/var/log/auth.log",
47    "/var/log/boot.log",
48    "/var/log/kern.log"
49    ) and
50    not process.name : ("gzip")
51'''
52
53
54[[rule.threat]]
55framework = "MITRE ATT&CK"
56[[rule.threat.technique]]
57id = "T1070"
58name = "Indicator Removal"
59reference = "https://attack.mitre.org/techniques/T1070/"
60[[rule.threat.technique.subtechnique]]
61id = "T1070.002"
62name = "Clear Linux or Mac System Logs"
63reference = "https://attack.mitre.org/techniques/T1070/002/"
64
65
66
67[rule.threat.tactic]
68id = "TA0005"
69name = "Defense Evasion"
70reference = "https://attack.mitre.org/tactics/TA0005/"

Setup

If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define event.ingested and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate event.ingested to @timestamp for this rule to work.

References

Related rules

to-top