Linux log files and forensic artifacts

Every Linux artifact Arcsentry parses: auditd, syslog and the journal, authentication, shell history, cron and systemd, web server logs, packages, containers and live response. Each page explains what the artifact is, what it proves, where it is stored, what Arcsentry records and how Arcsentry Collector gathers it.

302 artifacts11 in-depth guides

Linux log files: where they are and what they record

Linux log files are plain-text or binary records that the kernel, system services and applications write, mostly under /var/log. For an investigator they hold the logons, commands, service changes, package installs and network activity that reconstruct what happened on a server. Which files exist depends on the distribution and on whether the system logs through rsyslog, the systemd journal or both, so the first step on any host is to see what is there.

The main log files

FileDistributionsWhat it recordsWhy it matters in an investigation
/var/log/auth.logDebian, UbuntuAuthentication: SSH logins and failures, sudo, su, PAM sessions, user and group changesWho got in, from where, and who became root. See syslog and sudo log
/var/log/secureRHEL, CentOS, Rocky, Alma, FedoraThe same as auth.log on Red Hat family systemsAs above
/var/log/syslogDebian, UbuntuGeneral system messages from most servicesService starts and failures, cron runs, kernel messages, application errors around the incident
/var/log/messagesRed Hat family, SUSEGeneral system messagesAs syslog
/var/log/journal/systemd systems (most current distributions)The binary systemd journal: every service's output with metadataOften the only full record on minimal systems; survives where text logs are not configured. See systemd journal
/var/log/audit/audit.logSystems running auditdKernel audit events: executed commands (execve), file access, logins, configuration changes, depending on the rulesThe closest thing to process creation logging on Linux. See auditd
/var/log/wtmp, btmp, lastlogMost distributionsBinary login records: logins and logouts, failed logins, last login per userLogin history, read with last and lastb. See wtmp, btmp and utmp
/var/log/cron or cron lines in syslogVariesScheduled job runsPersistence through cron. See cron
/var/log/apt/history.log, dpkg.logDebian, UbuntuPackage installs and removals, with the command that ran themTools an attacker installed. See APT history
/var/log/dnf.log, yum.logRed Hat familyPackage transactionsAs above. See DNF history
/var/log/nginx/, /var/log/apache2/ or httpd/Web serversAccess and error logs: every request with client address, URL, status and user agentExploits, web shells and data pulled over HTTP. See nginx and Apache
/var/log/kern.log, dmesgMostKernel messagesKernel modules loaded (rootkits), USB devices, firewall drops if logged

Logs rotate: logrotate renames old files (auth.log.1, auth.log.2.gz) and deletes the oldest, usually after four weeks to a few months. Collect the rotated and compressed copies too, and check how far back each log goes before concluding that something did not happen.

Beyond the log files

Many of the most useful Linux artifacts are not logs. Shell history files keep the commands typed in interactive shells; authorized_keys files show which keys can log in as each user (a favourite backdoor); crontabs and systemd units hold persistence; /etc/passwd, /etc/shadow and /etc/sudoers show accounts and privileges; /etc/ld.so.preload is a known rootkit hook; and file system metadata (inode times) dates when files appeared. Container hosts add Docker configuration and container logs.

Reading Linux logs as an investigator

  • Mind the time zone and the year. Traditional syslog lines carry no year and no time zone; they are written in the host's local time. Arcsentry infers the year from the file's rotation and labels host-local times rather than guessing a zone.
  • Read auth and journal together. SSH logins appear in auth.log or secure and in the journal; one may have been cleared and not the other.
  • Expect gaps where an attacker had root. Root can edit any text log and truncate binary ones. Gaps in time, missing rotations and a modification time later than the last line are signs of tampering.
  • Commands are not logged by default. Unless auditd has execve rules, the only command record is shell history, which is easy to delete. That is the main reason to deploy auditd before an incident.

Collecting Linux logs and artifacts

Arcsentry Collector runs as a single static binary on a live Linux host, or reads ext2, ext3 and ext4 file systems straight from a disk image without mounting, and gathers the logs, rotated copies, configuration and user artifacts into one encrypted archive, with live command output (processes, connections, login records) on live hosts. Arcsentry also reads UAC and Velociraptor collections. Each of the 302 Linux artifacts below has its own page with locations, fields and the collection targets that gather it, and the Linux forensics article shows how they fit into one timeline.

Event and service logs 16

Browsers 38

Live response 137

System and configuration 44

File system 22

Applications 29

Parse all of them on your own evidence.

Tell us what you want to investigate. A person replies within one business day with the download and a trial licence.

Request a trial