CIS Amazon Linux 2023 Benchmark

Secure configuration guidelines for Amazon Linux 2023

v1.1.0 March 2025

Overview

▶

This CIS Benchmark provides prescriptive guidance for establishing a secure configuration posture for Amazon Linux 2023. Recommendations cover filesystem hardening, service management, network configuration, logging and auditing, SSH/PAM security, and user environment maintenance for AWS cloud-native workloads.

~150Recommendations
6Sections
2Profile Levels
SectionAreaFocus
1FilesystemPartitions, mount options
2ServicesDisable unneeded, time sync
3NetworkKernel params, firewall
4Loggingrsyslog/journald, auditd
5AccessSSH, PAM, passwords
6UsersAccounts, file integrity

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — ServerEssential security for all Amazon Linux 2023 servers with minimal performance impact.
L2Level 2 — ServerDefense-in-depth settings for high-security workloads. May restrict functionality.

1 — Filesystem Configuration

▶

1.1 Partition Layout

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

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

Audit
findmnt -n /tmp
# Should show a dedicated mount
Remediation
# Via systemd tmp.mount:
systemctl unmask tmp.mount
systemctl enable --now tmp.mount

# Or add to /etc/fstab:
tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0
1.1.2 Ensure nodev, nosuid, noexec Options on /tmp (Automated)
L1 Auto
Description

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

Rationale

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

Audit
findmnt -n /tmp | grep -E "nodev|nosuid|noexec"
Remediation
# In /etc/fstab:
tmpfs /tmp tmpfs defaults,nosuid,nodev,noexec 0 0
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 Amazon Linux 2023 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 Amazon Linux 2023 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
findmnt -n /var
Remediation
# Create separate partition at install time or use LVM to add /var
1.1.4 Ensure /home Is a Separate Partition (Automated)
L2 Auto
Description

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

Audit
findmnt -n /home
Remediation
# Create /home partition with nosuid, nodev options

1.2 Filesystem Hardening

▶
1.2.1 Ensure Unused Filesystems Are Disabled (Automated)
L1 Auto
Description

This setting controls whether Unused Filesystems is disabled on the Amazon Linux 2023 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 Amazon Linux 2023 operating system.

Audit
modprobe -n -v cramfs 2>&1 | grep -E "install|not found"
modprobe -n -v squashfs 2>&1 | grep -E "install|not found"
modprobe -n -v udf 2>&1 | grep -E "install|not found"
Remediation
# Create /etc/modprobe.d/cis-filesystems.conf:
install cramfs /bin/false
install squashfs /bin/false
install udf /bin/false

blacklist cramfs
blacklist squashfs
blacklist udf
1.2.2 Ensure USB Storage Is Disabled (Automated)
L2 Auto
Description

This setting controls whether USB Storage is disabled on the Amazon Linux 2023 operating system. Disabling this feature reduces the attack surface by removing unnecessary functionality that could be exploited by an attacker.

Rationale

Leaving USB Storage 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 Amazon Linux 2023 operating system.

Audit
modprobe -n -v usb-storage 2>&1 | grep "install /bin/false"
Remediation
echo "install usb-storage /bin/false" >> /etc/modprobe.d/cis-usb.conf
echo "blacklist usb-storage" >> /etc/modprobe.d/cis-usb.conf
1.2.3 Ensure core dumps Are Restricted (Automated)
L1 Auto
Description

This setting ensures that core dumps is restricted on the Amazon Linux 2023 operating system. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted core dumps could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Amazon Linux 2023 operating system is essential for defense in depth.

