auth.log / secure

LinuxAuthentication & AccessDisk ImageSIEM / Log Aggregator

Location

/var/log/auth.log (Debian/Ubuntu) or /var/log/secure (RHEL/CentOS)

Description

Authentication log recording all PAM-based authentication events including SSH logins, sudo usage, su escalation, user creation (useradd), password changes, and public key acceptance.

Forensic Value

This is the primary artifact for detecting unauthorized access on Linux. Accepted publickey entries confirm SSH key-based access and log the key fingerprint, identifying which key was used. Repeated "Failed password" entries expose brute-force attacks with source IPs. Sudo command logs record the exact commands run with elevated privileges, creating an execution timeline for privileged actions even when .bash_history is cleared.

Tools Required

grepjournalctlaureportlastlastlog

Collection Commands

cp

cp /var/log/auth.log /forensics/output/auth.log

journalctl

journalctl -u sshd --since "2024-01-01" --output json > /forensics/output/sshd_journal.json

grep

grep -E "Failed|Accepted|session opened|sudo" /var/log/auth.log > /forensics/output/auth_filtered.log

tar

tar czf /forensics/output/auth_logs.tar.gz /var/log/auth.log*

Collection Constraints

  • Paths and log sources vary by distribution, init system, logging stack, and installed packages. Validate the active distro and service set before treating absence as meaningful.
  • Centralized log copies may normalize, truncate, or drop fields relative to the original on-host artifact. Preserve the local source when scope and access permit.

MITRE ATT&CK Techniques

T1078T1110T1021.004T1098

Related Blockers