Other Articles

Cloud Storage – Enable Bucket Logging

This check ensures that Google Cloud Storage buckets have access logging enabled to track and audit bucket activity. Access logging helps identify unauthorized access, troubleshoot issues, and maintain compliance.

Check Details

  • Resource: Storage
  • Check: Enable access logging for buckets
  • Risk: Without access logging, bucket activity cannot be tracked or audited, increasing the risk of undetected unauthorized access.

Remediation via Google Cloud Console

  1. Log in to the Google Cloud Console and navigate to Buckets. GCP Storage browser
  2. Click on the name of the affected Cloud Storage bucket.
  3. Go to the Edit bucket tab. GCP Edit Storage Bucket
  4. Locate the Logging section and click Enable. GCP Enable Storage Bucket
  5. Select or create a destination bucket to store the logs.
    ⚠️ The destination bucket must be writable and should not have logging enabled to avoid log loops.
  6. Click Save to apply the changes.

Remediation via Google Cloud CLI

  1. Open the Google Cloud Console and launch Cloud Shell. GCP Cloud Shell
  2. Enable access logging for the bucket:
    
    gsutil logging set on -b gs://<DESTINATION_BUCKET_NAME> gs://<SOURCE_BUCKET_NAME>
    
    
    Replace <SOURCE_BUCKET_NAME> with the bucket to monitor and <DESTINATION_BUCKET_NAME> with the bucket to store logs.

Default Value

By default, access logging is disabled for Google Cloud Storage buckets.