Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Auditd

Direct answer

auditd records security-relevant events from the kernel audit system: logins, privilege use, file access watched by rules, and SELinux denials, in /var/log/audit/audit.log.

When to use this

Use it to track who changed sensitive files or ran privileged commands, or for compliance.

First 30 seconds

1. systemctl status auditd.

2. auditctl -l — loaded rules.

3. Watch a file: -w /etc/sudoers -p wa -k sudoers in rules.d; augenrules --load.

4. Search: ausearch -k sudoers -i.

5. Report: aureport --summary.

Operational verification

event in the kernel → audit rule matches → record written by auditd → searched and forwarded

Evidence · next step

For Security → Auditd, continue with the first unproven Topic check: Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for Auditd. If that boundary is healthy, advance to the adjacent check: Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to track who changed sensitive files or ran privileged commands, or for compliance.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

security action/syscall/LSM event → kernel audit rule → audit backlog/netlink → auditd → persistence/forwarding → multi-record correlation → investigation conclusion

Healthy evidence: required rules are loaded, backlog/disk health is stable, correlated event records are retained and queries reconstruct the expected allowed/denied test activity

Step 2 Verification and output interpretation Verify boundary

Verification chain. security action/syscall/LSM event → kernel audit rule → audit backlog/netlink → auditd → persistence/forwarding → multi-record correlation → investigation conclusion

Step 3 Commands Verify boundary
auditctl -l
ausearch -k identity -ts today
aureport --summary
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: rules are missing/stale, backlog or disk loss occurs, watch paths changed, event records are fragmented, time filters are wrong or audit absence is treated as evidence nothing happened

