Ensure bucket logs access

Error: Bucket does not log access

Bridgecrew Policy ID: BC_GCP_GCS_3
Checkov Check ID: CKV_GCP_62
Severity: MEDIUM

Bucket does not log access

Description

Some resources require a record of who access them and when.

Fix - Buildtime

Terraform

  • Resource: google_storage_bucket
  • Argument: logging/log_bucket to specify a Bucket to store access log in.
resource "google_storage_bucket" "logging" {
  name     = "jgwloggingbucket"
  location = var.location
  uniform_bucket_level_access = true
+  logging {
+    log_bucket = "mylovelybucket"
+  }
}

Did this page help you?