More Info:
Object Storage bucket versioning should be enabled. Versioning protects data against accidental deletion, application failures, and malicious encryption (like ransomware) by preserving previous object states securelyRisk Level
MediumAddress
Compliance, 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
- HIPAA
- 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
- 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 “OCI Storage Buckets Should Have Versioning Enabled” using the OCI Console:
-
Sign in to OCI Console
Log in to the OCI Console with an account that has permissions to manage Object Storage buckets. -
Go to Object Storage
- Open the hamburger menu (☰) in the top-left.
- Navigate to: Storage → Buckets (under “Object Storage & Archive Storage”).
-
Select the Correct Compartment
- In the left-side Compartment selector, choose the compartment that contains the non‑compliant bucket(s).
-
Open the Target Bucket
- Locate the bucket that needs versioning.
- Click the bucket Name to open its details page.
-
Edit Bucket Properties
- On the bucket details page, click Edit (or Edit bucket).
-
Enable Versioning
- Find the Versioning section.
- Set Versioning to Enabled (or select Enable object versioning).
- Review any warning about impact (e.g., additional storage costs for multiple versions).
-
Save Changes
- Click Save changes (or Update).
-
Validate
- After saving, confirm on the bucket details page that Versioning: Enabled is shown.
- If your security/monitoring control is via Cloud Guard or Security Zones, wait for the next evaluation cycle and verify the problem is cleared in:
- Cloud Guard → Targets / Problems, or
- Security Zones → Violations, depending on your setup.
-
Repeat for Other Buckets
- Repeat steps 3–8 for all buckets that must comply with the “Versioning Enabled” requirement in the monitored compartments/tenancies.
Using CLI
Using CLI
Below are step‑by‑step OCI CLI instructions to enable versioning on Object Storage buckets.Assumptions:
Output will look like:Note the value (e.g.,
From the output, note the
If it returns
It should now output:
This will remediate the “OCI Storage Buckets Should Have Versioning Enabled” finding via OCI CLI.
- You already have
ociCLI installed and configured (oci setup config). - You know your compartment OCID and namespace (or can retrieve them).
1. Get the Object Storage namespace
my_namespace).2. List buckets in a compartment (optional, to find targets)
name of each bucket you need to fix.3. Check current versioning status for a bucket
Disabled or empty, versioning is not enabled.4. Enable versioning for a single bucket
5. Verify versioning is enabled
6. (Optional) Bulk‑enable versioning on all buckets in a compartment
Using Python
Using Python
Below are step‑by‑step instructions and a Python example to detect and remediate OCI Object Storage buckets that do not have versioning enabled.
This setup continuously monitors and remediates the “versioning disabled” misconfiguration on OCI Object Storage buckets using Python.
1. Prerequisites
-
Install OCI Python SDK
-
Configure OCI credentials (one of):
~/.oci/configfile with a profile (e.g.,DEFAULT), or- Instance principal / resource principal in OCI (for running on OCI compute / functions).
~/.oci/config:
2. Concept
- Versioning status is set at the bucket level.
- API:
ObjectStorageClient.update_bucketwithUpdateBucketDetails.versioning="Enabled".
- List all buckets in a compartment.
- Check each bucket’s versioning status.
- For those not
"Enabled", callupdate_bucketto enable it. - Wrap this in a script that can be used for periodic monitoring/remediation.
3. Python Script: Detect & Remediate Bucket Versioning
4. How to Use for Monitoring
- Run this script on a schedule (e.g., cron, OCI Functions + OCI Events) to:
- Log buckets and their versioning status (monitoring).
- Automatically remediate any non‑compliant bucket (enable versioning).
Using Terraform
Using Terraform
versioning on an existing oci_objectstorage_bucket is an in‑place update in OCI and does not force bucket replacement.After updating your configuration, terraform plan should show a single in‑place update (~ on oci_objectstorage_bucket.MONITORED_BUCKET) changing versioning from "Disabled" (or null) to "Enabled".
