AZLX-23-000225 - Amazon Linux 2023 must implement address space layout randomization (ASLR) to protect its memory from unauthorized code execution.

Information

ASLR makes it more difficult for an attacker to predict the location of attack code they have introduced into a process' address space during an attempt at exploitation. Additionally, ASLR makes it more difficult for an attacker to know the location of existing code to repurpose it using return oriented programming (ROP) techniques.

Solution

Configure Amazon Linux 2023 to enable ASLR to enhance memory protection.

Enable ASLR by setting the kernel parameter with the following command:
echo 2 | sudo tee /proc/sys/kernel/randomize_va_space

Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory:

kernel.randomize_va_space = 2

Reload settings from all system configuration files with the following command:

$ sudo sysctl --system

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_Amazon_Linux_2023_V1R2_STIG.zip

Item Details

Category: SYSTEM AND INFORMATION INTEGRITY

References: 800-53|SI-16, CAT|II, CCI|CCI-002824, Rule-ID|SV-274006r1120006_rule, STIG-ID|AZLX-23-000225, Vuln-ID|V-274006

Plugin: Unix

Control ID: 7673677b42282b55ccdcc3589fd88af09de9c7a8d1909099cbe126be8a9de08f