# Ensure SELinux Mode is Set to Enforcing

- Source: https://support.icompaas.com/support/solutions/articles/62000235137-ensure-selinux-mode-is-set-to-enforcing
- 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 2

**Description:**  
 SELinux enforcing mode actively enforces the defined security policies, denying unauthorized actions and logging violations. Ensuring SELinux is in enforcing mode provides the strongest level of mandatory access control.

**Rationale:** Operating SELinux in enforcing mode helps prevent unauthorized access and privilege escalation by strictly applying security policies.

**Impact:** Pros:

-   Provides maximum protection through enforced policies.  
    
-   Helps detect and prevent unauthorized activities.  
    

Cons:

-   May cause legitimate applications to fail if not properly configured.  
    
-   Requires careful policy management.  
    

**Default Value:** SELinux may be in permissive, enforcing, or disabled mode by default depending on system configuration.

**Pre-requisites:**

-   Root or sudo privileges to view and modify SELinux status.  
    

**Remediation:**

### **Test Plan:**

**Using Linux command line**

1.  Check SELinux current mode:  
    
    sestatus | grep "Current mode"
    
2.  Confirm the mode is enforcing.  
    

### **Implementation Plan:**

**Using Linux command line:**

1.  Temporarily set SELinux to enforcing:  
    
    setenforce 1
    
     
    

2.  Edit /etc/selinux/config to persist enforcing mode:  
    
    SELINUX=enforcing
    
3.  Reboot the system to apply persistent setting.  
      
    

### **Backout Plan:**

**Using Linux command line:**

1\. Set SELinux to permissive mode if needed:  

setenforce 0

2\. Edit /etc/selinux/config to:

SELINUX=permissive

3\. Reboot system.  

**References:**

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   SELinux Project Documentation  
    
-   Red Hat SELinux Guide

## 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.
