# Ensure 'assignPublicIp' is Set to 'DISABLED' for Amazon ECS Services

- Source: https://support.icompaas.com/support/solutions/articles/62000233981-ensure-assignpublicip-is-set-to-disabled-for-amazon-ecs-services
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS AWS Compute Services Benchmark v1.1.0](https://support.icompaas.com/support/solutions/62000112682) › [AWS Compute Services Benchmark v1.1.0](https://support.icompaas.com/support/solutions/folders/62000169228)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:**  

-   **Level 1**

**Description:** This rule ensures that assignPublicIp is set to DISABLED for Amazon ECS services. Disabling the automatic assignment of public IPs to ECS services helps prevent direct exposure of container applications to the public internet, which could increase the risk of unauthorized access or attacks.

**Rationale:** Allowing ECS services to assign public IPs can expose containerized applications to the public internet, increasing the potential attack surface. By setting assignPublicIp to DISABLED, containers are isolated within a private network and cannot be accessed directly from the internet unless explicitly routed through a load balancer or other secure methods.

**Impact:  
 Pros:**

-   Enhanced security by preventing direct public internet access to containers.  
    
-   Improved network isolation, reducing the likelihood of unauthorized access or data breaches.  
    

**Cons:**

-   Operational overhead: Requires configuring and maintaining private networking and associated resources, such as a load balancer or NAT gateway, to allow for controlled access to the ECS services.  
    
-   Potential additional costs for private networking components.  
    

**Default Value:** By default, assignPublicIp is set to ENABLED, which means ECS services are allowed to obtain public IP addresses upon launch.

**Pre-requisites:**

-   AWS IAM permissions to manage ECS services:  
     ecs:UpdateService, ecs:DescribeServices  
    

**Remediation:**

**Test Plan:**

**Using AWS Console:**

1.  Log in to the ECS Console at [AWS ECS Console](https://console.aws.amazon.com/ecs/).  
    
2.  In the left panel, click Clusters.  
    
3.  Click the name of the cluster you wish to review.  
    
4.  Under Services, click the name of the service.  
    
5.  Click Configuration and Networking.  
    
6.  Under Network Configuration, ensure that Auto-assign public IP is set to Turned off.  
    
7.  Repeat steps 1-6 for each ECS cluster and service in use across all regions.  
    

**Using AWS CLI:**

1.  Run the following command to list the available ECS clusters:  
    
    aws ecs list-clusters
    
2.  For each cluster, run the following command to list its services:  
    
    aws ecs list-services --cluster <cluster-arn>
    
3.  For each service, run the following command to describe the service and check its network configuration:  
    
    aws ecs describe-services --cluster <cluster-arn> --services <service-arn>
    
4.  Ensure that under networkConfiguration > awsvpcConfiguration, the assignPublicIp parameter is set to DISABLED.  
    

**Implementation Plan:**

**Using AWS Console:**

1.  Log in to the ECS Console at [AWS ECS Console](https://console.aws.amazon.com/ecs/).  
    
2.  In the left panel, click Clusters.  
    
3.  Click the name of the cluster you wish to modify.  
    
4.  Under Services, click the service you want to modify.  
    
5.  Click Create new revision.  
    
6.  Under Network Configuration, uncheck Auto-assign public IP.  
    
7.  Click Update to apply the changes.  
    
8.  Repeat for other ECS services as required.  
    

**Using AWS CLI:**

1.  For each ECS service that requires remediation, run the following command to update its network configuration:  
    
    aws ecs update-service --cluster <cluster-arn> --service <service-arn> --network-configuration '{"awsvpcConfiguration":{"subnets":\["<subnet-id>"\],"securityGroups":\["<security-group-id>"\],"assignPublicIp":"DISABLED"}}'
    
2.  Repeat this step for each ECS service that needs to have the public IP assignment disabled.  
    

**Backout Plan:**

**Using AWS Console:**

1.  If issues arise after disabling assignPublicIp, you can revert the changes by re-enabling the Auto-assign public IP option for the affected services.  
    
2.  Go to the ECS service configuration and enable Auto-assign public IP again.  
    

**Using AWS CLI:**

1.  To revert the setting back to the default, run the following command to enable assignPublicIp:  
    
    aws ecs update-service --cluster <cluster-arn> --service <service-arn> --network-configuration '{"awsvpcConfiguration":{"subnets":\["<subnet-id>"\],"securityGroups":\["<security-group-id>"\],"assignPublicIp":"ENABLED"}}'
    

**References:**

1.  [AWS ECS: Update Service  
    ](https://aws.amazon.com/cli/latest/reference/ecs/update-service.html)
    
2.  [AWS ECS: Describe Services  
    ](https://aws.amazon.com/cli/latest/reference/ecs/describe-services.html)
    
3.  [AWS ECS: Network Mode Configuration  
    ](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/networking.html)
    

**CIS Controls:**

<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;"></colgroup><tbody style="font-family:&quot;Helvetica Neue&quot;"><tr style="height:38.5pt;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;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-family:&quot;Helvetica Neue&quot;">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-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-family:&quot;Helvetica Neue&quot;">Control Description</span></span></span></p></td></tr><tr style="height:51.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-family:&quot;Helvetica Neue&quot;">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-family:&quot;Helvetica Neue&quot;">3.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-family:&quot;Helvetica Neue&quot;">Configure data access control lists&nbsp;and restrict access to resources by ensuring&nbsp;ECS services&nbsp;are&nbsp;isolated&nbsp;and&nbsp;not directly exposed to the internet.</span></span></span></p></td></tr><tr style="height:38.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"><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-family:&quot;Helvetica Neue&quot;">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-family:&quot;Helvetica Neue&quot;">14.6</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Protect information&nbsp;by configuring&nbsp;ECS services&nbsp;to not assign public IPs, thus preventing&nbsp;direct internet access</span><span style="color:rgb(0, 0, 0);font-weight:400;font-family:&quot;Helvetica Neue&quot;">&nbsp;to containers.</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.
