CIS Rocky Linux 9 Benchmark

Secure configuration guidelines for Rocky Linux 9 — RHEL-compatible enterprise Linux

v2.0.0 March 2025

Overview

▶

This CIS Benchmark provides prescriptive guidance for establishing a secure configuration posture for Rocky Linux 9, a binary-compatible RHEL derivative. Recommendations cover filesystem hardening, service management, network security, audit logging, SSH/PAM authentication, and system maintenance.

~160Recommendations
6Sections
2Profile Levels
SectionAreaFocus
1Initial SetupFilesystem, updates
2ServicesDaemons, time sync
3NetworkParameters, firewall
4LoggingSyslog, auditd
5AccessSSH, PAM, passwords
6MaintenanceIntegrity, users

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — ServerEssential security for all Rocky Linux 9 servers with minimal impact.
L2Level 2 — ServerDefense-in-depth for high-security environments. May restrict functionality.

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 Rocky Linux 9 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 Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
findmnt --target /tmp
# Should show a separate partition or tmpfs mount
Remediation
# Option 1: tmpfs
systemctl unmask tmp.mount
systemctl enable --now tmp.mount

# Option 2: Separate partition in /etc/fstab
# /dev/sda2  /tmp  ext4  defaults,nodev,nosuid,noexec  0 0
1.1.2 Ensure nodev,nosuid,noexec on /tmp (Automated)
L1 Auto
Description

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

Rationale

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

Audit
findmnt -n --target /tmp | grep -E 'nodev|nosuid|noexec'
Remediation
# Edit /etc/fstab or systemd tmp.mount:
# Options=mode=1777,strictatime,nosuid,nodev,noexec
systemctl daemon-reload
mount -o remount /tmp
1.1.3 Ensure /var Is a Separate Partition (Automated)
L2 Auto
Description

This recommendation verifies that /var Is a Separate Partition on the Rocky Linux 9 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 Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
findmnt --target /var
Remediation
# Create separate partition during installation or migrate post-install
1.1.4 Ensure Unused Filesystems Are Disabled (Automated)
L1 Auto
Description

This setting controls whether Unused Filesystems is disabled on the Rocky Linux 9 operating system. Disabling this feature reduces the attack surface by removing unnecessary functionality that could be exploited by an attacker.

Rationale

Leaving Unused Filesystems 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 Rocky Linux 9 operating system.

Audit
modprobe -n -v cramfs 2>&1 | grep -i 'install /bin/true'
lsmod | grep cramfs
Remediation
# Disable cramfs, squashfs, udf:
cat <<EOF > /etc/modprobe.d/cis-disable-fs.conf
install cramfs /bin/true
install squashfs /bin/true
install udf /bin/true
EOF
echo "blacklist cramfs" >> /etc/modprobe.d/cis-blacklist.conf
echo "blacklist squashfs" >> /etc/modprobe.d/cis-blacklist.conf
echo "blacklist udf" >> /etc/modprobe.d/cis-blacklist.conf

1.2 Software Updates

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

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

Rationale

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

Audit
rpm -qa gpg-pubkey*
# Should show Rocky Linux GPG keys installed
Remediation
rpm --import https://dl.rockylinux.org/pub/rocky/RPM-GPG-KEY-Rocky-9
1.2.2 Ensure gpgcheck Is Globally Activated (Automated)
L1 Auto
Description

This recommendation verifies that gpgcheck Is Globally Activated on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to gpgcheck Is Globally Activated may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep ^gpgcheck /etc/dnf/dnf.conf
grep -r ^gpgcheck /etc/yum.repos.d/
# All should be gpgcheck=1
Remediation
sed -i 's/^gpgcheck=0/gpgcheck=1/' /etc/dnf/dnf.conf

2 — Services

▶

2.1 Unnecessary Services

▶
2.1.1 Ensure xinetd Is Not Installed (Automated)
L1 Auto
Description

xinetd should not be installed on the Rocky Linux 9 operating system. Removing or disabling this component reduces the attack surface and prevents potential exploitation of unnecessary services or features.

Rationale

If xinetd 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
rpm -q xinetd
# Should be "package xinetd is not installed"
Remediation
dnf remove xinetd
2.1.2 Ensure Avahi Server Is Not Running (Automated)
L1 Auto
Description

Avahi Server should not be running on the Rocky Linux 9 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 running, it presents an unnecessary risk vector that attackers could exploit. Removing or disabling unused components is a fundamental principle of secure system hardening.

Audit
systemctl is-active avahi-daemon
systemctl is-enabled avahi-daemon
Remediation
systemctl stop avahi-daemon
systemctl disable avahi-daemon
systemctl mask avahi-daemon
2.1.3 Ensure CUPS Is Not Running Unless Required (Automated)
L1 Auto
Description

This setting enforces that CUPS Is Not Running Unless is required on the Rocky Linux 9 operating system. Making this mandatory ensures consistent security policy enforcement across the environment.

Rationale

Failure to cUPS Is Not Running Unless Required may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
systemctl is-active cups
rpm -q cups
Remediation
systemctl stop cups
systemctl disable cups
dnf remove cups

