← All rules
SOCLE-CLD-FSP-044// File ownershipmediumpersistent config

Verify Group Who Owns /var/log/lastlog File

Ensures /var/log/lastlog is group-owned by utmp so login-accounting data stays accurate and tamper-resistant.

Checked against the content of a persistent configuration file, the source of truth that survives reboots.

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 1 standard

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

/var/log/lastlog records the most recent login of every user and is consulted at login time. Its expected group is utmp so the login-accounting subsystem can update it while ordinary users cannot rewrite it. A wrong group could let an attacker falsify last-login records to hide unauthorized access, or read login patterns. Setting the group to utmp keeps login accounting accurate and tamper-resistant.

What Pavois checks

Pavois reads the resolved group ownership of /var/log/lastlog via the InSpec file resource and asserts the group is utmp. It inspects the live inode metadata, so it reflects the file's actual ownership rather than a packaged default, important because login tooling may recreate the file.

only_if { file('/var/log/lastlog').exist? }
describe file('/var/log/lastlog') do
  its('group') { should be_in ['root', 'utmp'] }
end

How to verify it is applied

Run stat -c '%G' /var/log/lastlog. The expected output is:

  • utmp

List it with ls -l /var/log/lastlog, and view its contents with the lastlog command.

Inspect & investigate

This file is the last-login database: read it with lastlog (per-user latest login) and cross-check active sessions with last (from /var/log/wtmp) and who. To trace permission changes, add an auditd watch (auditctl -w /var/log/lastlog -p wa -k logperms) and grep /var/log/audit/audit.log for key="logperms".

Remediation

No automated remediation for this rule, apply it manually following the standard.

Impact & precautions

A wrong group can let an attacker forge or read last-login records, weakening intrusion detection. The fix only changes group ownership; it does not disrupt logins. Precaution: keep the group utmp, not root, the PAM/login stack relies on the utmp group to update the file, and forcing root could break last-login recording. Note newer systems may use /var/log/lastlog2 (an SQLite DB); verify which file is in use before adjusting.

Standards mapping

StandardReferenceTypeVersionConfidence
CIS6.1.4.1, 6.2.2.1directper OS, see the benchmark tablehigh

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