Ensure 'public IP on launch' is not enabled for AWS Subnets

MEDIUM

Description

Allowing unrestricted, public access to cloud services could open an application up to external attack. Disallowing this access is typically considered best practice.

Remediation

In AWS Console -

  1. Sign in to the AWS Console and go to the VPC dashboard.
  2. In the navigation pane, select subnets.
  3. Select your subnet and then choose Subnet Actions, Modify auto-assign IP settings.
  4. Clear the Enable auto-assign public IPv4 address check box and then choose Save.

In terraform -

  1. In the 'aws_subnet' resource, set 'map_public_ip_on_launch' to false.

References:
https://docs.aws.amazon.com/vpc/latest/userguide/working-with-subnets.html
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet

Policy Details

Rule Reference ID: AC_AWS_0391
CSP: AWS
Remediation Available: Yes
Resource: aws_subnet
Resource Category: Virtual Network
Resource Type: Security Group

Frameworks