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
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
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.
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.
1. Create / Verify a Vault and Customer-Managed Key
- In the OCI Console, open the hamburger menu → Identity & Security → Vault.
- Choose the correct Compartment.
- 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.
- Open the vault → go to Master Encryption Keys (or Keys depending on UI).
- 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.
- Name: e.g.,
- Note the OCID of the key; you’ll need this when creating the file system.
2. Create a New File System Encrypted with CMK
- Go to Menu → Storage → File Systems.
- Select the Compartment where the file system should live.
- Click Create file system.
- Fill in:
- Name and Compartment.
- Availability Domain matching the old file system (if applicable).
- Under Encryption (or KMS key):
- Choose Encrypt using Customer-Managed Key (wording may vary).
- Select the vault and KMS Key you created earlier.
- Configure Mount target / Export as needed (either use existing mount target or create a new one).
- Click Create.
3. Migrate Data from the Old File System
- On each client (host) that mounts the old file system:
- Mount the new CMK-encrypted file system at a temporary mount point.
- Use a file-level copy tool that preserves metadata, such as:
rsync -aHAX(Linux), orcp -a/ backup tools that preserve perm/ownership/ACLs as required.
- Verify data integrity and access on the new file system.
- Update application / system configs (e.g.,
/etc/fstabor scripts) to use the new file system exports. - 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
- In the Console, go to Cloud Guard (or Security Advisor depending on your tenancy).
- 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”.
- 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.
Using CLI
Using CLI
You can’t change an existing OCI File Storage file system from Oracle-managed keys to customer-managed keys in place. You must:
From the output, note:List keys and capture key OCID:
For each file system, check
Capture new file system OCID:
Get mount target OCID and IP:
Optionally delete unused mount targets once all exports are moved:
- create or identify a customer-managed KMS key
- create a new file system encrypted with that key
- migrate data and cut over
- delete the old file system
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)
2. Create / identify a customer-managed KMS key
2.1 Create a Vault (if needed)
id→VAULT_OCIDmanagement-endpoint→MGMT_ENDPOINT
2.2 Create a Key
3. Identify non-compliant file systems (Oracle-managed keys)
List file systems:kms-key-id in its details:- If
kms-key-idis null → encrypted with Oracle-managed keys (non-compliant). - If
kms-key-idis set → already CMEK-encrypted.
4. Create a new CMEK-encrypted file system
For each non-compliant file system, create a new one:5. Create mount target(s) and export for the new file system
5.1 Create a mount target
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:-
Mount old and new file systems via NFS (new using mount target IP and path
/my-fs-cmek): -
Copy data:
- Update application / fstab configurations to point to the new mount.
- Validate data and application access.
7. Decommission the non-compliant file system
Once fully cut over and validated:8. Ongoing: Ensure new file systems use CMEK
Enforce CMEK by:- Always specifying
--kms-key-id "$KMS_KEY_OCID"inoci fs file-system create. - Adding policy / automation (e.g., Cloud Guard + Functions) to detect file systems with
kms-key-id == nulland alert/remediate.
Using Python
Using Python
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).
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.
1. Prerequisites
-
Install the OCI Python SDK:
-
Configure your OCI CLI/config file (used by the SDK):
~/.oci/configwith at least: -
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_idattribute. - If
kms_key_idis not set or points to an Oracle-managed key rather than your CMK, you should set/update it to your Vault key usingUpdateFileSystemDetails.
- List all file systems in a compartment.
- Check whether
kms_key_idequals your required CMK OCID. - If not, call
update_file_systemto attach the CMK.
3. Python Script – Remediate All File Systems in a Compartment
4. How to Use This for Monitoring + Remediation
-
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.
- Run the script periodically with
-
Automated Remediation:
- Run the same script with
DRY_RUN = Falseon 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-familyin the compartment.USE key-familyon the Vault key.
- Run the same script with
5. Minimal IAM Policy Examples
In the compartment with file systems:Using Terraform
Using Terraform
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.
