Skip to main content

More Info:

File Storage systems should utilize Customer-Managed Keys (CMKs) for encryption. This provides centralized, customer-controlled key lifecycle management and auditing for network-attached storage assets.

Risk Level

High

Address

Compliance, Security

Compliance 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

Using Console

For OCI File Storage, encryption key type is fixed at creation. You cannot switch an existing file system from Oracle-managed keys to customer-managed keys (CMK). Remediation therefore means: create a new CMK-backed file system and migrate data.Below are the step‑by‑step actions in the OCI Console.

1. Create / Verify a Vault and Customer-Managed Key

  1. In the OCI Console, open the hamburger menu → Identity & SecurityVault.
  2. Choose the correct Compartment.
  3. If you don’t have a vault:
    • Click Create vault.
    • Enter Name, choose Type (typically Default), select Compartment, then Create vault.
    • Wait until it becomes Active.
  4. Open the vault → go to Master Encryption Keys (or Keys depending on UI).
  5. Click Create key:
    • Name: e.g., fss-cmk-key.
    • Protection mode: typically HSM (or according to your policy).
    • Key shape: AES-256 (standard).
    • Click Create key.
  6. Note the OCID of the key; you’ll need this when creating the file system.

2. Create a New File System Encrypted with CMK

  1. Go to Menu → Storage → File Systems.
  2. Select the Compartment where the file system should live.
  3. Click Create file system.
  4. Fill in:
    • Name and Compartment.
    • Availability Domain matching the old file system (if applicable).
  5. Under Encryption (or KMS key):
    • Choose Encrypt using Customer-Managed Key (wording may vary).
    • Select the vault and KMS Key you created earlier.
  6. Configure Mount target / Export as needed (either use existing mount target or create a new one).
  7. Click Create.
This file system will now be encrypted with your customer-managed key.

3. Migrate Data from the Old File System

  1. On each client (host) that mounts the old file system:
    • Mount the new CMK-encrypted file system at a temporary mount point.
  2. Use a file-level copy tool that preserves metadata, such as:
    • rsync -aHAX (Linux), or
    • cp -a / backup tools that preserve perm/ownership/ACLs as required.
  3. Verify data integrity and access on the new file system.
  4. Update application / system configs (e.g., /etc/fstab or scripts) to use the new file system exports.
  5. Once all clients use the new file system and data is verified, unmount and decommission the old file system.

4. (Optional) Use Monitoring / Cloud Guard to Track Compliance

  1. In the Console, go to Cloud Guard (or Security Advisor depending on your tenancy).
  2. Ensure the detector recipe for Storage / File Systems includes the rule that checks for “OCI Storage File Systems should be encrypted with Customer-Managed Keys”.
  3. Confirm that the new file system no longer appears as non-compliant after the next evaluation cycle.

Because existing FSS encryption type cannot be changed, this “create new with CMK + migrate” pattern is the only way to fully remediate via the OCI Console.
You can’t change an existing OCI File Storage file system from Oracle-managed keys to customer-managed keys in place. You must:
  1. create or identify a customer-managed KMS key
  2. create a new file system encrypted with that key
  3. migrate data and cut over
  4. delete the old file system
Below are the essential OCI CLI steps.

1. Prerequisites

Make sure you have:
  • OCI CLI configured (oci setup config)
  • OCIDs for:
    • Compartment
    • VCN / subnet(s) for mount targets
  • Appropriate IAM permissions for:
    • Vault & keys
    • File Storage (FSS)
Set environment variables for convenience:

2. Create / identify a customer-managed KMS key

2.1 Create a Vault (if needed)

From the output, note:
  • idVAULT_OCID
  • management-endpointMGMT_ENDPOINT

2.2 Create a Key

List keys and capture key OCID:

3. Identify non-compliant file systems (Oracle-managed keys)

List file systems:
For each file system, check kms-key-id in its details:
  • If kms-key-id is null → encrypted with Oracle-managed keys (non-compliant).
  • If kms-key-id is set → already CMEK-encrypted.

4. Create a new CMEK-encrypted file system

For each non-compliant file system, create a new one:
Capture new file system OCID:

5. Create mount target(s) and export for the new file system

5.1 Create a mount target

Get mount target OCID and IP:

5.2 Create an export for the new file system


6. Migrate data (cutover)

On the compute instance(s) where the old file system is mounted:
  1. Mount old and new file systems via NFS (new using mount target IP and path /my-fs-cmek):
  2. Copy data:
  3. Update application / fstab configurations to point to the new mount.
  4. Validate data and application access.
(These steps are on the OS, not OCI CLI, but they are required for remediation.)

7. Decommission the non-compliant file system

Once fully cut over and validated:
Optionally delete unused mount targets once all exports are moved:

8. Ongoing: Ensure new file systems use CMEK

Enforce CMEK by:
  • Always specifying --kms-key-id "$KMS_KEY_OCID" in oci fs file-system create.
  • Adding policy / automation (e.g., Cloud Guard + Functions) to detect file systems with kms-key-id == null and alert/remediate.
Below is how to remediate this using Python and the OCI SDK so that all File Storage file systems use a customer-managed Vault key (CMK).

1. Prerequisites

  1. Install the OCI Python SDK:
  2. Configure your OCI CLI/config file (used by the SDK): ~/.oci/config with at least:
  3. Have or create a customer-managed key (KMS) in OCI Vault and note its OCID:
    • Go to: Identity & Security → Vault → Keys → create key (if needed).
    • Copy the Key OCID (e.g., ocid1.key.oc1..).

2. Concept

For OCI File Storage:
  • Each file system has kms_key_id attribute.
  • If kms_key_id is not set or points to an Oracle-managed key rather than your CMK, you should set/update it to your Vault key using UpdateFileSystemDetails.
You can:
  1. List all file systems in a compartment.
  2. Check whether kms_key_id equals your required CMK OCID.
  3. If not, call update_file_system to attach the CMK.

3. Python Script – Remediate All File Systems in a Compartment


4. How to Use This for Monitoring + Remediation

  1. Monitoring (Detection):
    • Run the script periodically with DRY_RUN = True (e.g., via cron, OCI Functions, or OCI DevOps job).
    • Log or alert on any file system where current_kms != TARGET_KMS_KEY_OCID.
  2. Automated Remediation:
    • Run the same script with DRY_RUN = False on a schedule or triggered by an event rule (e.g., when a new file system is created).
    • Ensure the principal running the script has:
      • MANAGE file-family in the compartment.
      • USE key-family on the Vault key.

5. Minimal IAM Policy Examples

In the compartment with file systems:
For the Vault/key:
You can now continuously monitor and remediate “OCI Storage File Systems Should Be Encrypted With Customer-Managed Keys” using this Python approach.
Changing or adding kms_key_id on an existing oci_file_storage_file_system forces replacement of the file system; this is a destructive change that requires data migration to the new file system before decommissioning the old one.For verification, terraform plan should show the oci_file_storage_file_system either being created (if new) or replaced with kms_key_id set to the CMK OCID instead of using the default Oracle-managed encryption.