Linux auditd: Clear kernel ring buffer via syslog syscall (action 5/4/6)

Flags auditd syslog syscall actions that clear or suppress kernel ring buffer (dmesg) logs.

FreeReviewedSigma · Medium · v3
Product
linux
Service
auditd
Author
Milad Cheraghi (SigmaHQ), DRL 1.1
Published
2025-05-27
Updated
2026-07-31
title: "Linux auditd: Clear kernel ring buffer via syslog syscall (action 5/4/6)"
id: 00d49b8c-a08b-49f5-b28f-61bf8245ca3a
status: experimental
description: This rule flags Linux syslog syscall executions where the syscall action code clears kernel ring buffer content or disables console logging. Attackers can use these operations to reduce or remove evidence from dmesg logs after exploitation or privilege escalation. The detection relies on auditd records capturing the syslog syscall with argument values matching actions 4, 5, and 6 on 32-bit or 64-bit architectures.
references:
  - https://man7.org/linux/man-pages/man2/syslog.2.html
  - https://man7.org/linux/man-pages/man1/dmesg.1.html
  - https://github.com/SigmaHQ/sigma/blob/master/rules/linux/auditd/syscall/lnx_auditd_clean_disable_dmesg_logs_via_syslog.yml
author: Milad Cheraghi, Huntrule Team
date: 2025-05-27
modified: 2025-12-05
tags:
  - attack.defense-impairment
  - attack.t1685.006
logsource:
  product: linux
  service: auditd
  definition: |
    Required auditd configuration:
    -a always,exit -F arch=b64 -S syslog -F a0=4 -k clear_dmesg_logs
    -a always,exit -F arch=b64 -S syslog -F a0=5 -k clear_dmesg_logs
    -a always,exit -F arch=b64 -S syslog -F a0=6 -k disable_dmesg_logs
    -a always,exit -F arch=b32 -S syslog -F a0=4 -k clear_dmesg_logs
    -a always,exit -F arch=b32 -S syslog -F a0=5 -k clear_dmesg_logs
    -a always,exit -F arch=b32 -S syslog -F a0=6 -k disable_dmesg_logs
detection:
  selection:
    type: SYSCALL
    SYSCALL: syslog
    a0:
      - 4
      - 5
      - 6
  condition: selection
falsepositives:
  - System administrators or scripts that intentionally clear logs
  - Debugging scripts
level: medium
license: DRL-1.1
related:
  - id: eca5e022-d368-4043-98e5-9736fb01f72f
    type: derived