Skip to main content

More Info:

Ensure Cloud Monitoring monitors storage authentication counts.

Risk Level

Medium

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • Cloudanix Best Practice
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “Cloud Monitoring Should Monitor Storage Authentication Counts” for GCP using GCP console, you can follow the below steps:
  1. Open the Google Cloud Console and navigate to the Cloud Storage page.
  2. Select the bucket that you want to monitor and click on the “Edit bucket details” button.
  3. In the “Edit bucket details” page, scroll down to the “Access control” section.
  4. Under the “Access control” section, you will see a list of all the users and groups that have access to the bucket.
  5. Click on the “Add members” button to add new members to the bucket.
  6. In the “Add members” dialog box, enter the email address of the user or group that you want to add to the bucket.
  7. Select the appropriate role for the user or group from the dropdown menu. For example, you can select “Storage Object Viewer” or “Storage Object Creator” depending on the level of access you want to grant.
  8. Click on the “Add” button to add the user or group to the bucket.
  9. Repeat steps 6-8 for all the users and groups that need access to the bucket.
  10. Once you have added all the necessary users and groups, click on the “Save” button to save the changes.
By following the above steps, you will be able to remediate the misconfiguration “Cloud Monitoring Should Monitor Storage Authentication Counts” for GCP using GCP console.

To remediate the misconfiguration “Cloud Monitoring Should Monitor Storage Authentication Counts” for GCP using GCP CLI, follow the below steps:
  1. Open the Cloud Shell in GCP Console.
  2. Run the following command to enable the Cloud Storage API:
  1. Run the following command to create a Pub/Sub topic to store the audit logs:
  1. Run the following command to grant the Cloud Storage service account permission to publish messages to the Pub/Sub topic:
Note: Replace [TOPIC_NAME], [PROJECT_ID], and [SERVICE_ACCOUNT_EMAIL] with the appropriate values.
  1. Run the following command to create a sink to export Cloud Storage audit logs to the Pub/Sub topic:
Note: Replace [SINK_NAME], [PROJECT_ID], and [TOPIC_NAME] with the appropriate values.
  1. Run the following command to update the Cloud Storage bucket to export audit logs to the sink:
Note: Replace [BUCKET_NAME] and [SINK_NAME] with the appropriate values.
  1. Verify that the sink is exporting audit logs to the Pub/Sub topic by checking the topic subscription:
Note: Replace [PROJECT_ID] and [SUBSCRIPTION_NAME] with the appropriate values.By following the above steps, you can remediate the misconfiguration “Cloud Monitoring Should Monitor Storage Authentication Counts” for GCP using GCP CLI.
To remediate the issue of monitoring storage authentication counts in GCP using Python, follow these steps:
  1. Install the required libraries: Use the following command to install the required libraries:
  1. Set up authentication: Use the following code to authenticate your GCP account:
  1. Create a Storage client: Use the following code to create a Storage client:
  1. Get the bucket: Use the following code to get the bucket:
  1. Get the IAM policy: Use the following code to get the IAM policy:
  1. Update the IAM policy: Use the following code to update the IAM policy:
  1. Verify the IAM policy: Use the following code to verify the IAM policy:
These steps will remediate the issue of monitoring storage authentication counts in GCP using Python.
This change does not force replacement of any existing GCS buckets; it only creates/updates a Cloud Monitoring alert policy.To verify, terraform plan should show this google_monitoring_alert_policy.storage_authentication_counts being created (or its condition updated) with the metric.type="storage.googleapis.com/authentication/authentication_count" filter and your chosen threshold_value.

Additional Reading: