More Info:
Ensures object versioning is enabled on storage buckets. Object versioning can help protect against the overwriting of objects or data loss in the event of a compromise.Risk Level
LowAddress
Operational Maturity, Reliability, SecurityCompliance 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
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Cyber Security Framework
- Reserve Bank of India (RBI) Master Direction – Information Technology Framework
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the “Bucket Versioning Should Be Enabled” misconfiguration in GCP using GCP console, follow these steps:
- Go to the GCP console and select the project where the misconfigured bucket is located.
- In the top navigation bar, click on the “Storage” option.
- Click on the name of the bucket that needs to be remediated.
- In the left-hand menu, click on the “Versions” option.
- Click on the “Enable versioning” button.
- A pop-up window will appear asking you to confirm that you want to enable versioning. Click on the “Enable” button.
- Once versioning is enabled, you will see a message confirming that versioning has been enabled for the bucket.
- You can now exit the GCP console.
Using CLI
Using CLI
To remediate the bucket versioning misconfiguration in GCP using GCP CLI, you can follow the below steps:Note: Replace [BUCKET_NAME] with the name of the bucket you want to enable versioning for.Note: Replace [BUCKET_NAME] with the name of the bucket you enabled versioning for.
- Open Cloud Shell from the GCP console.
- Run the following command to enable versioning for a specific bucket:
- Verify that versioning is enabled for the bucket by running the following command:
- The output of the above command should show “Enabled: True” indicating that versioning has been enabled for the bucket.
Using Python
Using Python
To remediate the “Bucket Versioning Should Be Enabled” misconfiguration in GCP using Python, you can follow these steps:This will enable versioning for the specified GCP bucket and ensure that all objects uploaded to the bucket have a unique version ID.
- Install the
google-cloud-storagelibrary using pip:
- Import the necessary modules:
- Initialize the client object:
- Get the bucket object:
- Enable versioning for the bucket:
- Verify that versioning is enabled:
Using Terraform
Using Terraform
versioning.enabled = true on an existing google_storage_bucket does not force bucket replacement; it is an in‑place change.To verify, terraform plan should show an in-place update (~ update in-place) for google_storage_bucket.TARGET_BUCKET with versioning.enabled changing from false (or null) to true.
