Description
/etc/shadow is readable by the shadow group so that a few setgid programs (such as
unix_chkpwd) can check passwords. No user needs to be a member of this group.
Rationale
A user in the shadow group can copy every password hash and crack them offline.
Impact
None for a standard system.
Audit
getent group shadowshows no member after the last colon.awk -F: -v g="$(getent group shadow | cut -d: -f3)" '$4 == g' /etc/passwdprints nothing.
Automated: every check must pass. Scanners report each check by its id.
members
script: |
g=$(getent group shadow) || { echo "no shadow group"; exit 0; }
gid=$(printf '%s' "$g" | cut -d: -f3)
m=${g##*:}
p=$(awk -F: -v g="$gid" '$4 == g {print $1}' /etc/passwd | tr '\n' ' ')
echo "members: ${m:-none}; primary group of: ${p:-none}"
[ -z "$m$p" ]
Remediation
Remove each member with gpasswd -d <user> shadow, and give users whose primary group is
shadow another primary group with usermod -g <group> <user>.
| Restart | none |
| Disruption | low |
remove-members
cb_backup /etc/group
cb_backup /etc/gshadow
m=$(getent group shadow | cut -d: -f4)
for u in $(printf '%s' "$m" | tr ',' ' '); do gpasswd -d "$u" shadow >/dev/null; done
Handwritten code reads parameters from CB_<NAME> environment variables. Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.
References
- shadow(5), Debian manual pages Debian, vendor-doc, accessed 2026-10-18
Mappings
| Framework | ID | Relation |
|---|---|---|
| NIST SP 800-53 Rev. 55.1.1 | AC-6 | related |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
| Taxonomy | ID |
|---|---|
| MITRE ATT&CK | T1003.008 |
People and lifecycle
| Authors |
|
| Verified | 2026-10-18 by Sn0wAlice on 12, Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64. Generated check, fix and check again for profiles core and server-hardened; state kept after reboot. |
| Verified | 2026-10-18 by Sn0wAlice on 13, Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. Generated check, fix and check again for profiles core and server-hardened; state kept after reboot. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-18, 2026-10-18 |
| Translations | fr |