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)

  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/11/02"
 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.
 15from = "now-9m"
 16index = ["auditbeat-*", "*", "endgame-*"]
 17language = "eql"
 18license = "Elastic License v2"
 19name = "System Log File Deletion"
 20references = [
 21    "",
 23risk_score = 47
 24rule_id = "aa895aea-b69c-4411-b110-8d7599634b30"
 25setup = """## Setup
 27This rule requires data coming in from one of the following integrations:
 28- Elastic Defend
 29- Auditbeat
 31### Elastic Defend Integration Setup
 32Elastic 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.
 34#### Prerequisite Requirements:
 35- Fleet is required for Elastic Defend.
 36- To configure Fleet Server refer to the [documentation](
 38#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 39- Go to the Kibana home page and click "Add integrations".
 40- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 41- Click "Add Elastic Defend".
 42- Configure the integration name and optionally add a description.
 43- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 44- 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](
 45- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 46- 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.
 47For more details on Elastic Agent configuration settings, refer to the [helper guide](
 48- Click "Save and Continue".
 49- 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.
 50For more details on Elastic Defend refer to the [helper guide](
 52### Auditbeat Setup
 53Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.
 55#### The following steps should be executed in order to add the Auditbeat on a Linux System:
 56- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
 57- To install the APT and YUM repositories follow the setup instructions in this [helper guide](
 58- To run Auditbeat on Docker follow the setup instructions in the [helper guide](
 59- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](
 60- For complete “Setup and Run Auditbeat” information refer to the [helper guide](
 62#### Custom Ingest Pipeline
 63For versions <8.2, you need to add a custom ingest pipeline to populate `event.ingested` with @timestamp for non-elastic-agent indexes, like auditbeats/filebeat/winlogbeat etc. For more details to add a custom ingest pipeline refer to the [guide](
 65severity = "medium"
 66tags = [
 67        "Domain: Endpoint",
 68        "OS: Linux",
 69        "Use Case: Threat Detection",
 70        "Tactic: Defense Evasion",
 71        "Data Source: Elastic Endgame",
 72        "Data Source: Elastic Defend"
 73        ]
 74timestamp_override = "event.ingested"
 75type = "eql"
 77query = '''
 78file where host.os.type == "linux" and event.type == "deletion" and
 79  file.path :
 80    (
 81    "/var/run/utmp",
 82    "/var/log/wtmp",
 83    "/var/log/btmp",
 84    "/var/log/lastlog",
 85    "/var/log/faillog",
 86    "/var/log/syslog",
 87    "/var/log/messages",
 88    "/var/log/secure",
 89    "/var/log/auth.log",
 90    "/var/log/boot.log",
 91    "/var/log/kern.log"
 92    ) and
 93    not in ("gzip", "executor", "dockerd")
 97framework = "MITRE ATT&CK"
100id = "T1070"
101name = "Indicator Removal"
102reference = ""
105id = "T1070.002"
106name = "Clear Linux or Mac System Logs"
107reference = ""
110id = "TA0005"
111name = "Defense Evasion"
112reference = ""


Related rules