Logging metric filter and alert for network route changes should be configured

Description

Routes define the paths network traffic takes from a VM instance to another destination, which can be inside the same VPC network or outside of it. Monitoring changes to route tables helps prevent accidental or malicious changes that could result in either dropped packets or network hijacking.

Remediation Steps

Google Cloud Console

This is a two-part process. First, you create the log metric. Next, you create an alert policy.

Step 1: To create the log metric:

  • Navigate to Logs-based Metrics and click CREATE METRIC.

  • Ensure Metric Type is set to Counter.

  • Under Details, enter a name and description, and set Units to 1.

  • Under Filter selection, clear any text in the Build filter box and enter the following:

resource.type="gce_route"
AND (protoPayload.methodName:compute.routes.delete
OR protoPayload.methodName:compute.routes.insert)
  • Click Create Metric.

Step 2: To create the alert policy:

  • Navigate to Logs-based Metrics and identify the newly created metric under the section User-defined Metrics.

  • Click the 3-dot icon in the rightmost column for the new metric and select Create alert from metric.

  • In the left sidebar, keep the defaults for the Alert Conditions sections, and under Alert Details, select Notifications and name.

  • Configure the desired notification channels in the section Configure notifications.

  • Name the alert and click Create Policy.

gcloud CLI

  • To create the log metric:

    • gcloud beta logging metrics create

For flags, see Google Cloud’s CLI reference.

  • To create the alert policy:

    • gcloud alpha monitoring policies create

For flags, see Google Cloud’s CLI reference.