Debian GNU/Linux · Accounts & authentication

Keep the shadow group empty

When it fails: Users are members of the shadow group. Members of the shadow group can read every password hash of the system.

CB-DEB-AUTH-028highactiveautomatedautomated fixprofile core

As released in v0.1.1 beta · pre-release. Current state.

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

  1. getent group shadow shows no member after the last colon.
  2. awk -F: -v g="$(getent group shadow | cut -d: -f3)" '$4 == g' /etc/passwd prints 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>.

Restartnone
Disruptionlow

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

Mappings

FrameworkIDRelation
NIST SP 800-53 Rev. 55.1.1AC-6related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

People and lifecycle

Authors
Verified2026-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.
Verified2026-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 inv0.1.0
Created, updated2026-10-18, 2026-10-18
Translationsfr