Linux process attempts to delete log files using rm, rmdir, shred, or unlink
Flags Linux attempts to remove or destroy log files via rm/rmdir/shred/unlink when /var/log or mail spool paths are referenced.
- Product
- linux
- Category
- process_creation
- Author
- Ömer Günal, oscd.community (SigmaHQ), DRL 1.1
- Published
- 2020-10-07
- Updated
- 2026-07-31
ATT&CK techniques
Recon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags Linux process executions where the binary name ends with rm, rmdir, shred, or unlink and the command line includes references to /var/log or /var/spool/mail. Clearing or destroying logs can help attackers reduce forensic evidence after malicious activity. It relies on process creation telemetry (process image path and command line content) to identify likely log-targeting delete operations, while excluding a couple of specific rm -f sysstat and dmesg paths.
Reporting behind it
Changelog
v3- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Linux process attempts to delete log files using rm, rmdir, shred, or unlink
id: 0617044c-186e-467e-9f1a-ad5df9f1591b
status: stable
description: This rule flags Linux process executions where the binary name ends with rm, rmdir, shred, or unlink and the command line includes references to /var/log or /var/spool/mail. Clearing or destroying logs can help attackers reduce forensic evidence after malicious activity. It relies on process creation telemetry (process image path and command line content) to identify likely log-targeting delete operations, while excluding a couple of specific rm -f sysstat and dmesg paths.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1070.002/T1070.002.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_clear_logs.yml
author: Ömer Günal, oscd.community, Huntrule Team
date: 2020-10-07
modified: 2026-03-18
tags:
- attack.defense-impairment
- attack.t1685.006
logsource:
product: linux
category: process_creation
detection:
selection:
Image|endswith:
- /rm
- /rmdir
- /shred
- /unlink
CommandLine|contains:
- /var/log
- /var/spool/mail
filter_main_legit_systat:
Image|endswith: /rm
CommandLine|startswith: rm -f /var/log/sysstat/
filter_main_dmseg:
Image|endswith: /rm
CommandLine|startswith: rm -f -- /var/log//dmesg
condition: selection and not 1 of filter_main_*
falsepositives:
- Legitimate administration activities
level: medium
license: DRL-1.1
related:
- id: 80915f59-9b56-4616-9de0-fd0dea6c12fe
type: derived