Changes to VPC network routes should raise an alert
This check looks for a log-based metric that matches VPC route changes and an alerting policy attached to it. The safe setting is a metric with a filter for route create, patch and delete events, plus an alert that notifies someone when it fires.
Why it matters
Routes decide where traffic in a VPC network goes. A changed or added route can send traffic through an unexpected path or cut a service off, and such a change is usually deliberate only when someone planned it. Cloud Audit Logs record these operations, and a log-based metric turns matching log entries into a count that Cloud Monitoring can alert on (Google Cloud log-based metrics).
Google notes that a user-defined log-based metric counts only entries received after it is created, so an alert set up late will not tell you about earlier changes.
How to check it yourself
In the Google Cloud console open Logging > Log-based metrics and look in the user-defined list for a counter whose filter mentions route operations. Then open Monitoring > Alerting and confirm a policy uses that metric.
Read-only commands:
gcloud logging metrics list --project
gcloud logging metrics describe --project
gcloud monitoring policies list --project The metric's filter field should match Compute Engine route events, and a policy should reference logging.googleapis.com/user/<metric-name>. If either is missing, the check fails.
How to fix it
Create a counter metric under Logging > Log-based metrics > Create metric with a filter on Compute route operations, for example:
resource.type="gce_route"
AND (protoPayload.methodName:"compute.routes.delete"
OR protoPayload.methodName:"compute.routes.insert")gcloud logging metrics create vpc-route-changes \
--description="VPC route changes" \
--log-filter='resource.type="gce_route" AND (protoPayload.methodName:"compute.routes.delete" OR protoPayload.methodName:"compute.routes.insert")'Then create an alerting policy on logging.googleapis.com/user/vpc-route-changes in Monitoring > Alerting, with a notification channel your team reads. Google recommends choosing how the policy handles missing data, because the series can have gaps. ConfigCobra itself never changes your projects; run these steps yourself and test them in a sandbox project first.
What changes when you fix it
Nothing changes for workloads or end users; the metric only counts log entries and the policy only sends notifications. The people affected are whoever sits on the notification channel, who will start receiving a message each time a route changes, including routine changes by your own network team.
Google states that user-defined log-based metrics are chargeable as custom metrics, so the project owner may see a small new line on the bill. Because the metric is created per project, repeat it in every project in scope, or use a shared log scope if your design has one.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Google Cloud Platform Foundation v5.0.0 | 2.9 | Level 2 |
More checks in Logging and Monitoring
- Configure Cloud Audit Logging across all services and usersCIS 2.1
- Enable Workspace/Cloud Identity data sharing for admin audit loggingCIS 2.2
- Configure sinks to export copies of all log entriesCIS 2.3
- Apply Bucket Lock retention policies to log-export storage bucketsCIS 2.4
- Alert on project-ownership assignments/changes via log metric filterCIS 2.5
Go further
- Logging and Monitoring17 controls in this section
- CIS Google Cloud Platform Foundation v5.0.093 controls
- CIS Google Cloud Platform Foundation checklistEvery control in one list, as CSV
- RemediationSee what a fix changes in your tenant before you apply it, then use the generated script
- Monitoring & DriftScheduled scans, drift detection and email alerts when a control regresses
Check this on your Google Cloud
ConfigCobra runs this check with every other control of the CIS Google Cloud Platform Foundation Benchmark, read-only.