Step 5 Common mistakes Narrow the fault
  • Too broad audit rules filling disk.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Add rules in /etc/audit/rules.d/*.rules and load with augenrules --load. Search with ausearch, summarise with aureport. Forward audit logs off the host. Too many rules cost performance.

Key checks
  • auditctl -l — loaded audit rules
  • sestatus / aa-status — SELinux or AppArmor state
  • ss -tulpn — listening services
  • journalctl -u sshd -g 'Failed' — failed logins
  • ausearch -m avc,user_login -ts today — audit events (auditd)
ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

Audit evidence shows only the configured/captured scope and retention window; absence of a record is not evidence of absence unless rule coverage, backlog and storage are demonstrated.

In depth

auditd: recording security-relevant events

The Linux audit system records events such as file access, system calls and logins in a tamper-resistant log, /var/log/audit/audit.log. auditctl manages the kernel rules, and the auditctl(8) manual page describes them:

  • -l lists rules, and -s shows the status, including lost events and the backlog.
  • -a always,exit -F arch=b64 -S <syscall> records system calls. arch must come before -S.
  • -w <path> -p rwxa -k <key> watches a path. The manual marks this form deprecated, because of its performance cost, and recommends the syscall form.
  • -k tags rules with a key, which ausearch -k finds later.
  • -e 2 makes the configuration immutable until the next reboot.
  • -D deletes all rules.

Rules worth having

PurposeRule (syscall form)
Changes to accounts-a always,exit -F arch=b64 -S openat,open_by_handle_at -F path=/etc/passwd -F perm=wa -k identity (and shadow, group, gshadow)
Changes to sudo rulesThe same, for /etc/sudoers and the /etc/sudoers.d directory, key privilege
Commands run as root by users-a always,exit -F arch=b64 -S execve -F euid=0 -F auid>=1000 -F auid!=unset -k root-cmd
Kernel module loading-a always,exit -F arch=b64 -S init_module,finit_module,delete_module -k modules
Time changes-a always,exit -F arch=b64 -S clock_settime,settimeofday,adjtimex -k time-change
Lock the rules-e 2 as the last line

auid

The audit UID (auid) is set at login, and stays the same through sudo and su. That's why audit logs can show who actually ran a command as root, when the system log only shows "root".

Persistent rules

Rules go in /etc/audit/rules.d/*.rules. augenrules --load merges them into /etc/audit/audit.rules and loads them. With -e 2 set, rule changes need a reboot.

host$ sudo tee /etc/audit/rules.d/50-identity.rules >/dev/null <<'EOF'
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F path=/etc/shadow -F perm=wa -k identity
-a always,exit -F arch=b64 -S openat,open_by_handle_at -F path=/etc/sudoers -F perm=wa -k privilege
-a always,exit -F arch=b64 -S execve -F euid=0 -F auid>=1000 -F auid!=unset -k root-cmd
EOF
host$ sudo augenrules --load && sudo auditctl -l | head -3
host$ sudo auditctl -s | grep -E "enabled|lost|backlog "
enabled 1
lost 0
backlog 0
host$ sudo ausearch -k root-cmd -ts today -i | grep -E "type=EXECVE|auid=" | tail -2
type=SYSCALL ... auid=alice uid=root euid=root comm="systemctl" exe="/usr/bin/systemctl" key="root-cmd"
host$ sudo aureport --auth --summary -ts today

Watch the lost counter

lost above 0 in auditctl -s means the kernel dropped audit events, because the backlog filled. Increase the backlog (-b), or reduce noisy rules. For compliance, lost events are themselves a finding.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Auditd is part of Security → Auditd. Auditd consumes Linux Audit subsystem events and persists/forwards multi-record security events under configured rules, backlog and failure policies for accountable investigation.

Topic-specific state model. Auditd consumes Linux Audit subsystem events and persists/forwards multi-record security events under configured rules, backlog and failure policies for accountable investigation.

Interpretation rule. - auditd running ≠ required kernel audit rules are loaded or retained.

  • One audit record ≠ the complete event; related records can share a serial/event identifier.

Quick reference

auditd records security-relevant kernel events according to rules: file access, syscalls, user commands, privilege changes.

# /etc/audit/rules.d/50-local.rules
-w /etc/sudoers -p wa -k sudoers_change
-w /etc/ssh/sshd_config -p wa -k sshd_config
-a always,exit -F arch=b64 -S execve -F euid=0 -F auid>=1000 -F auid!=unset -k root_cmds

augenrules --load
auditctl -l
ausearch -k sudoers_change -i
aureport --summary; aureport -au --failed

auid (login UID) survives sudo, so audit trails show who really ran a command. Ship logs off-host (audisp/rsyslog to SIEM) — local logs can be wiped by an attacker with root.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. Audit evidence shows only the configured/captured scope and retention window; absence of a record is not evidence of absence unless rule coverage, backlog and storage are demonstrated.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Auditd owns Linux Audit collection; Logging owns broader log transport/retention and Security incident branches own interpretation.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Security → Auditd. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/security/index.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
auditdlinux auditlinux audit subsystem
Embedded reference data

Quick lookup tables

Auditd operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Auditd.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateAuditd consumes Linux Audit subsystem events and persists/forwards multi-record security events under configured rules, backlog and failure policies for accountable investigation.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin host + boot/time + real identity/workload → identify authoritative policy/key/trust source → read back loaded/effective runtime state → reproduce one safe allow/deny/handshake test → correlate audit/service/kernel evidence → locate first failed boundary → make the smallest persistent change → repeat original workload + regression/recovery check.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainsecurity action/syscall/LSM event → kernel audit rule → audit backlog/netlink → auditd → persistence/forwarding → multi-record correlation → investigation conclusionTrace requested/configured state through effective state to the observed workload result.
Failure boundaryAudit evidence proves only the configured/captured scope and retention window; absence of a record is not proof of absence unless rule coverage, backlog and storage are demonstrated.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux security/trust evidence can establish this proof path: security action/syscall/LSM event → kernel audit rule → audit backlog/netlink → auditd → persistence/forwarding → multi-record correlation → investigation conclusionUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove unobserved identities, objects, policies, namespaces, endpoints or time periods. Audit evidence proves only the configured/captured scope and retention window; absence of a record is not proof of absence unless rule coverage, backlog and storage are demonstrated.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven security/trust boundary, capture the adjacent effective state and audit/handshake evidence, make only the demonstrated persistent change, then repeat the original workload plus recovery/regression checks.Continue to the next unresolved boundary while preserving the original test condition.

Auditd · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryAuditd
Topic pathSecurity → Auditd
Runtime stateAuditd consumes Linux Audit subsystem events and persists/forwards multi-record security events under configured rules, backlog and failure policies for accountable investigation.
Fast checks- Record exact host, distribution/kernel, boot ID, time window, workload, identity and the authoritative configuration/policy source for Auditd. - Read back the effective runtime state and precedence rather than assuming an edited file, package state or service status is active. - Reproduce one safe allowed/denied or handshake/access test and correlate kernel/service/audit evidence at the first relevant boundary. - Apply the smallest persistent cause-specific change, then repeat the original test plus an adjacent regression/recovery check.
Verification chainsecurity action/syscall/LSM event → kernel audit rule → audit backlog/netlink → auditd → persistence/forwarding → multi-record correlation → investigation conclusion Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryAudit evidence proves only the configured/captured scope and retention window; absence of a record is not proof of absence unless rule coverage, backlog and storage are demonstrated. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?