2.2 Time Synchronization

▶
2.2.1 Ensure chrony Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of chrony on the Rocky Linux 9 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of chrony can lead to security gaps that may be exploited by attackers. A properly configured Rocky Linux 9 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
systemctl is-active chronyd
grep -E '^(server|pool)' /etc/chrony.conf
Remediation
dnf install chrony
systemctl enable --now chronyd

# In /etc/chrony.conf:
pool 2.rocky.pool.ntp.org iburst
2.2.2 Ensure chrony Runs as Non-Root (Automated)
L1 Auto
Description

This recommendation verifies that chrony Runs as Non-Root on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to chrony Runs as Non-Root may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep ^OPTIONS /etc/sysconfig/chronyd
# Should contain "-u chrony"
Remediation
echo 'OPTIONS="-u chrony"' > /etc/sysconfig/chronyd
systemctl restart chronyd

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 Rocky Linux 9 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 Rocky Linux 9 operating system.

Audit
sysctl net.ipv4.ip_forward
sysctl net.ipv6.conf.all.forwarding
# Both should be 0
Remediation
cat <<EOF > /etc/sysctl.d/60-cis-network.conf
net.ipv4.ip_forward = 0
net.ipv6.conf.all.forwarding = 0
EOF
sysctl --system
3.1.2 Ensure ICMP Redirects Are Not Accepted (Automated)
L1 Auto
Description

This recommendation verifies that ICMP Redirects Are Not Accepted on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to iCMP Redirects Are Not Accepted may leave the Rocky Linux 9 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
cat <<EOF >> /etc/sysctl.d/60-cis-network.conf
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
EOF
sysctl --system
3.1.3 Ensure TCP SYN Cookies Are Enabled (Automated)
L1 Auto
Description

This setting controls whether TCP SYN Cookies is enabled on the Rocky Linux 9 operating system. Enabling this feature strengthens the security posture by enforcing the recommended configuration via system configuration files, sysctl, or systemd settings.

Rationale

Without TCP SYN Cookies enabled, the Rocky Linux 9 operating system may lack critical protections against known attack vectors. Enabling this control mitigates risk and aligns the deployment with industry-accepted security baselines.

Audit
sysctl net.ipv4.tcp_syncookies
# Should be 1
Remediation
echo "net.ipv4.tcp_syncookies = 1" >> /etc/sysctl.d/60-cis-network.conf
sysctl --system

3.2 Firewall

▶
3.2.1 Ensure firewalld Is Installed and Running (Automated)
L1 Auto
Description

This recommendation verifies that firewalld Is Installed and Running on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to firewalld Is Installed and Running may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
rpm -q firewalld
systemctl is-active firewalld
systemctl is-enabled firewalld
Remediation
dnf install firewalld
systemctl enable --now firewalld
3.2.2 Ensure Default Zone Is Set to drop (Automated)
L1 Auto
Description

This recommendation configures Default Zone to drop on the Rocky Linux 9 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 Default Zone could weaken security controls or allow unintended behavior. Setting this to drop ensures the Rocky Linux 9 operating system operates within a well-defined security boundary.

Audit
firewall-cmd --get-default-zone
# Should be "drop" or "block"
Remediation
firewall-cmd --set-default-zone=drop

4 — Logging & Auditing

▶

4.1 System Logging

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

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

Rationale

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

Audit
rpm -q rsyslog
systemctl is-active rsyslog
Remediation
dnf install rsyslog
systemctl enable --now rsyslog
4.1.2 Ensure journald Is Configured for Persistent Storage (Automated)
L1 Auto
Description

This recommendation verifies that journald Is Configured for Persistent Storage on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to journald Is Configured for Persistent Storage may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -i '^Storage' /etc/systemd/journald.conf
# Should be Storage=persistent
Remediation
sed -i 's/^#\?Storage=.*/Storage=persistent/' /etc/systemd/journald.conf
systemctl restart systemd-journald

4.2 Audit System

▶
4.2.1 Ensure auditd Is Installed and Running (Automated)
L1 Auto
Description

This recommendation verifies that auditd Is Installed and Running on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
rpm -q audit
systemctl is-active auditd
Remediation
dnf install audit
systemctl enable --now auditd
4.2.2 Ensure Audit Rules for Time Changes Are Set (Automated)
L2 Auto
Description

This recommendation verifies that Audit Rules for Time Changes Are Set on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to audit Rules for Time Changes Are Set may leave the Rocky Linux 9 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 time-change
Remediation
cat <<EOF > /etc/audit/rules.d/cis-time-change.rules
-a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change
-a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change
-a always,exit -F arch=b64 -S clock_settime -k time-change
-w /etc/localtime -p wa -k time-change
EOF
augenrules --load
4.2.3 Ensure Audit Rules for Identity Changes Are Set (Automated)
L2 Auto
Description

