← All rules
SOCLE-RUN-AUD-005// Audit (auditd)mediumeffective runtime

Ensure auditd Collects File Deletion Events by User - rename

Ensures auditd has an active rule tagged delete that records file-removal syscalls (unlink, unlinkat, rename, renameat) performed by ordinary users.

Checked against the resolved running state (e.g. sshd -T, sysctl, systemctl show), catches drop-ins and Includes a file read would miss. Caveat: runtime ≠ persistence; a value correct now may not survive a reboot.

A pass proves✓ running now✓ on disk✓ survives rebootthe qualified verdict →
Debian 12CIS 1.1.0Debian 13CIS 1.0.0FedoraRHEL 10 / Rocky 10 / AlmaLinux 10RHEL 8 / Rocky 8 / AlmaLinux 8CIS 4.0.0RHEL 9 / Rocky 9 / AlmaLinux 9CIS 2.0.0Ubuntu 22.04CIS 3.0.0Ubuntu 24.04CIS 1.0.0Ubuntu 26.04
One check, maps to 5 standards

Pavois asserts the effective configuration, the live, resolved state, not a file. File-based scanners (OVAL/SCAP, Lynis) miss Includes, drop-ins and runtime defaults; this check sees what is actually applied.

A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.

Why this rule matters

Auditing file deletions creates a trail for files removed from the system. That trail aids troubleshooting and, crucially, helps detect malicious processes that delete or rename log files and artifacts to conceal their presence. Without it, an attacker can erase evidence and you cannot tell what was removed, when, or by whom.

What Pavois checks

Pavois runs auditctl -l and checks for a loaded rule carrying the delete key. Reading the live kernel ruleset beats parsing /etc/audit/rules.d/*.rules: a rule present in a file but not loaded (no augenrules, syntax error, service not restarted) gives false assurance. auditctl -l shows exactly what the kernel enforces now.

describe command('auditctl -l') do
  its('stdout') { should match(/(-k +|key=)delete\b/) }
end
describe command("grep -rhwsE 'delete' /etc/audit/rules.d/*.rules /etc/audit/audit.rules 2>/dev/null") do
  its('stdout') { should match(/\S/) }
end

How to verify it is applied

Run auditctl -l | grep delete. You should see syscall rules such as -a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat -F auid>=1000 -F auid!=unset -k delete (and a b32 variant). Empty output means the rule is not loaded.

Inspect & investigate

Triggered events land in /var/log/audit/audit.log. Search with grep 'key="delete"' /var/log/audit/audit.log (prefer grep over ausearch -k delete, which can wrongly report no matches).

Remediation

Pavois's harden plan uses the audit_ruleset resource to write the deletion syscall rules into /etc/audit/rules.d/, then reloads auditd. Because the audit config may be immutable, a reboot is required to fully apply. Run pavois harden apply.

Pavois applies this with its own harden engine, the plan below, not a shell script:

reboot_requiredtrue
resourceaudit_ruleset
pavois harden plan local

where the target is local, a user@host SSH alias, or a container , Docs

Impact & precautions

Without this rule, attackers can delete logs and files with no trace. The rule is log-only and cannot block deletions, so it breaks nothing functionally. Precautions: deletion syscalls are extremely frequent (builds, temp files, package operations), making this one of the noisiest audit rules, size audit.log rotation, max_log_file and space_left_action carefully so a full disk does not halt the host when auditd is set to halt.

Standards mapping

StandardReferenceTypeVersionConfidence
ANSSI BP-028R73direct2.0high
CIS10.2.1.7, 6.2.3.13, 6.3.3.22, 6.3.3.13directper OS, see the benchmark tablehigh
NIST3.1.7, AU-12(c), AU-2(d), CM-6(a)supporting800-53 Rev 5 · 800-171 Rev 2 (pinned)medium
PCI DSS10.2.1.7supporting4.0.1medium
DISA STIGUBTU-22-654185, UBTU-24-900540directper OS STIG releasehigh

Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.

Sources & references