# 5.4 Ensure no security groups allow ingress from ::/0 to remote server administration ports (Automated)

- Source: https://support.icompaas.com/support/solutions/articles/62000234275-5-4-ensure-no-security-groups-allow-ingress-from-0-to-remote-server-administration-ports-automate
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS Amazon Web Services Foundations Benchmark v5.0.0](https://support.icompaas.com/support/solutions/62000112684) › [CIS AWS Benchmarks](https://support.icompaas.com/support/solutions/folders/62000169233)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

#### Profile Applicability

-   **Level 1**

#### Description:

Security groups act as virtual firewalls for EC2 instances, controlling inbound and outbound traffic. By default, AWS allows any IPv6 address (::/0) to access server administration ports like SSH (port 22) or RDP (port 3389), which can be a major security risk. To mitigate the risk of unauthorized access, it is essential to ensure that no security groups allow ingress from the ::/0 address range to remote server administration ports. This prevents any external access via IPv6 to critical administration ports, unless explicitly required.

Implementing this control ensures that remote server administration ports are secured against unauthorized access from the public internet via IPv6.

#### Rationale:

Blocking ingress from ::/0 (the entire IPv6 address space) to remote server administration ports provides the following benefits:

-   Enhanced security: Prevents unauthorized users from accessing critical administration ports via IPv6.  
    
-   Compliance: Meets security requirements that mandate restricting administrative access to only trusted networks and addresses.  
    
-   Reduced attack surface: By blocking remote administration access from the public internet, the attack surface is minimized, reducing the risk of brute force or other attacks on server administration ports.  
    
-   Principle of least privilege: Only explicitly authorized IP addresses should have access to sensitive ports, ensuring that only trusted sources can connect to remote administration services.  
    

Without this control, servers may be exposed to unauthorized remote access via IPv6, potentially leading to security breaches.

#### Impact:

Failure to block ingress from ::/0 to remote administration ports can result in:

-   Unauthorized access: Exposing administration ports to the public internet via IPv6 allows attackers to attempt unauthorized logins.  
    
-   Non-compliance: Violates best practices and security standards that require strict control over remote server administration access.  
    
-   Security risks: Increased risk of attacks such as brute-force login attempts or exploitation of vulnerabilities in SSH/RDP services.  
    

Ensuring that no security groups allow ingress from ::/0 significantly reduces these risks.

#### Default Value:

By default, AWS security groups allow access to remote server administration ports (such as SSH and RDP) from any IP address, including ::/0, which is a global IPv6 address. This default setting needs to be explicitly modified to restrict access.

#### Pre-Requisites:

-   AWS CLI installed and configured  
    
-   IAM permissions:  
    
    -   ec2:DescribeSecurityGroups  
        
    -   ec2:RevokeSecurityGroupIngress  
        
    -   ec2:AuthorizeSecurityGroupIngress  
        
-   Access to EC2 instance security groups to modify ingress rules  
    

#### Remediation:

##### Test Plan:

Using AWS Console:

1.  Go to the [EC2 Console](https://console.aws.amazon.com/ec2/).
    
2.  In the Security Groups section, review the inbound rules for each security group.
    
3.  Identify any security groups that allow ingress from ::/0 to ports like SSH (22) or RDP (3389).
    
4.  Remove or modify the rules to block access from ::/0 to these ports.
    

Using AWS CLI:

aws ec2 describe-security-groups --query "SecurityGroups\[\].\[GroupName, IpPermissions\]" --output table

To check if any security group allows ingress from ::/0:

aws ec2 describe-security-groups --query "SecurityGroups\[?IpPermissions\[?IpRanges\[?CidrIp=='::/0'\]\]\].GroupName" --output table

##### Implementation Plan:

Using AWS Console:

1.  Modify security group to block ingress from ::/0:  
    
    -   Go to the [EC2 Console](https://console.aws.amazon.com/ec2/).  
        
    -   In the Security Groups section, find the security group that allows ingress from ::/0 on administrative ports.
        
    -   Modify the Inbound rules to remove any rules allowing ::/0 for ports like SSH (22) or RDP (3389).
        
    -   If necessary, add more restrictive rules that only allow access from trusted IP ranges.  
          
        
2.  Verify the changes:  
    
    -   After modifying the rules, ensure that no security group is allowing ingress from ::/0 to sensitive administration ports.
        

Using AWS CLI:

1.  Revoke ingress from ::/0 on remote server administration ports:  
    

aws ec2 revoke-security-group-ingress --group-id <security-group-id> --protocol tcp --port 22 --cidr ::/0
aws ec2 revoke-security-group-ingress --group-id <security-group-id> --protocol tcp --port 3389 --cidr ::/0

2.  Add more restrictive ingress rules:  
    

aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 22 --cidr <trusted-ip-range>/32
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 3389 --cidr <trusted-ip-range>/32

3.  Verify that no security groups allow ingress from ::/0:  
    

aws ec2 describe-security-groups --query "SecurityGroups\[?IpPermissions\[?IpRanges\[?CidrIp=='::/0'\]\]\].GroupName" --output table

#### Backout Plan:

Using AWS Console:

1.  If restricting ingress causes connectivity issues:  
    
    -   Go to the [EC2 Console](https://console.aws.amazon.com/ec2/).  
        
    -   Revert the security group to allow ingress from ::/0 on the remote administration ports (SSH or RDP) temporarily if needed for troubleshooting.
        
    -   Modify the rules to allow more restrictive access as necessary.  
        
2.  Review the security group settings to ensure only the necessary IP addresses or ranges have access to the remote administration ports.
    

Using AWS CLI:

1.  Revert ingress rules temporarily if remote access issues occur:
    

aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 22 --cidr ::/0
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 3389 --cidr ::/0

2.  Revert back to restrictive access rules once issues are resolved:  
    

aws ec2 revoke-security-group-ingress --group-id <security-group-id> --protocol tcp --port 22 --cidr ::/0
aws ec2 revoke-security-group-ingress --group-id <security-group-id> --protocol tcp --port 3389 --cidr ::/0

#### References:

-   [AWS VPC Security Group Documentation  
    ](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html)
    
-   [AWS CLI Command Reference for EC2  
    ](https://docs.aws.amazon.com/cli/latest/reference/ec2/)
    
-   [AWS Security Best Practices  
    ](https://aws.amazon.com/security/)
    

#### CIS Controls Mapping:

<table style="border:none;border-collapse:collapse"><tbody><tr style="height:39.25pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:700;font-family:&quot;Helvetica Neue&quot;">CIS Control Version</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:700;font-family:&quot;Helvetica Neue&quot;">Control ID</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:700;font-family:&quot;Helvetica Neue&quot;">Control Description</span></span></span></p></td></tr><tr style="height:39.25pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">CIS v8</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">4.9</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">Perform Continuous Security Monitoring and Incident Detection</span></span></span></p></td></tr><tr style="height:25pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">CIS v7</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">6.3</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">Monitor Security Configurations for Compliance</span></span></span></p></td></tr><tr style="height:39.25pt"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">CIS v7</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">5.2</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;text-align:justify"><span style="font-size:14px"><span style="font-family:&quot;Helvetica Neue&quot;"><span dir="ltr" style="color:rgb(0, 0, 0);font-weight:400">Securely Manage and Monitor Cloud Accounts and Services</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.
