Cloud Storage Bucket Versioning Disabled

  • Query id: e7e961ac-d17e-4413-84bc-8a1fbe242944
  • Query name: Cloud Storage Bucket Versioning Disabled
  • Platform: Terraform
  • Severity: Medium
  • Category: Observability
  • URL: Github

Description

Cloud Storage Bucket should have versioning enabled
Documentation

Code samples

Code samples with security vulnerabilities

Positive test num. 1 - tf file
resource "google_storage_bucket" "positive1" {
  name     = "foo"
  location = "EU"

  versioning = {
    enabled = false
  }
}

resource "google_storage_bucket" "positive2" {
  name     = "foo"
  location = "EU"
}

Code samples without security vulnerabilities

Negative test num. 1 - tf file
resource "google_storage_bucket" "negative1" {
  name     = "foo"
  location = "EU"

  versioning = {
    enabled = true
  }
}