← All rules
SOCLE-CLD-IAM-002// Accountscriticalinventory state

Verify All Account Password Hashes are Shadowed

Ensures no real password hash is stored in the world-readable /etc/passwd; all hashes belong in /etc/shadow.

Checked against what is installed or registered, packages present/absent, account databases.

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 3 standards

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

Password hashes must live in /etc/shadow, which is readable only by root, and never in the world-readable /etc/passwd. The second field of every /etc/passwd entry should therefore be a placeholder (x, * or !). A real hash stored there exposes every user's credential to offline brute-force or dictionary cracking by any local account.

What Pavois checks

Pavois uses awk to list any /etc/passwd entry whose password field is not a placeholder (x, *, !). The check passes only when the list is empty. Inspecting the resolved account database directly is the only reliable way to confirm credentials were migrated to /etc/shadow and not left exposed.

describe command('awk -F: \'($2!="x" && $2!="*" && $2!="!"){print $1}\' /etc/passwd') do
  its('stdout.strip') { should eq '' }
end

How to verify it is applied

Run awk -F: '($2!="x" && $2!="*" && $2!="!"){print $1}' /etc/passwd. Expected output: nothing. Any printed username has a non-shadowed password field that must be migrated with pwconv.

Inspect & investigate

  • Confirm a clean migration: pwck -r then re-check /etc/passwd.
  • Compare entries: getent passwd <name> vs getent shadow <name>.
  • Authentication events: /var/log/auth.log (Debian/Ubuntu) or /var/log/secure (RHEL family).

Remediation

No automated remediation is shipped. Fix it manually by running pwconv, which moves any inline password hashes from /etc/passwd into /etc/shadow and replaces them with the x placeholder, then re-run the scan to confirm.

Pavois applies this with its own harden engine, the plan below, not a shell script:

commandgrep -E '^[^:]+:[^:!*x]' /etc/passwd # accounts with a hash still in /etc/passwd pwconv # migrate them to /etc/shadow
reasonmoving passwords to /etc/shadow with pwconv is safe but verify no app reads /etc/passwd hashes
resourcemanual
pavois harden plan local

where the target is local, a user@host SSH alias, or a container , Docs

Impact & precautions

A password hash left in the world-readable /etc/passwd lets any local user copy it and crack it offline, leading to credential theft and privilege escalation. The fix (pwconv) is low-risk and standard, but back up /etc/passwd and /etc/shadow first and verify logins still work afterwards.

Standards mapping

StandardReferenceTypeVersionConfidence
CIS7.2.1, 8.3.2directper OS, see the benchmark tablehigh
NIST3.5.10, CM-6(a), IA-5(h)supporting800-53 Rev 5 · 800-171 Rev 2 (pinned)medium
PCI DSS8.3.2supporting4.0.1medium

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