This recommendation verifies that Audit Rules for Identity Changes Are Set on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to audit Rules for Identity Changes Are Set may leave the Rocky Linux 9 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 identity
Remediation
cat <<EOF > /etc/audit/rules.d/cis-identity.rules
-w /etc/group -p wa -k identity
-w /etc/passwd -p wa -k identity
-w /etc/gshadow -p wa -k identity
-w /etc/shadow -p wa -k identity
-w /etc/security/opasswd -p wa -k identity
EOF
augenrules --load

5 — Access & Authentication

▶

5.1 SSH Configuration

▶
5.1.1 Ensure sshd_config Permissions Are Correct (Automated)
L1 Auto
Description

File and directory permissions for sshd_config should be set to Correct. Overly permissive access controls can allow unauthorized users to read, modify, or execute sensitive files, potentially compromising the Rocky Linux 9 operating system.

Rationale

Incorrect permissions on sshd_config 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' /etc/ssh/sshd_config
# Should be 600 root:root
Remediation
chown root:root /etc/ssh/sshd_config
chmod 600 /etc/ssh/sshd_config
5.1.2 Ensure Root Login via SSH Is Disabled (Automated)
L1 Auto
Description

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

Rationale

Leaving Root Login via SSH 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 Rocky Linux 9 operating system.

Audit
sshd -T | grep permitrootlogin
# Should be "permitrootlogin no"
Remediation
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
systemctl reload sshd
5.1.3 Ensure SSH Idle Timeout Is Set (Automated)
L1 Auto
Description

This recommendation configures the timeout for SSH Idle on the Rocky Linux 9 operating system. Appropriate timeout values limit the window of opportunity for attacks and ensure resources are released in a timely manner.

Rationale

Failure to sSH Idle Timeout Is Set may leave the Rocky Linux 9 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 -E 'clientaliveinterval|clientalivecountmax'
Remediation
# In /etc/ssh/sshd_config:
ClientAliveInterval 300
ClientAliveCountMax 3
systemctl reload sshd
5.1.4 Ensure Strong SSH Ciphers and MACs (Automated)
L1 Auto
Description

This recommendation verifies that Strong SSH Ciphers and MACs on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to strong SSH Ciphers and MACs may leave the Rocky Linux 9 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
sshd -T | grep macs
Remediation
# In /etc/ssh/sshd_config:
Ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
systemctl reload sshd

5.2 PAM & Passwords

▶
5.2.1 Ensure Password Quality Requirements Are Set (Automated)
L1 Auto
Description

This recommendation verifies that Password Quality Requirements Are Set on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to password Quality Requirements Are Set may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -E '^(minlen|minclass|dcredit|ucredit|ocredit|lcredit)' /etc/security/pwquality.conf
Remediation
# In /etc/security/pwquality.conf:
minlen = 14
minclass = 4
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1
5.2.2 Ensure Password Lockout Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Password Lockout on the Rocky Linux 9 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

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

Audit
grep -E 'pam_faillock' /etc/pam.d/system-auth /etc/pam.d/password-auth
Remediation
# In /etc/security/faillock.conf:
deny = 5
unlock_time = 900
fail_interval = 900
5.2.3 Ensure Password Hashing Algorithm Is SHA-512 (Automated)
L1 Auto
Description

This recommendation verifies that Password Hashing Algorithm Is SHA-512 on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to password Hashing Algorithm Is SHA-512 may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -E 'pam_unix.*sha512' /etc/pam.d/system-auth
authselect current
Remediation
authselect select sssd with-faillock with-mkhomedir --force
# Ensure sha512 is in pam_unix or authselect profile

6 — System Maintenance

▶

6.1 File Integrity

▶
6.1.1 Ensure AIDE Is Installed (Automated)
L1 Auto
Description

This recommendation verifies that AIDE Is Installed on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
rpm -q aide
Remediation
dnf install aide
aide --init
mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
6.1.2 Ensure AIDE Runs on a Schedule (Automated)
L1 Auto
Description

This recommendation verifies that AIDE Runs on a Schedule on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to aIDE Runs on a Schedule may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
systemctl is-enabled aidecheck.timer 2>/dev/null || crontab -l | grep aide
Remediation
# Option 1: systemd timer
systemctl enable --now aidecheck.timer

# Option 2: cron
echo "0 5 * * * /usr/sbin/aide --check" | crontab -

6.2 User & Group Settings

▶
6.2.1 Ensure No Accounts Have Empty Passwords (Automated)
L1 Auto
Description

This recommendation verifies that No Accounts Have Empty Passwords on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to no Accounts Have Empty Passwords may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
awk -F: '($2 == "" ) { print $1 }' /etc/shadow
Remediation
# Lock accounts with empty passwords:
passwd -l <username>
# Or set a strong password
6.2.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 Rocky Linux 9 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 Rocky Linux 9 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 reassign UID for any non-root UID 0 accounts
6.2.3 Ensure Default Umask Is 027 or More Restrictive (Automated)
L1 Auto
Description

This recommendation verifies that Default Umask Is 027 or More Restrictive on the Rocky Linux 9 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to default Umask Is 027 or More Restrictive may leave the Rocky Linux 9 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -E '^umask' /etc/profile /etc/bashrc /etc/profile.d/*.sh
Remediation
# In /etc/profile and /etc/bashrc:
umask 027