Detection rules › Sigma

Linux Logs Clearing Attempts

Status
stable
Severity
medium
Log source
product linux, category process_creation
Author
Ömer Günal, oscd.community
Source
github.com/SigmaHQ/sigma

Detects logs clearing attempts on Linux systems via utilities such as 'rm', 'rmdir', 'shred', and 'unlink' targeting log files and directories. Adversaries often try to clear logs to cover their tracks after performing malicious activities.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Linux Logs Clearing Attempts
id: 80915f59-9b56-4616-9de0-fd0dea6c12fe
status: stable
description: |
    Detects logs clearing attempts on Linux systems via utilities such as 'rm', 'rmdir', 'shred', and 'unlink' targeting log files and directories.
    Adversaries often try to clear logs to cover their tracks after performing malicious activities.
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1070.002/T1070.002.md
author: Ömer Günal, oscd.community
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'    # covers /rmdir as well
            - '/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' # // before dmesg is not typo
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Legitimate administration activities
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_*

Stage 1: selection

selection:
    Image|endswith:
        - '/rm'
        - '/rmdir'
        - '/shred'
        - '/unlink'
    CommandLine|contains:
        - '/var/log'
        - '/var/spool/mail'

Stage 2: not filter_main_*

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'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
CommandLinestarts_withrm -f -- /var/log//dmesg
Imageends_with/rm
CommandLinestarts_withrm -f /var/log/sysstat/
Imageends_with/rm

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • /var/log
  • /var/spool/mail
Imageends_with
  • /rm
  • /rmdir
  • /shred
  • /unlink