# yaml-language-server: $schema=../../../../schema/control.schema.json id: CB-DEB-AUTH-028 title: Keep the shadow group empty finding: title: Users are members of the shadow group description: Members of the shadow group can read every password hash of the system. status: active profiles: [core] risk: severity: high assessment: automated tags: [accounts, shadow, password] 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: manual: | 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. checks: - id: members engine: shell spec: 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: manual: | Remove each member with `gpasswd -d shadow`, and give users whose primary group is `shadow` another primary group with `usermod -g `. effects: restart: none disruption: low lockout_risk: false scripts: - id: remove-members engine: shell content: | 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 references: - title: shadow(5), Debian manual pages url: https://manpages.debian.org/trixie/passwd/shadow.5.en.html publisher: Debian kind: vendor-doc accessed: 2026-10-18 mappings: - framework: nist-800-53r5 framework_version: "5.1.1" id: AC-6 relation: related - framework: cis-debian-12 framework_version: "2.0.0" id: "7.2.4" relation: equivalent - framework: cis-debian-13 framework_version: "1.1.0" id: "7.2.4" relation: equivalent threats: - framework: mitre-attack id: T1003.008 authors: - name: Alice github: Sn0wAlice verified: - date: 2026-10-18 by: Sn0wAlice versions: ["12"] environment: Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64 notes: Generated check, fix and check again for profiles core and server-hardened; state kept after reboot. - date: 2026-10-18 by: Sn0wAlice versions: ["13"] environment: Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64 notes: Generated check, fix and check again for profiles core and server-hardened; state kept after reboot. introduced_in: 0.1.0 created: 2026-10-18 updated: 2026-10-18