CIS Debian Linux 12 Benchmark

Secure configuration guidelines for Debian GNU/Linux 12 (Bookworm)

v1.1.0 September 2024

Overview

▶

This CIS Benchmark provides prescriptive guidance for establishing a secure configuration posture for Debian GNU/Linux 12 (Bookworm). Recommendations cover filesystem configuration, service hardening, network security, logging, authentication, and system maintenance.

~280Recommendations
6Sections
2Profile Levels
SectionAreaFocus
1Initial SetupFilesystem, packages, GRUB, AppArmor
2ServicesTime sync, disable unnecessary daemons
3Network ConfigurationKernel parameters, nftables
4Logging & Auditingrsyslog, journald, auditd
5Access & AuthenticationSSH, PAM, password policy, user accounts
6System MaintenanceFile permissions, integrity

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — ServerEssential hardening with minimal impact on functionality.
L2Level 2 — ServerDefense-in-depth for high-security environments.

1 — Initial Setup

▶

1.1 Filesystem Configuration

▶
1.1.1 Ensure /tmp Is a Separate Partition (Automated)
L1 Auto
Description

This recommendation verifies that /tmp Is a Separate Partition on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to /tmp Is a Separate Partition may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
findmnt --kernel /tmp
# Should show a dedicated mount point
Remediation
# Configure /tmp as tmpfs in /etc/fstab:
tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0
systemctl unmask tmp.mount
1.1.2 Ensure nodev,nosuid,noexec Options Set on /tmp (Automated)
L1 Auto
Description

This recommendation verifies that nodev,nosuid,noexec Options Set on /tmp on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to nodev,nosuid,noexec Options Set on /tmp may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
findmnt --kernel /tmp | grep -E 'nodev|nosuid|noexec'
Remediation

Add nodev,nosuid,noexec to the /tmp mount options in /etc/fstab.

1.1.3 Ensure /var Is a Separate Partition (Automated)
L2 Auto
Description

This recommendation verifies that /var Is a Separate Partition on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to /var Is a Separate Partition may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
findmnt --kernel /var
Remediation

Create a separate partition for /var during OS installation or migrate during maintenance.

1.1.4 Ensure /home Is a Separate Partition (Automated)
L2 Auto
Description

This recommendation verifies that /home Is a Separate Partition on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to /home Is a Separate Partition may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
findmnt --kernel /home
Remediation

Create a separate partition for /home with nodev mount option.

1.1.5 Ensure Sticky Bit Is Set on All World-Writable Dirs (Automated)
L1 Auto
Description

This recommendation verifies that Sticky Bit Is Set on All World-Writable Dirs on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to sticky Bit Is Set on All World-Writable Dirs may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
df --local -P 2>/dev/null | awk '{if (NR!=1) print $6}' | \
xargs -I '{}' find '{}' -xdev -type d \( -perm -0002 -a ! -perm -1000 \) 2>/dev/null
# Should return empty
Remediation
df --local -P | awk '{if (NR!=1) print $6}' | \
xargs -I '{}' find '{}' -xdev -type d -perm -0002 2>/dev/null | \
xargs -I '{}' chmod a+t '{}'

1.2 Package Management

▶
1.2.1 Ensure APT GPG Keys Are Configured (Manual)
L1 Manual
Description

This recommendation addresses the proper configuration of APT GPG Keys on the Debian 12 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of APT GPG Keys can lead to security gaps that may be exploited by attackers. A properly configured Debian 12 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
apt-key list 2>/dev/null
# Review keys for authenticity
Remediation

Ensure only official Debian repository keys are present. Remove untrusted keys.

1.2.2 Ensure APT Package Sources Are Configured (Manual)
L1 Manual
Description

This recommendation addresses the proper configuration of APT Package Sources on the Debian 12 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of APT Package Sources can lead to security gaps that may be exploited by attackers. A properly configured Debian 12 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/
Remediation

Configure only official Debian repositories with security updates enabled.

1.2.3 Ensure AppArmor Is Installed and Enforcing (Automated)
L1 Auto
Description

