Identify unused AWS VPCs

It is recommended to delete these VPCs that do not have resources attached to them to reduce AWS cost.

Risk Level: Low
Cloud Entity: Amazon VPC
CloudGuard Rule ID: D9.AWS.OPE.10
Covered by Spectral: Yes
Category: Compute

GSL LOGIC

VPC should have subnets length()>=1

REMEDIATION

From Portal

  1. Log in to the AWS console.
  2. In the console, select the specific region.
  3. Navigate to VPC Dashboard.
  4. Click 'Your VPCs' and select the reported VPC.
  5. If you want to use the reported VPC, associate subnets to the VPC.
  6. If you want to delete the VPC, click 'Actions' and select 'Delete VPC' from the dropdown.

From Command Line
Use following command to delete a unused VPC:

aws ec2 delete-vpc --vpc-id vpc_id

References

  1. https://docs.aws.amazon.com/vpc/latest/userguide/working-with-vpcs.html#VPC_Deleting
  2. https://docs.aws.amazon.com/vpc/latest/userguide/working-with-subnets.html
  3. https://docs.aws.amazon.com/prescriptive-guidance/latest/aws-startup-security-baseline/acct-09.html
  4. https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/delete-vpc.html

Amazon VPC

Amazon Virtual Private Cloud (Amazon VPC) lets you provision a logically isolated section of the AWS Cloud where you can launch AWS resources in a virtual network that you define. You have complete control over your virtual networking environment, including selection of your own IP address range, creation of subnets, and configuration of route tables and network gateways. You can use both IPv4 and IPv6 in your VPC for secure and easy access to resources and applications.

Compliance Frameworks

  • AWS CSA CCM v.4.0.1
  • AWS CloudGuard Best Practices
  • AWS CloudGuard Well Architected Framework
  • AWS HITRUST
  • AWS ITSG-33
  • AWS MAS TRM Framework
  • AWS MITRE ATT&CK Framework v10
  • AWS MITRE ATT&CK Framework v11.3
  • CloudGuard AWS All Rules Ruleset