Skip to main content

More Info:

Ensures that logging and log alerts exist for VPC network route changes.

Risk Level

Medium

Address

Security

Compliance Standards

HIPAA, PCI

Triage and Remediation

Remediation

Using Console

Here’s how to enable VPC Route Logging for a GCP VPC network via the GCP Console:
  1. Go to VPC networks
    • In the Google Cloud console, go to:
      Navigation menu (☰) → VPC network → VPC networks
  2. Select the VPC network
    • Click the name of the VPC network that contains the subnet(s) you want to enable route logging for.
  3. Open the Subnets list
    • In the VPC network details page, go to the Subnets tab.
    • Find the subnet where you want to enable route logging.
    • Click the Subnet name to open its details.
  4. Edit the subnet
    • At the top of the subnet details page, click Edit.
  5. Enable Route Logging
    • Scroll down to the Logs section.
    • You should see options such as:
      • VPC flow logs
      • Route logs
    • Set Route logs to On.
    • (Optional but recommended) Adjust:
      • Aggregation interval
      • Sampling (e.g., 1.0 for all)
      • Metadata level
      • Filter (All, Include, or Exclude certain traffic)
  6. Save changes
    • Scroll down and click Save.
  7. Verify logs in Cloud Logging
    • Go to Navigation menu (☰) → Logging → Logs Explorer.
    • In the query builder, choose:
      • Resource type: gce_subnetwork or gce_instance (depending how you want to filter)
      • Log name typically includes: vpc_route or similar, depending on UI changes.
    • Run the query and confirm that route logs are appearing.
Repeat steps 3–6 for each subnet where you need route logging enabled.
To address “VPC Network Route Logging” findings in GCP, what most tools are actually flagging is the lack of VPC Flow Logs on subnets. You remediate this by enabling flow logs on each subnet via gcloud.Below are step‑by‑step CLI instructions.

1. List all subnets and see which have Flow Logs disabled

Look for subnets where enableFlowLogs is False or empty.

2. Enable VPC Flow Logs on a specific subnet

Basic enablement with default settings:
Replace:
  • SUBNET_NAME with your subnet name.
  • REGION with the subnet’s region (e.g. us-central1).

3. (Optional) Configure advanced logging options

If you want finer control (recommended for production), use:
Examples:
Common values:
  • --logging-aggregation-interval:
    • interval-5-min, interval-10-min, interval-15-min, interval-30-min, interval-1-min
  • --logging-flow-sampling:
    • 0.01.0 (e.g. 0.5 = 50%, 0.005 = 0.5%)
  • --logging-metadata:
    • INCLUDE_ALL_METADATA, EXCLUDE_ALL_METADATA, CUSTOM_METADATA

4. Verify that Flow Logs are enabled

Confirm enableFlowLogs: true and that logConfig matches your desired settings.

5. Repeat for all required subnets

You can loop through all subnets in a network:

If your finding truly refers to a different, specific “route logging” feature (e.g., from a particular security tool), share the exact tool / rule ID and I can tailor the exact gcloud commands.
To remediate “VPC Network Route Logging” findings in GCP, you typically enable VPC Flow Logs on all subnets of the affected VPC network. These logs provide route-level visibility (next hop, route, etc.) via Cloud Logging.Below is how to do this using Python and the Compute Engine API.

1. Prerequisites

  1. Install libraries:
  1. Make sure your environment is authenticated, e.g.:
  1. Ensure the account has:
  • roles/compute.networkAdmin (or equivalent custom role)

2. Python script to enable VPC Flow Logs on all subnets in a VPC


3. What this achieves

  • Enumerates all subnetworks in the project.
  • Filters those in the specified VPC network.
  • For each subnetwork, enables enableFlowLogs and configures a logConfig, which results in flow + route logging going to Cloud Logging.
Adjust aggregationInterval, flowSampling, and metadata as per your org’s logging/volume requirements.

Additional Reading: