# 5.3 Ensure No Security Groups Allow Ingress from 0.0.0.0/0 to Remote Server Administration Ports (Automated)

- Source: https://support.icompaas.com/support/solutions/articles/62000233116-5-3-ensure-no-security-groups-allow-ingress-from-0-0-0-0-0-to-remote-server-administration-ports-aut
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [AWS CIS V.4 Level 1 Benchmarks](https://support.icompaas.com/support/solutions/62000112671) › [CIS Control 5](https://support.icompaas.com/support/solutions/folders/62000169192)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

### **Profile Applicability:**

**Level 1**

## **Description:**

AWS Security Groups provide stateful filtering for inbound and outbound network traffic to AWS resources. It is recommended that no security group allows unrestricted ingress (0.0.0.0/0) to remote server administration ports, such as:

-   SSH (Port 22 - TCP, UDP, ALL)
    
-   RDP (Port 3389 - TCP, UDP, ALL)  
    Allowing public access (0.0.0.0/0) to these ports significantly increases the risk of unauthorized access and potential compromise.
    

## Rationale:

Exposing remote administration ports (e.g., SSH 22, RDP 3389) to the entire internet (0.0.0.0/0) significantly increases security risks, including:

-   Brute-force attacks on SSH and RDP.
    
-   Unauthorized access, potentially leading to data breaches.
    
-   Automated scanning and exploitation by cybercriminals.
    

Organizations should restrict remote access to trusted IP addresses, use VPNs, or leverage AWS Systems Manager Session Manager for secure administration.

## Impact:

-   If unrestricted access (0.0.0.0/0) is removed, administrators must ensure an alternative access mechanism is in place (e.g., VPN, bastion host, AWS Session Manager) to maintain connectivity.
    
-   Without an alternative, legitimate users may lose access to AWS instances.
    

## Default Value:

By default, AWS does not open SSH (22) or RDP (3389) to 0.0.0.0/0 when creating security groups. However, users often manually add overly permissive rules.Pre-Requisites:

1.  AWS CLI Installed (for command-line checks and modifications).
    
2.  IAM Permissions Required:
    
    -   ec2:DescribeSecurityGroups (to audit security groups).
        
    -   ec2:RevokeSecurityGroupIngress (to remove non-compliant rules).
        
3.  Alternative Secure Access Mechanism Available:
    
    -   AWS Systems Manager Session Manager
        
    -   VPN or Bastion Host (Jump Server)
        
    -   Whitelisted IPs from corporate network
        
4.  Security Group Review Process to validate required network rules before making changes.
    

## Remediation:

### Test Plan:

## Using AWS Console

1.  Sign in to the AWS Management Console.
    
2.  Navigate to the VPC Dashboard: [AWS VPC Console](https://console.aws.amazon.com/vpc/).
    
3.  In the left navigation panel, select Security Groups.
    
4.  For each security group:
    
    -   Select the security group.
        
    -   Click the Inbound Rules tab.
        
    -   Identify rules with:
        
        -   Port 22 (SSH) or 3389 (RDP)
            
        -   Protocol: TCP (6), UDP (17), or ALL (-1)
            
        -   Source: 0.0.0.0/0
            

## Implementation Steps:  
Using AWS Console

1.  Sign in to the AWS Management Console.
    
2.  Navigate to the VPC Dashboard: [AWS VPC Console](https://console.aws.amazon.com/vpc/).  
      
    ![](https://support.icompaas.com/assets/kb/92b0314bfc7378cc.png)  
      
    
3.  In the left navigation panel, select Security Groups.  
      
    ![](https://support.icompaas.com/assets/kb/804fe813d0d13b84.png)  
      
    
4.  For each security group:
    
    -   Select the security group.  
          
        ![](https://support.icompaas.com/assets/kb/6b073e0d788d06d3.png)  
          
        
    -   Click Edit inbound rules.  
        ![](https://support.icompaas.com/assets/kb/57875c3ce2d4ccc0.png)
        
    -   Identify rules with:
        
        -   Port 22 or 3389
            
        -   Source: 0.0.0.0/0
            
    -   Update the source field to a trusted IP range (e.g., VPN, corporate IP, or Bastion Host).  
          
        ![](https://support.icompaas.com/assets/kb/f44e933bf4ecf266.png)  
          
        
    -   OR Delete the rule if unnecessary.
        
    -   Click Save rules.  
        

## Backout Plan:

If necessary access is lost:

1.  Restore a temporary security group rule allowing access from a specific trusted IP:
    
    aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 22 --cidr <your-trusted-ip>/32
    
2.  Ensure AWS Systems Manager is enabled for future remote access.
    
3.  Implement a bastion host or VPN before removing wide-open access again.
    

## References:

-   [AWS EC2 Security Groups Documentation  
    ](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-security-groups.html#deleting-security-group-rule)
    

### CIS Controls Mapping:  

<table style="border:none;border-collapse:collapse;font-family:&quot;Helvetica Neue&quot;"><colgroup style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"></colgroup><tbody style="font-family:&quot;Helvetica Neue&quot;"><tr style="height:53.5pt;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:13.6435%"><p dir="ltr" style="line-height:1.38;text-align:left;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="color:rgb(0, 0, 0)"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span dir="ltr" style="font-weight:700;font-family:&quot;Helvetica Neue&quot;">CIS Control Version</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:8.2228%"><p dir="ltr" style="line-height:1.38;text-align:left;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="color:rgb(0, 0, 0)"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-weight:700;font-family:&quot;Helvetica Neue&quot;">Control ID</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:78.1429%"><p dir="ltr" style="line-height:1.38;text-align:center;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="color:rgb(0, 0, 0)"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-weight:700;font-family:&quot;Helvetica Neue&quot;">Control Description</span></span></span></span></p></td></tr><tr style="height:82pt;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:13.6435%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="color:rgb(0, 0, 0)"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">CIS v8</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:8.2228%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="color:rgb(0, 0, 0)"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">4.5</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:78.1429%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="color:rgb(0, 0, 0)"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">Implement and manage a host-based firewall or port-filtering tool on end-user devices, with a default-deny rule that drops all traffic except those services and ports that are explicitly allowed.</span></span></span></span></p></td></tr><tr style="height:67.75pt;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:13.6435%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="color:rgb(0, 0, 0)"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">CIS v7</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:8.2228%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="color:rgb(0, 0, 0)"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">9.4</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:78.1429%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="color:rgb(0, 0, 0)"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">Apply host-based firewalls or port filtering tools on end systems, with a default-deny rule that drops all traffic except those services and ports that are explicitly allowed.</span></span></span></span></p></td></tr></tbody></table>

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