Default VPC security group should restrict all traffic

Description

A VPC comes with a default security group that by default denies all inbound traffic, allows all outbound traffic, and permits all traffic among instances within the group. By setting up your default security group to restrict all traffic, you encourage the development of least privilege security groups and ensure mindful placement of AWS resources. This practice reduces the exposure of your resources. As each new VPC is created, including the default VPC in every region, updating the default security group is necessary to comply with security best practices.

Configuring VPC flow logging is a valuable tool during this process as it logs packet acceptances and rejections, helping identify the minimum port access requirements for proper system operation. Even if not adopted permanently, it proves critical for engineering least privileged security groups.

Remediation

For detailed guidance on modifying default security groups to restrict all traffic, refer to the AWS EC2 Security Groups documentation.