# Ensure iptables Outbound and Established Connections Are Properly Configured

- Source: https://support.icompaas.com/support/solutions/articles/62000235372-ensure-iptables-outbound-and-established-connections-are-properly-configured
- 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:**  
 Configuring iptables to allow outbound traffic and accept established or related inbound connections ensures that legitimate network communication is maintained, while protecting the system from unauthorized access.

**Rationale:** Allowing outbound and established connections supports normal network operations and session continuity, preventing disruptions while maintaining firewall security.

**Impact:** Pros:

-   Maintains essential network connectivity for services.  
    
-   Supports stateful firewall operation.  
    

Cons:

-   Misconfiguration may allow unintended traffic or block legitimate connections.  
    

**Default Value:** iptables may not have explicit rules for outbound and established connections by default.

**Pre-requisites:**

-   Root or sudo privileges to configure firewall rules.  
    

**Remediation:**

### **Test Plan:**

**Using Linux command line:**

3\. List current iptables rules for outbound and established connections:  

iptables -L OUTPUT -v -n  
iptables -L INPUT -v -n | grep ESTABLISHED

2\. verify rules exist to allow outbound traffic and accept established/related inbound packets.  

### **Implementation Plan:**

**Using Linux command line:**

1\. Add rules to allow outbound and established connections, for example:  

iptables -A OUTPUT -j ACCEPT  
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

2\. Save iptables rules to persist after reboot:  

service iptables save  # or equivalent command

3\. Verify rules are active:  

iptables -L OUTPUT -v -n  
iptables -L INPUT -v -n | grep ESTABLISHED

### **Backout Plan:**

**Using Linux command line:**

1\. Remove rules if necessary:  

iptables -D OUTPUT -j ACCEPT  
iptables -D INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

2\. Save changes and verify rule removal.  
  
**References:**

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   iptables Documentation  
    
-   [NIST SP 800-53 Revision 5 - SC-7  
    ](https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final#sc-7)

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