Ensure object versioning is enabled on Google Cloud Storage Buckets

LOW

Description

Object versioning is disabled on Google Cloud Storage Buckets.

Remediation

In GCP Console -

  1. Log into the GCP Console and go to Cloud Storage.
  2. Under Buckets, choose the bucket you wish to edit.
  3. Select the Protection tab.
  4. Under Object versioning, select Object Versioning Off.
  5. In the Turn on object versioning dialog, set lifecycle rules as needed and select Confirm.

In Terraform -

  1. In the google_storage_bucket resource, set the versioning.enabled field to true.
  2. Create or configure the lifecycle_rule block as needed.

References:
https://cloud.google.com/storage/docs/using-object-versioning
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket#nested_versioning
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket#nested_lifecycle_rule

Policy Details

Rule Reference ID: AC_GCP_0241
CSP: GCP
Remediation Available: Yes
Resource Category: Storage
Resource Type: Bucket

Frameworks