# Ensure Address Space Layout Randomization (ASLR) is Enabled to Mitigate Memory Exploits

- Source: https://support.icompaas.com/support/solutions/articles/62000235120-ensure-address-space-layout-randomization-aslr-is-enabled-to-mitigate-memory-exploits
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS Amazon Linux 2 Benchmark v3.0.0](https://support.icompaas.com/support/solutions/62000112696) › [CIS Amazon Linux 2 Benchmarks](https://support.icompaas.com/support/solutions/folders/62000169265)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:** • Level 1

**Description:**  
 ASLR is a security feature that randomizes the memory addresses used by system and application processes. This makes it harder for attackers to predict target addresses for exploits such as buffer overflows.

**Rationale:**  
Enabling ASLR increases system resilience against memory corruption attacks by making exploit techniques unreliable and unpredictable.

**Impact:  
 Pros:**

-   Enhances protection against memory-based attacks.  
    
-   Improves overall system security posture.  
    

Cons:

-   Rare compatibility issues with legacy software may occur.  
    

**Default Value:** Most modern Linux distributions have ASLR enabled by default.

**Pre-requisites:**

-   Root or sudo privileges to verify and configure kernel parameters.  
      
    

**Remediation:**

### **Test Plan:**

**Using Linux command line:**

1.  Check the current ASLR status:  
    
    cat /proc/sys/kernel/randomize\_va\_space
    
      
    
2.  Confirm the output is 2 (full randomization enabled).
    

### **Implementation Plan:**

**Using Linux command line:**

1\. Enable full ASLR by setting the kernel parameter:  

sysctl -w kernel.randomize\_va\_space=2

2\. Make the setting persistent by adding or editing /etc/sysctl.conf:  

kernel.randomize\_va\_space = 2

3\. Reload sysctl settings:  

sysctl -p

### **Backout Plan:**

**Using Linux command line:**

1.  To disable or reduce ASLR, set:  
    
    sysctl -w kernel.randomize\_va\_space=0
    
      
    
2.  Remove or modify the entry in /etc/sysctl.conf.  
    
3.  Reload sysctl settings.  
    

**References:**

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   [NIST SP 800-53 Revision 5 - SI-3  
    ](https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final#si-3)
    
-   Linux Kernel Documentation - ASLR

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
