More Info:

Ensure Cloud Monitoring monitors dropped bytes count for firewall.

Risk Level

Medium

Address

Security, Performance Efficiency, Reliability

Compliance Standards

CBP

Triage and Remediation

Remediation

Sure, here are the step-by-step instructions to remediate the “Cloud Monitoring Should Monitor Dropped Bytes Count For Firewall” misconfiguration for GCP using the GCP console:

  1. Open the GCP Console and navigate to the Firewall rules page by selecting “Firewall” under the “VPC Network” section in the left-hand menu.

  2. Find the firewall rule that you want to monitor and click on its name to open its details page.

  3. Click on the “Logs” tab to view the firewall logs.

  4. In the logs, look for any entries related to dropped bytes. If you see any such entries, then your firewall is dropping traffic and you need to investigate further to determine whether this is expected behavior or not.

  5. To monitor dropped bytes count, you need to create a log-based metric. Click on the “Create Metric” button to create a new metric.

  6. Give your metric a name and a description. For example, you can name it “Dropped Bytes Count” and give it a description like “Number of bytes dropped by the firewall”.

  7. Under the “Filter” section, enter the following filter expression:

    resource.type="gce_subnetwork"
    log_name="projects/[PROJECT_ID]/logs/compute.googleapis.com%2Ffirewall"
    protoPayload.rule_details.action="DENY"
    

    Replace [PROJECT_ID] with your actual GCP project ID.

  8. Set the metric aggregation to “Sum” and the metric unit to “By”.

  9. Click on the “Create Metric” button to create the new metric.

  10. Now that you have created the metric, you can create a Cloud Monitoring alert based on it. Click on the “Create Alerting Policy” button to create a new alerting policy.

  11. Give your alerting policy a name and a description.

  12. Under the “Condition” section, select your newly created “Dropped Bytes Count” metric.

  13. Set the threshold and duration for the alert. For example, you can set the threshold to “10” and the duration to “5 minutes”.

  14. Under the “Notification” section, select the notification channels where you want to receive alerts.

  15. Click on the “Save” button to create the new alerting policy.

That’s it! You have now remediated the “Cloud Monitoring Should Monitor Dropped Bytes Count For Firewall” misconfiguration for GCP using the GCP console.

Additional Reading: