More Info:
Log data should be encrypted with customer-managed KMS keys. Encrypting logs protects sensitive information from unauthorized access if storage is compromised.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 AWS
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- GDPR
- HIPAA
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST
- 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
Below are the console-based steps to ensure OCI Logging (including Monitoring logs) is encrypted with a customer-managed KMS key.
1. Create / Identify a Vault and KMS Key
- In the OCI Console, open the navigation menu.
- Go to Governance & Administration → Security → Vault.
- Choose the compartment where you want the key to live.
- If you don’t have a vault yet:
- Click Create vault.
- Give it a name, select Type: Default (or as required), and Create.
- Wait until the vault is Active.
- Open the vault.
- Go to the Master Encryption Keys tab.
- Click Create key:
- Key type: Encrypt/Decrypt
- Name and description as needed (e.g.,
logging-monitoring-key). - Protection mode: HSM (typical) or as per your standards.
- Click Create key.
2. Add IAM Policies So Logging Can Use the Key
- Go to Identity & Security → Policies.
- Choose the compartment where you want to define the policy (often tenancy root or the compartment of the logs).
- Click Create Policy (or edit an existing one).
-
Add statements like (adjust compartment/tenancy as needed):
Or limit to a specific compartment:
- Save the policy.
3. Configure Log Group Encryption With Your KMS Key
Monitoring service logs are stored in Log Groups in OCI Logging, and encryption is set at the log group level.- Go to Observability & Management → Logging → Log Groups.
- In the left, select the compartment where your Monitoring logs’ Log Group resides (or where you will create it).
-
Either:
- Use existing Log Group that contains Monitoring logs, or
- Click Create log group (e.g., name:
monitoring-logs-group) to isolate Monitoring logs.
- Select the log group.
- In the log group details page, find Encryption (or Encryption Key).
-
Click Edit / Update:
- Choose Encrypt using Customer-Managed Key (CMK).
- Select the Vault and then the Key you created earlier.
- Save / Update.
4. Ensure Monitoring Is Sending Logs to That Encrypted Log Group
- Go to Observability & Management → Logging → Logs.
- Filter by the compartment and Log Group you just configured.
- For each Monitoring log (e.g., service logs or custom logs from Monitoring):
- Ensure the Log Group selected is the one encrypted with your CMK.
- If needed, recreate or modify the log to use that encrypted log group.
5. Re-check Compliance
- Verify in Log Group Details that Encryption shows your Customer-Managed Key.
- Confirm Monitoring logs you care about are in that log group.
Using CLI
Using CLI
Below is how to remediate “OCI Logging Logs Should Be Encrypted With KMS Keys” for Logging (including Monitoring service logs) using the OCI CLI.The key point: encryption is configured on the Log Group, not per individual log. So you must attach a KMS key to the log group that contains your Monitoring logs.
Pick a vault OCID from the output: From the output, capture the
If you need to update it, put the JSON into a file
Identify the log group that contains your Monitoring service logs (often by Look for logs where:
This sets the KMS key for all logs in that log group (including Monitoring service logs).
Expected output: your
1. Prerequisites
- OCI CLI installed and configured (
oci setup configdone). - You know:
- Your tenancy OCID
- Target compartment OCID where the log group lives
- You have permission to:
- Use / manage KMS keys
- Manage Log Groups
2. Create or Identify a KMS Key
If you already have an appropriate KMS key, skip to step 3.2.1. Find the KMS Vault
ocid1.vault.oc1...2.2. Create a New KMS Key
id field → this is your KMS key OCID:
<KMS_KEY_OCID>3. Ensure KMS Key Policy Allows Logging Service
Get the current key policy:<KMS_MANAGEMENT_ENDPOINT> looks like:
https://management.kms.<region>.oraclecloud.comYour key policy must allow the Logging service principal, for example:key_policy.json and run:4. Find the Log Group for Monitoring Logs
List log groups in the compartment:display-name).Capture its OCID: <LOG_GROUP_OCID>If you’re unsure which log group:source-serviceordisplay-nameclearly indicate Monitoring.
5. Attach the KMS Key to the Log Group
Update the log group to use your KMS key:6. Verify Encryption Is Using KMS Key
Describe the log group:<KMS_KEY_OCID> (not empty or null).Optional: verify a specific Monitoring log is in that group:7. Apply to All Relevant Log Groups
Repeat steps 4–6 for each log group that holds logs you want encrypted with KMS (not just Monitoring).If you’d like, I can help you craft a small shell script to automatically attach the same KMS key to all log groups in a compartment.Using Python
Using Python
To encrypt OCI Logging logs (including Monitoring service logs) with a customer-managed KMS key using Python, you need to:
Use the printed
Once this is applied:
If this prints the
- Create or identify a KMS key
- Update the relevant Log Group(s) to use that KMS key
1. Prerequisites
- OCI Python SDK installed:
- A config file at
~/.oci/config(or equivalent) with:- tenancy, user, fingerprint, key_file, region, etc.
- OCIDs you need:
log_group_id(for the log group where Monitoring logs are stored)kms_key_id(OCID of the KMS key you want to use)
key.id as kms_key_id below.2. Update an Existing Log Group to Use the KMS Key
Encrypting logs in OCI Logging is done at the log group level by setting thekmsKeyId on the log group.- All new data written to logs in this log group (including Monitoring service logs routed there) will be encrypted with the specified KMS key.
- Existing encrypted data (if any) remains under its previous key; OCI does not retroactively re-encrypt old data.
3. Verifying
Use the SDK or Console to confirm:kms_key_id you set, the log group is now using a customer-managed KMS key for encryption.Using Terraform
Using Terraform
kms_key_id on oci_logging_log_group is an in-place update and does not force replacement of the log group.To verify, terraform plan should show an update to the existing oci_logging_log_group with kms_key_id changing from null (or the old key OCID) to the specified var.KMS_KEY_OCID.