This recommendation verifies that AppArmor Is Installed and Enforcing on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to appArmor Is Installed and Enforcing may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
dpkg -s apparmor | grep Status
aa-status 2>/dev/null | head -5
# Loaded profiles should show 'enforce' mode
Remediation
apt install apparmor apparmor-utils
# Enable at boot in /etc/default/grub:
# GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor"
update-grub
aa-enforce /etc/apparmor.d/*

1.3 Boot Settings

▶
1.3.1 Ensure GRUB Bootloader Password Is Set (Automated)
L1 Auto
Description

This recommendation verifies that GRUB Bootloader Password Is Set on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to gRUB Bootloader Password Is Set may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -E '^\s*set\s+superusers' /boot/grub/grub.cfg
grep -E '^\s*password_pbkdf2' /boot/grub/grub.cfg
Remediation
grub-mkpasswd-pbkdf2
# Add to /etc/grub.d/40_custom:
# set superusers="grubadmin"
# password_pbkdf2 grubadmin grub.pbkdf2.sha512...
update-grub
1.3.2 Ensure GRUB Config File Permissions Are Correct (Automated)
L1 Auto
Description

File and directory permissions for GRUB Config File should be set to Correct. Overly permissive access controls can allow unauthorized users to read, modify, or execute sensitive files, potentially compromising the Debian 12 operating system.

Rationale

Incorrect permissions on GRUB Config File could allow unauthorized reading, writing, or execution of critical files. Proper file permissions are a foundational control that prevents privilege escalation and data tampering.

Audit
stat -c '%a %U %G' /boot/grub/grub.cfg
# Should be 600 root root (or 400)
Remediation
chmod 600 /boot/grub/grub.cfg
chown root:root /boot/grub/grub.cfg

2 — Services

▶

2.1 Time Synchronization

▶
2.1.1 Ensure systemd-timesyncd or chrony Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of systemd-timesyncd or chrony on the Debian 12 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of systemd-timesyncd or chrony can lead to security gaps that may be exploited by attackers. A properly configured Debian 12 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
timedatectl status | grep 'NTP service'
# or
systemctl is-enabled chrony 2>/dev/null
chronyc tracking 2>/dev/null
Remediation
# Using systemd-timesyncd:
timedatectl set-ntp true
# Configure servers in /etc/systemd/timesyncd.conf:
# [Time]
# NTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org

2.2 Unnecessary Services

▶
2.2.1 Ensure X Window System Is Not Installed (Automated)
L1 Auto
Description

X Window System should not be installed on the Debian 12 operating system. Removing or disabling this component reduces the attack surface and prevents potential exploitation of unnecessary services or features.

Rationale

If X Window System remains installed, it presents an unnecessary risk vector that attackers could exploit. Removing or disabling unused components is a fundamental principle of secure system hardening.

Audit
dpkg -l xserver-xorg* 2>/dev/null | grep -E '^ii'
# Should return empty on servers
Remediation
apt purge xserver-xorg*
2.2.2 Ensure Avahi Server Is Not Installed (Automated)
L1 Auto
Description

Avahi Server should not be installed on the Debian 12 operating system. Removing or disabling this component reduces the attack surface and prevents potential exploitation of unnecessary services or features.

Rationale

If Avahi Server remains installed, it presents an unnecessary risk vector that attackers could exploit. Removing or disabling unused components is a fundamental principle of secure system hardening.

Audit
dpkg -s avahi-daemon 2>/dev/null | grep Status
Remediation
systemctl stop avahi-daemon
apt purge avahi-daemon
2.2.3 Ensure CUPS Is Not Installed (Automated)
L1 Auto
Description

CUPS should not be installed on the Debian 12 operating system. Removing or disabling this component reduces the attack surface and prevents potential exploitation of unnecessary services or features.

Rationale

If CUPS remains installed, it presents an unnecessary risk vector that attackers could exploit. Removing or disabling unused components is a fundamental principle of secure system hardening.

Audit
dpkg -s cups 2>/dev/null | grep Status
Remediation
apt purge cups
2.2.4 Ensure SNMP Server Is Not Installed (Automated)
L1 Auto
Description

SNMP Server should not be installed on the Debian 12 operating system. Removing or disabling this component reduces the attack surface and prevents potential exploitation of unnecessary services or features.

Rationale

If SNMP Server remains installed, it presents an unnecessary risk vector that attackers could exploit. Removing or disabling unused components is a fundamental principle of secure system hardening.

Audit
dpkg -s snmpd 2>/dev/null | grep Status
Remediation
apt purge snmpd

3 — Network Configuration

▶

3.1 Network Parameters

▶
3.1.1 Ensure IP Forwarding Is Disabled (Automated)
L1 Auto
Description

This setting controls whether IP Forwarding is disabled on the Debian 12 operating system. Disabling this feature reduces the attack surface by removing unnecessary functionality that could be exploited by an attacker.

Rationale

Leaving IP Forwarding enabled when it is not required unnecessarily expands the attack surface. An attacker could leverage this feature to gain unauthorized access or escalate privileges on the Debian 12 operating system.

Audit
sysctl net.ipv4.ip_forward
sysctl net.ipv6.conf.all.forwarding
# Both should be 0
Remediation
# /etc/sysctl.d/60-cis.conf:
net.ipv4.ip_forward = 0
net.ipv6.conf.all.forwarding = 0
sysctl -w net.ipv4.ip_forward=0
sysctl -w net.ipv6.conf.all.forwarding=0
3.1.2 Ensure Source Routed Packets Are Rejected (Automated)
L1 Auto
Description

This recommendation verifies that Source Routed Packets Are Rejected on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to source Routed Packets Are Rejected may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
sysctl net.ipv4.conf.all.accept_source_route
sysctl net.ipv4.conf.default.accept_source_route
# Both should be 0
Remediation
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
3.1.3 Ensure ICMP Redirects Are Rejected (Automated)
L1 Auto
Description

This recommendation verifies that ICMP Redirects Are Rejected on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to iCMP Redirects Are Rejected may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
sysctl net.ipv4.conf.all.accept_redirects
sysctl net.ipv4.conf.default.accept_redirects
# Both should be 0
Remediation
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0

3.2 Firewall

▶
3.2.1 Ensure nftables Is Installed (Automated)
L1 Auto
Description

This recommendation verifies that nftables Is Installed on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to nftables Is Installed may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
dpkg -s nftables | grep Status
nft list ruleset
Remediation
apt install nftables
systemctl enable nftables
3.2.2 Ensure Default Deny Firewall Policy (Automated)
L1 Auto
Description

This recommendation verifies that Default Deny Firewall Policy on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to default Deny Firewall Policy may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
nft list ruleset | grep 'policy drop'
Remediation
nft add table inet filter
nft add chain inet filter input '{ type filter hook input priority 0; policy drop; }'
nft add chain inet filter forward '{ type filter hook forward priority 0; policy drop; }'
nft add chain inet filter output '{ type filter hook output priority 0; policy drop; }'
3.2.3 Ensure Loopback Traffic Is Allowed (Automated)
L1 Auto
Description

This recommendation verifies that Loopback Traffic Is Allowed on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to loopback Traffic Is Allowed may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
nft list ruleset | grep 'iif "lo"'
Remediation
nft add rule inet filter input iif lo accept
nft add rule inet filter output oif lo accept
nft add rule inet filter input ip saddr 127.0.0.0/8 counter drop

4 — Logging & Auditing

▶

4.1 rsyslog / journald

▶
4.1.1 Ensure rsyslog Is Installed (Automated)
L1 Auto
Description

This recommendation verifies that rsyslog Is Installed on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to rsyslog Is Installed may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
dpkg -s rsyslog | grep Status
Remediation
apt install rsyslog
systemctl enable rsyslog
4.1.2 Ensure journald Is Configured to Persist Logs (Automated)
L1 Auto
Description

This recommendation verifies that journald Is Configured to Persist Logs on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to journald Is Configured to Persist Logs may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -E '^\s*Storage' /etc/systemd/journald.conf
# Should be Storage=persistent
Remediation
# /etc/systemd/journald.conf:
[Journal]
Storage=persistent
systemctl restart systemd-journald

4.2 auditd

▶
4.2.1 Ensure auditd Is Installed and Enabled (Automated)
L2 Auto
Description

This recommendation verifies that auditd Is Installed and Enabled on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to auditd Is Installed and Enabled may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
dpkg -s auditd | grep Status
systemctl is-enabled auditd
Remediation
apt install auditd audispd-plugins
systemctl enable auditd
4.2.2 Ensure Audit Log Storage Size Is Configured (Automated)
L2 Auto
Description

This recommendation addresses the proper configuration of Audit Log Storage Size on the Debian 12 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Audit Log Storage Size can lead to security gaps that may be exploited by attackers. A properly configured Debian 12 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep max_log_file /etc/audit/auditd.conf
Remediation
# /etc/audit/auditd.conf:
max_log_file = 256
max_log_file_action = keep_logs
4.2.3 Ensure Changes to System Administration Scope Are Collected (Automated)
L2 Auto
Description

This recommendation verifies that Changes to System Administration Scope Are Collected on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to changes to System Administration Scope Are Collected may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
auditctl -l | grep scope
Remediation
# /etc/audit/rules.d/50-scope.rules:
-w /etc/sudoers -p wa -k scope
-w /etc/sudoers.d/ -p wa -k scope

5 — Access & Authentication

▶

5.1 SSH Server

▶
5.1.1 Ensure SSH Root Login Is Disabled (Automated)
L1 Auto
Description

This setting controls whether SSH Root Login is disabled on the Debian 12 operating system. Disabling this feature reduces the attack surface by removing unnecessary functionality that could be exploited by an attacker.

Rationale

Leaving SSH Root Login enabled when it is not required unnecessarily expands the attack surface. An attacker could leverage this feature to gain unauthorized access or escalate privileges on the Debian 12 operating system.

Audit
sshd -T | grep permitrootlogin
# Should be: permitrootlogin no
Remediation
# /etc/ssh/sshd_config:
PermitRootLogin no
systemctl restart sshd
5.1.2 Ensure SSH Protocol Is Set to 2 (Automated)
L1 Auto
Description

This recommendation configures SSH Protocol to 2 on the Debian 12 operating system. Setting this value appropriately ensures the system operates within the security parameters defined by the CIS benchmark.

Rationale

An improperly configured value for SSH Protocol could weaken security controls or allow unintended behavior. Setting this to 2 ensures the Debian 12 operating system operates within a well-defined security boundary.

Audit
sshd -T | grep protocol
# Debian 12 OpenSSH defaults to protocol 2
Remediation
# /etc/ssh/sshd_config:
Protocol 2
5.1.3 Ensure SSH MaxAuthTries Is Set to 4 or Less (Automated)
L1 Auto
Description

This recommendation configures SSH MaxAuthTries to 4 or Less on the Debian 12 operating system. Setting this value appropriately ensures the system operates within the security parameters defined by the CIS benchmark.

Rationale

An improperly configured value for SSH MaxAuthTries could weaken security controls or allow unintended behavior. Setting this to 4 or Less ensures the Debian 12 operating system operates within a well-defined security boundary.

Audit
sshd -T | grep maxauthtries
# Should be 4 or less
Remediation
MaxAuthTries 4
5.1.4 Ensure SSH PermitEmptyPasswords Is Disabled (Automated)
L1 Auto
Description

This setting controls whether SSH PermitEmptyPasswords is disabled on the Debian 12 operating system. Disabling this feature reduces the attack surface by removing unnecessary functionality that could be exploited by an attacker.

Rationale

Leaving SSH PermitEmptyPasswords enabled when it is not required unnecessarily expands the attack surface. An attacker could leverage this feature to gain unauthorized access or escalate privileges on the Debian 12 operating system.

Audit
sshd -T | grep permitemptypasswords
# Should be: permitemptypasswords no
Remediation
PermitEmptyPasswords no
5.1.5 Ensure Only Strong SSH Ciphers Are Used (Automated)
L1 Auto
Description

This recommendation verifies that Only Strong SSH Ciphers Are Used on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to only Strong SSH Ciphers Are Used may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
sshd -T | grep ciphers
Remediation
# /etc/ssh/sshd_config:
Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr

5.2 PAM & Password Policy

▶
5.2.1 Ensure Password Minimum Length Is 14 or More (Automated)
L1 Auto
Description

This recommendation verifies that Password Minimum Length Is 14 or More on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to password Minimum Length Is 14 or More may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -E '^\s*minlen' /etc/security/pwquality.conf
# Should be minlen = 14 or greater
Remediation
# /etc/security/pwquality.conf:
minlen = 14
5.2.2 Ensure Password Complexity Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Password Complexity on the Debian 12 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Password Complexity can lead to security gaps that may be exploited by attackers. A properly configured Debian 12 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep -E '^\s*(dcredit|ucredit|lcredit|ocredit)' /etc/security/pwquality.conf
Remediation
# /etc/security/pwquality.conf:
dcredit = -1
ucredit = -1
lcredit = -1
ocredit = -1
5.2.3 Ensure Account Lockout Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Account Lockout on the Debian 12 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Account Lockout can lead to security gaps that may be exploited by attackers. A properly configured Debian 12 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep -E 'pam_faillock' /etc/pam.d/common-auth
Remediation
# /etc/security/faillock.conf:
deny = 5
unlock_time = 900
fail_interval = 900

5.3 User Accounts

▶
5.3.1 Ensure Password Expiration Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Password Expiration on the Debian 12 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Password Expiration can lead to security gaps that may be exploited by attackers. A properly configured Debian 12 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep PASS_MAX_DAYS /etc/login.defs
# Should be 365 or less
Remediation
# /etc/login.defs:
PASS_MAX_DAYS 365
PASS_MIN_DAYS 1
PASS_WARN_AGE 7
5.3.2 Ensure Root Is the Only UID 0 Account (Automated)
L1 Auto
Description

This recommendation verifies that Root Is the Only UID 0 Account on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to root Is the Only UID 0 Account may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
awk -F: '$3 == 0 {print $1}' /etc/passwd
# Should only return "root"
Remediation

Remove or change the UID of any non-root account with UID 0.

6 — System Maintenance

▶

6.1 File Permissions

▶
6.1.1 Ensure Permissions on /etc/passwd Are Correct (Automated)
L1 Auto
Description

This recommendation verifies that Permissions on /etc/passwd Are Correct on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to permissions on /etc/passwd Are Correct may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
stat -c '%a %U %G' /etc/passwd
# Should be 644 root root
Remediation
chmod 644 /etc/passwd
chown root:root /etc/passwd
6.1.2 Ensure Permissions on /etc/shadow Are Correct (Automated)
L1 Auto
Description

This recommendation verifies that Permissions on /etc/shadow Are Correct on the Debian 12 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to permissions on /etc/shadow Are Correct may leave the Debian 12 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
stat -c '%a %U %G' /etc/shadow
# Should be 640 root shadow
Remediation
chmod 640 /etc/shadow
chown root:shadow /etc/shadow
6.1.3 Ensure No World-Writable Files Exist (Automated)
L1 Auto
Description

This recommendation verifies that No World-Writable Files is present on the Debian 12 operating system. Having this configuration in place is essential for maintaining the expected security baseline defined by the CIS benchmark.

Rationale

The absence of No World-Writable Files leaves the Debian 12 operating system without an important security control. Verifying its presence ensures the system meets the minimum security baseline required by the CIS benchmark.

Audit
df --local -P | awk '{if (NR!=1) print $6}' | \
xargs -I '{}' find '{}' -xdev -type f -perm -0002 2>/dev/null
# Should return empty
Remediation

Remove world-writable permission from identified files: chmod o-w <file>

6.1.4 Ensure No Unowned Files or Directories Exist (Automated)
L1 Auto
Description

This recommendation verifies that No Unowned Files or Directories is present on the Debian 12 operating system. Having this configuration in place is essential for maintaining the expected security baseline defined by the CIS benchmark.

Rationale

The absence of No Unowned Files or Directories leaves the Debian 12 operating system without an important security control. Verifying its presence ensures the system meets the minimum security baseline required by the CIS benchmark.

Audit
df --local -P | awk '{if (NR!=1) print $6}' | \
xargs -I '{}' find '{}' -xdev -nouser 2>/dev/null
# Should return empty
Remediation

Assign ownership to each unowned file or remove it if unnecessary.