Skip to main content

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

High

Address

Compliance, Security

Compliance 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

Using Console

To use customer‑managed keys (CMKs) for OCI Compute block volumes via the Console, you need to:
  1. Create a customer‑managed key in OCI Vault
  2. Apply that key to new and existing block/boot volumes used by Compute

1. Create a customer‑managed key

  1. In the OCI Console, open the navigation menu → Identity & SecurityVault.
  2. Choose the correct compartment.
  3. 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.
  4. Once the vault is active, click the vault name.
  5. 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.
You now have a CMK that can be used for block volumes.
This ensures newly created block volumes in that compartment use your CMK by default.
  1. Navigation menu → StorageBlock Storage.
  2. In the left pane, click Block Volume Settings (or Block Storage Settings, name may vary by region/tenancy).
  3. Select the compartment where your Compute instances/volumes live.
  4. Under Encryption, set:
    • Default encryption key type: Customer-managed key (Vault).
    • Select your Vault and Key (block-volume-cmk).
  5. Click Save changes.
All new block volumes created in this compartment will now be encrypted with this CMK.

3. Apply CMK to existing block volumes

For each existing block volume:
  1. Navigation menu → StorageBlock StorageBlock Volumes.
  2. Ensure you’re in the correct compartment.
  3. Click the block volume you want to fix.
  4. On the volume details page, look for Encryption / KMS key section.
  5. Click Change encryption key or Assign KMS key (wording can vary):
    • Choose Customer-managed key.
    • Select the Vault and the Key you created.
  6. Confirm the change.
If the UI doesn’t show a direct “change key” option in your tenancy/region, use this fallback:
  1. From the volume details page, click Create backup.
  2. After backup completes, click Restore backup:
    • In the restore dialog, pick the customer‑managed key under encryption.
    • Restore as a new block volume.
  3. Detach the old volume from your instance and attach the new, CMK‑encrypted volume.
Repeat for all block volumes reported by your monitoring tool.

4. Apply CMK to boot volumes (Compute instances)

For existing instances:
  1. Navigation menu → ComputeInstances.
  2. Select the instance, go to the Boot volume section → click the boot volume name.
  3. 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:
      1. Click Create backup on the boot volume.
      2. After backup completes, click Restore backup:
        • Choose the customer‑managed key.
        • Restore to a new boot volume.
      3. 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

  1. After changing keys, wait for your OCI Compute Monitoring / security posture tool to rescan.
  2. Confirm that all block and boot volumes now show:
    • Encryption: Enabled
    • Key type: Customer-managed (Vault) with your CMK.
These steps remediate the misconfiguration using only the OCI Console.
To meet the control “OCI Compute Block Volumes Should Be Encrypted With Customer-Managed Keys” you must:
  1. Have a Vault and Customer-Managed Key (CMK) in OCI Vault.
  2. Re-create non-compliant block volumes using that CMK (you cannot change the key of an existing volume in-place).
  3. Ensure any new volumes use the CMK.
Below are step‑by‑step remediation steps using OCI CLI.

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)

From the vault JSON, note:
  • id (vault OCID)
  • management-endpoint

2.2 Create a Master Encryption Key

From the output, note:
  • id → this is your --kms-key-id.
You can also list existing keys:

3. Recreate Each Non-Compliant Block Volume Using the CMK

You cannot change encryption key on an existing volume directly. The standard pattern is:
  1. Create a backup of the existing volume.
  2. Create a new volume from that backup, specifying --kms-key-id.
  3. Detach the old volume from the instance.
  4. Attach the new CMK-encrypted volume.
  5. (Optionally) delete the old volume after verification.
Below steps per volume:

3.1 Identify the Volume

Note:
  • availabilityDomain
  • sizeInGBs
  • compartmentId

3.2 Create a Backup of the Existing Volume

From the output, capture the backup OCID:
Wait until backup is finished:

3.3 Create a New Volume from the Backup with CMK

From the output, capture:
Wait until the new volume is AVAILABLE:

4. Swap the Volume on the Compute Instance

4.1 Detach the Old Volume

List current volume attachments (to find attachment OCID):
Then detach:
You may want to:
  • 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

Adjust device path and attachment type (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:
If you use Terraform/Resource Manager, CI/CD, or scripts, add kms-key-id in those definitions as well.
If you share:
  • Example volume OCID(s), and
  • The compartment / AD details (redacted as needed),
I can give you CLI commands tailored exactly to those resources.
In OCI you cannot switch an existing block volume from Oracle-managed encryption to a customer-managed key (CMK). Remediation is:
  1. Create/identify a customer-managed key in OCI Vault.
  2. 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.
  3. For new volumes: always create them with the CMK.
Below is how to do this with Python using the OCI SDK.

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:
  1. Create a backup of the existing volume.
  2. Create a new volume from that backup with kms_key_id set.
  3. Re-attach and migrate if necessary.
  4. Delete the old volume when safe.
You then need to:
  • 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 provide kms_key_id:

If your “OCI Compute Monitoring” is a separate Python-based compliance scanner, integrate:
  1. The discovery function (list_volumes_without_cmk).
  2. Reporting (e.g., print/JSON list of non-compliant volumes).
  3. Optional auto-remediation using migrate_volume_to_cmk, with safeguards (e.g., only for data volumes, maintenance window checks).
Updating 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.