Other Articles

VPC Network – Avoid the Default Network

Secure Configuration Checks > GCP

This check ensures that the default VPC network does not exist in the project. Use custom networks that you design and secure yourself.

Check Details

  • Resource: VPC Network
  • Check: Avoid the default network
  • Risk: The default network has a subnet in every region and permissive firewall rules. This widens the attack surface and makes it easy to expose resources by mistake.

Remediation via Google Cloud Console

  1. Log in to the Google Cloud Console and navigate to VPC network > VPC networks. VPC Networks
  2. Click Create VPC network. Enter a network name and set Subnet creation mode to Custom. Configure a subnet by providing its name, region and IP range, then click Create. Create VPC Network
  3. Recreate or migrate the resources using the default network to the new custom network. Update their network configurations and connectivity as required.
  4. Return to VPC network > VPC networks and select the default network.
  5. Click Delete VPC network and confirm the deletion. Delete default VPC network
  6. Verify that the default network no longer appears in the VPC networks list.

Remediation via Google Cloud CLI

  1. Open the Google Cloud Console and launch Cloud Shell. GCP Cloud Shell
  2. Check whether the default network exists:

    gcloud compute networks list --filter="name=default"
    
  3. Create a custom network and a subnet:

    gcloud compute networks create <NETWORK_NAME> --subnet-mode=custom
    
    gcloud compute networks subnets create <SUBNET_NAME> \
    --network=<NETWORK_NAME> \
    --region=<REGION> \
    --range=<IP_RANGE>
    

    Replace the values with your own names, for example us-central1 for the region and 10.0.0.0/24 for the range. Then move or recreate the resources that use the default network in the new network.

  4. Delete the firewall rules of the default network:

    gcloud compute firewall-rules list \
    --filter='network~"/default$"' \
    --format="value(name)" | \
    xargs -r gcloud compute firewall-rules delete --quiet
    
  5. Delete the default network:

    gcloud compute networks delete default
    

    The command fails if resources still use the network. Move them first.

  6. Verify that the default network is gone:

    gcloud compute networks list --filter="name=default"
    

    The command must list no networks.

    Verify default network is deleted

Default Value

By default, new projects get a default network. An organization policy can stop this. Use the compute.skipDefaultNetworkCreation constraint.

Updated on 09 November, 2026