More Info:
Buckets must be encrypted using a dedicated KMS key. Relying on default encryption limits auditing visibility and prevents security teams from enforcing granular key rotation or revocation policiesRisk Level
HighAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Well Architected Framework
- 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
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are step‑by‑step OCI Console instructions to remediate the finding “OCI Storage Buckets Should Be Encrypted With Customer‑Managed Keys” by moving an Object Storage bucket from Oracle‑managed keys to customer‑managed keys (CMK).
1. Prepare a Customer-Managed Key (if you don’t have one)
- Sign in to the OCI Console.
- From the left menu, go to Identity & Security → Vault.
- Make sure you are in the correct Compartment and Region.
- If you don’t already have a vault:
- Click Create vault.
- Enter a Name, choose Type (generally Default), select the Compartment, and click Create vault.
- Wait for the vault status to become Active.
- Inside the vault, create a key:
- Open the vault you just created.
- Click Master Encryption Keys (or Keys).
- Click Create key.
- Enter a Name and optional Description.
- Choose Key Shape (e.g., AES, 256‑bit).
- Click Create key and wait until it is Enabled/Active.
2. Update the Bucket to Use the Customer-Managed Key
- In the Console, go to Storage → Buckets.
- Select the correct Compartment in the left pane.
- Click on the bucket name that has the misconfiguration (currently using Oracle-managed encryption).
- On the bucket details page, click Edit (or Edit bucket).
- Find the Encryption section:
- By default, it is usually set to Encrypt using Oracle-managed keys.
- Change the encryption setting to:
- Encrypt using customer-managed keys.
- A Vault and Key selector will appear:
- Choose the Vault that contains your CMK.
- Choose the Key (customer-managed key) you created in step 1.
- Click Save changes (or Update).
3. (Optional) Verify via Security/Monitoring
If you’re using OCI Cloud Guard / Security Zones / other monitoring:- Open Cloud Guard (or your monitoring tool).
- Run or wait for the next Detector evaluation against Object Storage.
- Confirm that the finding for that bucket is now Resolved or no longer appears.
4. Repeat for All Affected Buckets
Repeat section 2 for every Object Storage bucket flagged by your monitoring as not using customer‑managed keys.Using CLI
Using CLI
To enforce “OCI Object Storage buckets must be encrypted with customer-managed keys” using the OCI CLI, you need to:
Note Capture the Repeat until it shows
Capture the
For each bucket, check if If this returns
To script across all buckets in a compartment:
You should see the
- Have a Vault and a Master Encryption Key.
- Update each bucket to use that key via
--kms-key-id.
1. Prerequisites
- OCI CLI installed and configured (
oci setup configalready done). - Permissions:
- To manage keys and vaults.
- To manage buckets in the compartments you care about.
- Tenancy OCID:
<TENANCY_OCID> - Compartment OCID for buckets:
<COMPARTMENT_OCID> - Region:
<REGION>
2. Create (or identify) a Vault and Key
2.1. List existing vaults (if you already have one, you can skip creation)
id of the vault you want to use, or create a new one.2.2. Create a new vault (if needed)
id from the output as VAULT_ID:2.3. Wait until vault is ACTIVE (if newly created)
ACTIVE.3. Create a Master Encryption Key
3.1. Get the vault’s management endpoint
3.2. Create a key
id of the key:4. Find Buckets That Are Not Using Customer-Managed Keys
List buckets in the compartment:kms-key-id is set:null or empty, the bucket is using Oracle-managed keys and is non‑compliant.5. Update Buckets to Use the Customer-Managed Key
For each non‑compliant bucket:6. Verify Compliance
Re-check each bucket:KMS_KEY_ID for all monitored buckets, confirming that they are now encrypted with your customer-managed key.Using Python
Using Python
Below is a concise, end‑to‑end approach to monitor OCI Object Storage buckets for encryption with customer-managed keys (CMKs) and remediate them using Python and the OCI SDK.
1. Prerequisites
-
Install OCI Python SDK
-
Configure OCI credentials (API key)
Run:This creates~/.oci/configwith a profile (e.g.,DEFAULT). -
Have a Vault and Key (CMK) created in OCI KMS
- Create a Vault and Key in the OCI console (or via CLI).
- Note the Key OCID:
ocid1.key.oc1....
-
Decide the scope
compartment_idwhere your buckets live.namespaceof Object Storage (usually 1 per tenancy/region).
2. Monitoring: Detect Buckets Not Using CMK
The logic:- List all buckets in a compartment.
- Get each bucket’s details.
- Check
kms_key_id; if empty, it’s not using a CMK.
3. Remediation: Attach Customer-Managed Key to Buckets
You can reconfigure bucket encryption by updating the bucket with your KMS Key OCID.Important:- OCI does server-side encryption by default with Oracle-managed keys.
- When you set
kms_key_id, new objects use the CMK; existing objects are gradually re-encrypted in the background by OCI.
4. Combining Monitoring + Remediation (Optional)
To explicitly show what’s changed:5. Integrating into Continuous Monitoring
- Run the monitoring/remediation script:
- On a schedule (OCI Functions + Events, or cron from a bastion/CI runner).
- In read-only mode (monitor only) for reporting.
- In remediation mode (update_bucket) in controlled environments.
- Detection of buckets not using customer-managed keys.
- Automatic remediation by attaching your CMK using Python.
Using Terraform
Using Terraform
kms_key_id on an existing oci_objectstorage_bucket is an in-place update in the OCI provider and should not force bucket replacement, but review the plan carefully in your environment.To verify, terraform plan should show:- A new
oci_kms_key.bucket_cmkcreated (if not existing already). - An in-place
updateonoci_objectstorage_bucket.secure_bucketsettingkms_key_idto the CMK ID.

