Verify Group Who Owns Backup passwd File
Ensures /etc/passwd-, the backup copy of /etc/passwd, is group-owned by root (gid 0).
Checked against a path’s metadata, mode, owner, group, SUID/SGID.
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
/etc/passwd- is the backup of /etc/passwd and lists every local account, its UID/GID, home directory and login shell. If its group owner is not root (gid 0), an unprivileged group could read it to enumerate accounts (notably UID-0 accounts) or tamper with the backup so a later restore introduces a rogue or privileged user onto the live file.
What Pavois checks
Pavois reads the effective ownership of /etc/passwd- from the inode (via stat) and asserts gid == 0. Checking the live inode catches drift from manual restores or backup tools rather than trusting a template. The only_if guard skips the check when the backup is absent.
only_if { file('/etc/passwd-').exist? }
describe file('/etc/passwd-') do
its('gid') { should eq 0 }
endHow to verify it is applied
Run stat -c '%G %g' /etc/passwd-. Expected output: root 0. If the backup file does not exist the control is skipped.
Inspect & investigate
Ownership changes are not logged by default. Inspect with ls -l /etc/passwd- or stat /etc/passwd-. With an auditd watch (auditctl -w /etc/passwd- -p wa), chown events appear in /var/log/audit/audit.log.
Remediation
No automated harden plan is defined for this rule yet, so it must be applied manually: run chgrp root /etc/passwd- (or chown :root /etc/passwd-) to restore the root group owner.
Pavois applies this with its own harden engine, the plan below, not a shell script:
| group | root |
|---|---|
| path | /etc/passwd- |
| resource | file |
pavois harden plan localwhere the target is local, a user@host SSH alias, or a container , Docs
Impact & precautions
A wrong group owner on /etc/passwd- exposes the account inventory and a restorable backup to unprivileged users. Precautions: restoring root group ownership is safe and has no functional effect on running services, the backup is consulted only during account-management operations. Verify no backup tool recreates it with the wrong ownership.
Standards mapping
| Standard | Reference | Type | Version | Confidence |
|---|---|---|---|---|
| CIS | 2.2.6, 7.1.2 | direct | per OS, see the benchmark table | high |
| NIST | AC-6 (1) | supporting | 800-53 Rev 5 · 800-171 Rev 2 (pinned) | medium |
| PCI DSS | 2.2.6 | supporting | 4.0.1 | medium |
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.