More Info:
Block volumes should be encrypted with customer-managed keys (CMK). Volumes using only Oracle-managed encryption do not provide customer control over key lifecycle and access auditing.Risk Level
HighAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Startup Security Baseline
- 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)
- GDPR
- HIPAA
- ISO 27001
- 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
- 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
To use customer‑managed keys (CMKs) for OCI Compute block volumes via the Console, you need to:
- Create a customer‑managed key in OCI Vault
- Apply that key to new and existing block/boot volumes used by Compute
1. Create a customer‑managed key
- In the OCI Console, open the navigation menu → Identity & Security → Vault.
- Choose the correct compartment.
- Click Create vault (if you don’t already have one):
- Name: e.g.
block-vol-vault - Type: typically Default (or as per your org’s standards)
- Compartment: choose the same or a shared security compartment
- Click Create vault.
- Name: e.g.
- Once the vault is active, click the vault name.
- Go to the Keys tab → Create key:
- Name: e.g.
block-volume-cmk - Protection mode: HSM (or Software as per policy)
- Key shape: e.g. AES 256‑bit
- Click Create key.
- Name: e.g.
2. Set default customer‑managed key for Block Volumes (recommended)
This ensures newly created block volumes in that compartment use your CMK by default.- Navigation menu → Storage → Block Storage.
- In the left pane, click Block Volume Settings (or Block Storage Settings, name may vary by region/tenancy).
- Select the compartment where your Compute instances/volumes live.
- Under Encryption, set:
- Default encryption key type: Customer-managed key (Vault).
- Select your Vault and Key (
block-volume-cmk).
- Click Save changes.
3. Apply CMK to existing block volumes
For each existing block volume:- Navigation menu → Storage → Block Storage → Block Volumes.
- Ensure you’re in the correct compartment.
- Click the block volume you want to fix.
- On the volume details page, look for Encryption / KMS key section.
- Click Change encryption key or Assign KMS key (wording can vary):
- Choose Customer-managed key.
- Select the Vault and the Key you created.
- Confirm the change.
- From the volume details page, click Create backup.
- After backup completes, click Restore backup:
- In the restore dialog, pick the customer‑managed key under encryption.
- Restore as a new block volume.
- Detach the old volume from your instance and attach the new, CMK‑encrypted volume.
4. Apply CMK to boot volumes (Compute instances)
For existing instances:- Navigation menu → Compute → Instances.
- Select the instance, go to the Boot volume section → click the boot volume name.
- On the boot volume details page:
- If available, click Change encryption key / Assign KMS key and select your CMK.
- If not available, use backup/restore:
- Click Create backup on the boot volume.
- After backup completes, click Restore backup:
- Choose the customer‑managed key.
- Restore to a new boot volume.
- Stop the instance, detach old boot volume, attach new CMK‑encrypted boot volume as the boot volume, and start the instance.
5. Validate in your monitoring / compliance tool
- After changing keys, wait for your OCI Compute Monitoring / security posture tool to rescan.
- Confirm that all block and boot volumes now show:
- Encryption: Enabled
- Key type: Customer-managed (Vault) with your CMK.
Using CLI
Using CLI
To meet the control “OCI Compute Block Volumes Should Be Encrypted With Customer-Managed Keys” you must:
From the vault JSON, note:From the output, note:
Note:From the output, capture the backup OCID:Wait until backup is finished:From the output, capture:Wait until the new volume is
Then detach:You may want to:Adjust device path and attachment type (
If you use Terraform/Resource Manager, CI/CD, or scripts, add
If you share:
- Have a Vault and Customer-Managed Key (CMK) in OCI Vault.
- Re-create non-compliant block volumes using that CMK (you cannot change the key of an existing volume in-place).
- Ensure any new volumes use the CMK.
1. Prerequisites
Make sure:- OCI CLI is installed and configured with appropriate permissions.
- You know:
- The compartment OCID where volumes and vaults reside.
- The availability domain of your compute instance/volumes.
- The volume OCIDs that are not using CMK.
- The subnet/shape etc. if you need to create a new instance or reattach volumes.
2. Create / Identify a Vault and CMK
2.1 Create a Vault (if you don’t already have one)
id(vault OCID)management-endpoint
2.2 Create a Master Encryption Key
id→ this is your--kms-key-id.
3. Recreate Each Non-Compliant Block Volume Using the CMK
You cannot change encryption key on an existing volume directly. The standard pattern is:- Create a backup of the existing volume.
- Create a new volume from that backup, specifying
--kms-key-id. - Detach the old volume from the instance.
- Attach the new CMK-encrypted volume.
- (Optionally) delete the old volume after verification.
3.1 Identify the Volume
availabilityDomainsizeInGBscompartmentId
3.2 Create a Backup of the Existing Volume
3.3 Create a New Volume from the Backup with CMK
AVAILABLE:4. Swap the Volume on the Compute Instance
4.1 Detach the Old Volume
List current volume attachments (to find attachment OCID):- Stop the instance or unmount the filesystem in the OS before detaching (OS-level step, not via CLI), to avoid corruption.
4.2 Attach the New CMK-Encrypted Volume
attach-iscsi-volume vs attach-paravirtualized-volume) as appropriate for your environment.Inside the OS, mount the new volume and verify data.4.3 (Optional) Delete the Old Volume and Backup
After verifying:5. Ensure All New Volumes Use the CMK
When creating new block volumes (manually or via automation), always specify your CMK:kms-key-id in those definitions as well.If you share:
- Example volume OCID(s), and
- The compartment / AD details (redacted as needed),
Using Python
Using Python
In OCI you cannot switch an existing block volume from Oracle-managed encryption to a customer-managed key (CMK). Remediation is:
You then need to:
If your “OCI Compute Monitoring” is a separate Python-based compliance scanner, integrate:
- Create/identify a customer-managed key in OCI Vault.
- For existing volumes:
- Take a backup.
- Create a new volume from that backup using the CMK.
- Attach the new volume, sync data if needed, then detach/delete the old one.
- For new volumes: always create them with the CMK.
1. Prerequisites
~/.oci/config must be set (or use instance principal).Python imports:2. Identify a Customer-Managed Key
You need the OCID of the KMS key (not vault) in the same region as your volumes. Example:3. Find Non‑Compliant Block Volumes
4. Remediate an Existing Volume (Backup → New Volume with CMK)
You must:- Create a backup of the existing volume.
- Create a new volume from that backup with
kms_key_idset. - Re-attach and migrate if necessary.
- Delete the old volume when safe.
- Stop the instance (if boot volume) or unmount filesystem (for data volume).
- Detach the old volume and attach the new one.
- For a boot volume of a compute instance, you typically create a custom image then launch a new instance. That flow is more involved; for data volumes this attach/detach is sufficient.
5. Remediate All Non‑Compliant Volumes
6. Ensure New Volumes Use CMK by Default
For any Python code that creates volumes, always providekms_key_id:If your “OCI Compute Monitoring” is a separate Python-based compliance scanner, integrate:
- The discovery function (
list_volumes_without_cmk). - Reporting (e.g., print/JSON list of non-compliant volumes).
- Optional auto-remediation using
migrate_volume_to_cmk, with safeguards (e.g., only for data volumes, maintenance window checks).
Using Terraform
Using Terraform
kms_key_id on an existing oci_core_volume or oci_core_instance.source_details is an in-place change in Terraform (no forced replacement), though encryption rekeying is irreversible once applied.Verification: terraform plan should show an in-place update adding or changing kms_key_id for the affected block volumes (and/or boot volumes), with no destroy/create of the volumes unless you are creating new ones.
