AWS Security Hub · AutoScaling
AutoScaling.5: A launch config gives ASG instances public IPs
Written and reviewed by Emnode · Last reviewed
What does AWS Security Hub AutoScaling.5 check?
AutoScaling.5 fails when a launch configuration has AssociatePublicIpAddress set to true. Every instance the group launches from it gets a public IP and becomes directly reachable from the internet.
Why does AutoScaling.5 matter?
Fleet instances belong in private subnets behind a load balancer, not on public IPs. A launch configuration that assigns public addresses puts every autoscaled instance directly on the internet, widening the attack surface to anything listening on those hosts. Years of copy-pasted configurations have carried this convenience default forward into fleets that never needed it.
How do I fix AutoScaling.5?
- Find launch configurations with AssociatePublicIpAddress enabled.
- Clone the bad launch configuration into a new one with the flag disabled, since launch configurations are immutable.
- Point the Auto Scaling group at the new launch configuration.
- Run an instance refresh so running instances are replaced with private ones, and place the group in private subnets.
Remediation script · bash
# Close the highest-impact public exposure first: databases.
for db in $(aws rds describe-db-instances \
--query 'DBInstances[?PubliclyAccessible==`true`].DBInstanceIdentifier' --output text); do
aws rds modify-db-instance --db-instance-identifier "$db" \
--no-publicly-accessible --apply-immediately
echo "$db: public access removed"
done
# Ratchet S3 shut at the account level so no bucket can be made public again.
aws s3control put-public-access-block --account-id 123456789012 \
--public-access-block-configuration \
'BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true' Full walkthrough (console steps, edge cases and verification) in the lesson Block public access to AWS resources.
Is AutoScaling.5 a false positive?
An instance only actually gets a public IP if it lands in a subnet that allows one — but the control flags the launch configuration flag itself, so it fails even where the subnet would not assign an address.
More AutoScaling controls
- AutoScaling.1 ASGs with an LB should use ELB health checks
- AutoScaling.2 A single-AZ Auto Scaling group is one outage from zero capacity
- AutoScaling.3 Launched instances still allow IMDSv1
- AutoScaling.6 ASGs should use multiple instance types/AZs
- AutoScaling.9 Deprecated launch configurations are still in use