Audit
grep -E "^\*.*hard.*core" /etc/security/limits.conf /etc/security/limits.d/*
sysctl fs.suid_dumpable
Remediation
echo "* hard core 0" >> /etc/security/limits.d/cis-core.conf
echo "fs.suid_dumpable = 0" >> /etc/sysctl.d/cis-core.conf
sysctl -w fs.suid_dumpable=0

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 Amazon Linux 2023 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
Remediation
dnf remove xinetd
2.1.2 Ensure Avahi Server Is Not Installed (Automated)
L1 Auto
Description

Avahi Server should not be installed on the Amazon Linux 2023 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
rpm -q avahi-daemon
Remediation
systemctl stop avahi-daemon
systemctl disable avahi-daemon
dnf remove avahi
2.1.3 Ensure CUPS Is Not Installed Unless Needed (Automated)
L1 Auto
Description

This recommendation verifies that cUPS Is Not Installed Unless Needed on the Amazon Linux 2023 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

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

Audit
rpm -q cups
Remediation
dnf remove cups
2.1.4 Ensure DHCP Server Is Not Installed (Automated)
L1 Auto
Description

DHCP Server should not be installed on the Amazon Linux 2023 operating system. Removing or disabling this component reduces the attack surface and prevents potential exploitation of unnecessary services or features.

Rationale

If DHCP 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
rpm -q dhcp-server
Remediation
dnf remove dhcp-server

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 Amazon Linux 2023 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 Amazon Linux 2023 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
rpm -q chrony
systemctl is-enabled chronyd
grep -E "^(server|pool)" /etc/chrony.conf
Remediation
dnf install chrony
systemctl enable --now chronyd

# In /etc/chrony.conf:
pool 169.254.169.123 iburst  # Amazon Time Sync Service
2.2.2 Ensure chrony User Is Non-Root (Automated)
L1 Auto
Description

This recommendation verifies that chrony User Is Non-Root on the Amazon Linux 2023 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to chrony User Is Non-Root may leave the Amazon Linux 2023 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
# In /etc/sysconfig/chronyd:
OPTIONS="-u chrony"

3 — Network Configuration

▶

3.1 Kernel Parameters

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

This setting controls whether IP Forwarding is disabled on the Amazon Linux 2023 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 Amazon Linux 2023 operating system.

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

This recommendation verifies that source Routed Packets Are Rejected on the Amazon Linux 2023 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 Amazon Linux 2023 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
Remediation
cat >> /etc/sysctl.d/cis-network.conf << 'EOF'
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.conf.default.accept_source_route = 0
EOF
sysctl --system
3.1.3 Ensure ICMP Redirects Are Not Accepted (Automated)
L1 Auto
Description

This recommendation verifies that iCMP Redirects Are Not Accepted on the Amazon Linux 2023 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 Amazon Linux 2023 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
Remediation
cat >> /etc/sysctl.d/cis-network.conf << 'EOF'
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.4 Ensure Reverse Path Filtering Is Enabled (Automated)
L1 Auto
Description

This setting controls whether Reverse Path Filtering is enabled on the Amazon Linux 2023 operating system. Enabling this feature strengthens the security posture by enforcing the recommended configuration via system configuration files, sysctl, or systemd settings.

Rationale

Without Reverse Path Filtering enabled, the Amazon Linux 2023 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.conf.all.rp_filter
sysctl net.ipv4.conf.default.rp_filter
Remediation
echo "net.ipv4.conf.all.rp_filter = 1" >> /etc/sysctl.d/cis-network.conf
echo "net.ipv4.conf.default.rp_filter = 1" >> /etc/sysctl.d/cis-network.conf
sysctl --system
3.1.5 Ensure TCP SYN Cookies Are Enabled (Automated)
L1 Auto
Description

This setting controls whether TCP SYN Cookies is enabled on the Amazon Linux 2023 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 Amazon Linux 2023 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
Remediation
echo "net.ipv4.tcp_syncookies = 1" >> /etc/sysctl.d/cis-network.conf
sysctl --system

3.2 Firewall & nftables

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

This recommendation verifies that nftables Is Installed on the Amazon Linux 2023 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 Amazon Linux 2023 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
rpm -q nftables
Remediation
dnf install nftables
systemctl enable --now nftables
3.2.2 Ensure Default Deny Firewall Policy (Automated)
L1 Auto
Description

This recommendation verifies that default Deny Firewall Policy on the Amazon Linux 2023 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 Amazon Linux 2023 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 -E "policy (accept|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 accept; }'
nft add rule inet filter input iif lo accept
nft add rule inet filter input ct state established,related accept
3.2.3 Ensure Loopback Traffic Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Loopback Traffic on the Amazon Linux 2023 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

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

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

4 — Logging & Auditing

▶

4.1 System Logging

▶
4.1.1 Ensure rsyslog or journald Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of rsyslog or journald on the Amazon Linux 2023 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of rsyslog or journald can lead to security gaps that may be exploited by attackers. A properly configured Amazon Linux 2023 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
systemctl is-active rsyslog || systemctl is-active systemd-journald
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 Amazon Linux 2023 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 Amazon Linux 2023 operating system vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -E "^Storage=" /etc/systemd/journald.conf
Remediation
# In /etc/systemd/journald.conf:
[Journal]
Storage=persistent
Compress=yes
SystemMaxUse=500M
4.1.3 Ensure Log File Permissions Are Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Log File Permissions on the Amazon Linux 2023 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Log File Permissions can lead to security gaps that may be exploited by attackers. A properly configured Amazon Linux 2023 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
find /var/log -type f -perm /037 -ls
Remediation
find /var/log -type f -exec chmod g-wx,o-rwx {} +

4.2 Audit Framework

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

This recommendation verifies that auditd Is Installed and Enabled on the Amazon Linux 2023 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 Amazon Linux 2023 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-enabled auditd
Remediation
dnf install audit
systemctl enable --now auditd
4.2.2 Ensure Audit Log Size Is Configured (Automated)
L2 Auto
Description

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

Rationale

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

Audit
grep "^max_log_file " /etc/audit/auditd.conf
Remediation
# In /etc/audit/auditd.conf:
max_log_file = 256
max_log_file_action = keep_logs
space_left_action = email
4.2.3 Ensure Events That Modify Date/Time Are Collected (Automated)
L2 Auto
Description

This recommendation verifies that events That Modify Date/Time Are Collected on the Amazon Linux 2023 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to events That Modify Date/Time Are Collected may leave the Amazon Linux 2023 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
# In /etc/audit/rules.d/cis-time.rules:
-a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change
-a always,exit -F arch=b64 -S clock_settime -k time-change
-w /etc/localtime -p wa -k time-change
4.2.4 Ensure Events That Modify User/Group Info Are Collected (Automated)
L2 Auto
Description

This recommendation verifies that events That Modify User/Group Info Are Collected on the Amazon Linux 2023 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to events That Modify User/Group Info Are Collected may leave the Amazon Linux 2023 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
# In /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

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 Amazon Linux 2023 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 "%U:%G %a" /etc/ssh/sshd_config
# Expected: root:root 600
Remediation
chown root:root /etc/ssh/sshd_config
chmod 600 /etc/ssh/sshd_config
5.1.2 Ensure SSH Root Login Is Disabled (Automated)
L1 Auto
Description

This setting controls whether SSH Root Login is disabled on the Amazon Linux 2023 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 Amazon Linux 2023 operating system.

Audit
sshd -T | grep permitrootlogin
# Should be "no"
Remediation
# In /etc/ssh/sshd_config:
PermitRootLogin no
# Restart: systemctl restart sshd
5.1.3 Ensure SSH Protocol Is Version 2 (Automated)
L1 Auto
Description
SSH Protocol 1 has known cryptographic weaknesses. SSH on Amazon Linux 2023 defaults to Protocol 2 but verify explicitly.
Rationale

Failure to sSH Protocol Is Version 2 may leave the Amazon Linux 2023 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 protocol
Remediation
# In /etc/ssh/sshd_config (already default):
Protocol 2
5.1.4 Ensure SSH MaxAuthTries Is ≤ 4 (Automated)
L1 Auto
Description

This recommendation verifies that sSH MaxAuthTries Is ≤ 4 on the Amazon Linux 2023 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to sSH MaxAuthTries Is ≤ 4 may leave the Amazon Linux 2023 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 maxauthtries
Remediation
# In /etc/ssh/sshd_config:
MaxAuthTries 4
5.1.5 Ensure SSH Idle Timeout Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of SSH Idle Timeout on the Amazon Linux 2023 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of SSH Idle Timeout can lead to security gaps that may be exploited by attackers. A properly configured Amazon Linux 2023 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
sshd -T | grep clientaliveinterval
sshd -T | grep clientalivecountmax
Remediation
# In /etc/ssh/sshd_config:
ClientAliveInterval 300
ClientAliveCountMax 3
5.1.6 Ensure SSH PasswordAuthentication Is Disabled (Automated)
L2 Auto
Description

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

Rationale

Leaving SSH PasswordAuthentication 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 Amazon Linux 2023 operating system.

Audit
sshd -T | grep passwordauthentication
Remediation
# In /etc/ssh/sshd_config:
PasswordAuthentication no

5.2 PAM & Password Quality

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

This recommendation addresses the proper configuration of Password Quality Requirements on the Amazon Linux 2023 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

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

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 Amazon Linux 2023 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 Amazon Linux 2023 operating system reduces exposure to both known vulnerabilities and configuration drift.

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

Audit
grep -E "^ENCRYPT_METHOD" /etc/login.defs
Remediation
# In /etc/login.defs:
ENCRYPT_METHOD SHA512

6 — User Environment & Maintenance

▶

6.1 User Accounts

▶
6.1.1 Ensure Root Account Is the Only UID 0 Account (Automated)
L1 Auto
Description

This recommendation verifies that root Account Is the Only UID 0 Account on the Amazon Linux 2023 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to root Account Is the Only UID 0 Account may leave the Amazon Linux 2023 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}' /etc/passwd
# Should return only root
Remediation
# Remove or change UID for any non-root UID 0 accounts
6.1.2 Ensure No Accounts Have Empty Passwords (Automated)
L1 Auto
Description

This recommendation verifies that no Accounts Have Empty Passwords on the Amazon Linux 2023 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 Amazon Linux 2023 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
# Set password or lock all accounts with empty passwords:
passwd -l <username>
6.1.3 Ensure Shadow Password Suite Parameters Are Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of Shadow Password Suite Parameters on the Amazon Linux 2023 operating system. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of Shadow Password Suite Parameters can lead to security gaps that may be exploited by attackers. A properly configured Amazon Linux 2023 operating system reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep -E "^PASS_MAX_DAYS|^PASS_MIN_DAYS|^PASS_WARN_AGE" /etc/login.defs
Remediation
# In /etc/login.defs:
PASS_MAX_DAYS 365
PASS_MIN_DAYS 1
PASS_WARN_AGE 7
6.1.4 Ensure Default umask Is Restrictive (Automated)
L1 Auto
Description

This recommendation verifies that default umask Is Restrictive on the Amazon Linux 2023 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to default umask Is Restrictive may leave the Amazon Linux 2023 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/login.defs
grep -E "umask" /etc/profile /etc/bashrc
Remediation
# In /etc/login.defs:
UMASK 027

# In /etc/profile.d/cis-umask.sh:
umask 027

6.2 File Integrity

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

This recommendation verifies that aIDE Is Installed on the Amazon Linux 2023 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 Amazon Linux 2023 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.2.2 Ensure Periodic AIDE Checks Are Scheduled (Automated)
L1 Auto
Description

This recommendation verifies that periodic AIDE Checks Are Scheduled on the Amazon Linux 2023 operating system. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to periodic AIDE Checks Are Scheduled may leave the Amazon Linux 2023 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
# Via cron:
echo "0 5 * * * /usr/sbin/aide --check" | crontab -

# Or via systemd timer:
systemctl enable --now aidecheck.timer
6.2.3 Ensure No World-Writable Files Exist (Automated)
L1 Auto
Description

This recommendation verifies that No World-Writable Files is present on the Amazon Linux 2023 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 Amazon Linux 2023 operating system without an important security control. Verifying its presence ensures the system meets the minimum security baseline required by the CIS benchmark.

Audit
find / -xdev -type f -perm -0002 -print 2>/dev/null
Remediation
# Remove world-writable permission:
find / -xdev -type f -perm -0002 -exec chmod o-w {} +
6.2.4 Ensure No Unowned or Ungrouped Files Exist (Automated)
L1 Auto
Description

This recommendation verifies that No Unowned or Ungrouped Files is present on the Amazon Linux 2023 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 or Ungrouped Files leaves the Amazon Linux 2023 operating system without an important security control. Verifying its presence ensures the system meets the minimum security baseline required by the CIS benchmark.

Audit
find / -xdev -nouser -print 2>/dev/null
find / -xdev -nogroup -print 2>/dev/null
Remediation
# Assign appropriate ownership:
find / -xdev -nouser -exec chown root {} +
find / -xdev -nogroup -exec chgrp root {} +