π AWS EC2 Auto Scaling Group behind ELB assigns public IP to instances π’
- Contextual name: π Auto Scaling Group behind ELB assigns public IP to instances π’
- ID:
/ce/ca/aws/autoscaling/group-config-public-ip-assignement
- Located in: π AWS Auto Scaling
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
RELIABILITY
SECURITY
Similar Policiesβ
- AWS Security Hub
- [[Autoscaling.5] Amazon EC2 instances launched using Auto Scaling group launch configurations should not have Public IP addresses]([Autoscaling.5] Amazon EC2 instances launched using Auto Scaling group launch configurations should not have Public IP addresses (https://docs.aws.amazon.com/securityhub/latest/userguide/autoscaling-controls.html#autoscaling-5)]
- Internal
dec-x-84342650
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-84342650 | 1 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Ensure that Auto Scaling Group launch configuration is not configured to assign public IP addresses to EC2 instances launched behind a load balancer.
If you do not set
Associate Public IP Address
, the default is to use the auto-assign public IP settings of the subnets that your instances are launched into.Rationaleβ
When an EC2 instance is launched with a public IP while also being registered behind an ELB, it may become directly addressable from the internet, potentially circumventing the centralized control point provided by the ELB. This undermines security postures such as centralized logging, access control policies, WAF protection, and TLS termination.
Auditβ
This policy flags an AWS EC2 Auto Scaling Group as
INCOMPLIANT
if the following conditions are met:
- It is associated with a load balancer, and
- Its AWS EC2 Launch Configuration (accessible via the
Launch Configuration
field) has theAssociate Public IP Address
checkbox set to true.An Auto Scaling Group is marked as
INAPPLICABLE
in either of the following cases:... see more
Remediationβ
Remediationβ
It is recommended to transition from Launch Configurations to Launch Templates rather than modifying the existing launch configuration. The migration process to launch templates is outlined in /ce/ca/aws/autoscaling/group-uses-launch-configuration.
If immediate migration is not feasible, you may choose to modify the current launch configuration as outlined below.
From Command Lineβ
Create a New Launch Configurationβ
Launch configurations cannot be modified once created. To update the launch configuration for an Auto Scaling group, you must create a new launch configuration based on the existing one.
Optionally, you can retrieve the settings of the current launch configuration using the following command:
aws autoscaling describe-launch-configurations \
--launch-configuration-names {{existing-launch-configuration-name}}Once you have the configuration details, create a new launch configuration using the
create-launch-configuration
command. Set the--associate-public-ip-address
parameter to true in the new configuration:... see more