More Info:

Ensure Cloud Monitoring monitors storage request counts.

Risk Level

Low

Address

Reliability

Compliance Standards

CBP

Triage and Remediation

Remediation

To remediate this misconfiguration in GCP using the GCP console, follow these steps:

  1. Go to the GCP console and select the project where the storage bucket is located.

  2. Click on the “Storage” option from the left-hand menu.

  3. Select the bucket that you want to monitor and click on the “Edit bucket details” button.

  4. Scroll down to the “Advanced settings” section and click on the “Logging” tab.

  5. Click on the “Configure logs” button.

  6. In the “Log sinks” section, click on the “Add sink” button.

  7. In the “Create sink” dialog box, give a name to the sink and select the “Cloud Storage bucket” option.

  8. Select the destination bucket where you want to store the logs.

  9. In the “Filter” section, add the following filter:

protoPayload.serviceName="storage.googleapis.com"
protoPayload.methodName="storage.objects.insert"

This filter will monitor the storage request counts for the selected bucket.

  1. Click on the “Create” button to create the sink.

  2. Go back to the bucket details page and click on the “Notifications” tab.

  3. Click on the “Add notification” button.

  4. Select the “Cloud Pub/Sub” option and create a new topic.

  5. Select the topic and set the desired notification settings.

  6. Click on the “Save” button to save the notification settings.

Now, the GCP console will monitor the storage request counts for the selected bucket and send notifications to the configured topic if any threshold is breached.

Additional Reading: