VPC network is not legacy
Google Cloud networks are evaluated for legacy mode (subnet_mode: legacy). The finding highlights networks using the older, non-subnetted design instead of VPC with regional subnets.
Risk
Legacy networks lack subnets, peering, and private access. This reduces isolation and forces public IP paths, weakening confidentiality and enabling lateral movement/data exfiltration. Coarse controls and routing limits threaten integrity. A single global range and gateway create contention that can degrade availability.
Run this check with Prowler
Run in Prowler Cloudprowler gcp --checks compute_network_not_legacyRecommendation
Decommission legacy networks. Migrate to custom-mode VPCs with regional subnets and granular firewall policies. Apply least privilege segmentation, enable private access and Cloud NAT to avoid public exposure, and use peering or private connectivity for dependencies. Plan and test migration to limit downtime.
Remediation
CLI
gcloud beta compute networks update <LEGACY_NETWORK_NAME> --switch-to-custom-subnet-modeOther
Check Code
from prowler.lib.check.models import Check, Check_Report_GCP
from prowler.providers.gcp.services.compute.compute_client import compute_client
class compute_network_not_legacy(Check):
def execute(self) -> Check_Report_GCP:
findings = []
for network in compute_client.networks:
report = Check_Report_GCP(
metadata=self.metadata(),
resource=network,
location=compute_client.region,
)
report.status = "PASS"
report.status_extended = f"Network {network.name} is not legacy."
if network.subnet_mode == "legacy":
report.status = "FAIL"
report.status_extended = f"Legacy network {network.name} exists."
findings.append(report)
return findings