More Info:
At least one active log group should exist in the compartment. Without log groups, the OCI Logging service cannot collect and store diagnostic and security logs.Risk Level
MediumAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- 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)
- FedRAMP
- 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 CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Cyber Security Framework
- Reserve Bank of India (RBI) Master Direction – Information Technology Framework
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are the steps to ensure OCI Logging has active log groups for Monitoring, using the OCI Console.
1. Verify Existing Log Groups
- Sign in to the OCI Console.
- In the left hamburger menu, go to
Observability & Management → Logging → Log groups. - Select the correct compartment (top-left of the page).
- Check if any Log groups exist and are in Active state.
- If none exist, proceed to create one.
2. Create a Log Group (if missing)
- On the Log groups page, click Create log group.
- Fill in:
- Name: e.g.
monitoring-log-group. - Description: optional.
- Compartment: choose the compartment where Monitoring resources reside.
- Name: e.g.
- Click Create.
Ensure the new log group status is Active.
3. Enable Logging for the Monitoring Service
- In the menu, go to
Observability & Management → Logging → Logs. - Make sure you’re in the same compartment and region as your Monitoring resources.
- Click Create custom log (or Enable service log, depending on the UI version):
- Log group: select the active log group you created (e.g.
monitoring-log-group). - Log name: e.g.
monitoring-service-log. - Log source / Resource: choose Service logs and then select the Monitoring service (and specific resource type if required).
- Log group: select the active log group you created (e.g.
- Configure any additional options (retention, filters) as needed.
- Click Create or Enable to activate the log.
4. Confirm Logs Are Active
- Still under Logging → Logs, verify:
- The log is listed.
- Status is Active.
- Optionally, generate some Monitoring activity (e.g., create/modify an alarm) and:
- Open the log.
- Use Search to confirm events are being recorded.
Using CLI
Using CLI
To fix “OCI Logging Should Have Active Log Groups” for Monitoring logs using the OCI CLI, you need to:
Capture the log group OCID from the output:If you already had one, just set:
If you don’t have any yet (likely), you create one explicitly:Notes:
Check that:
Once you have at least one
- Ensure there is at least one active log group in the target compartment.
- Enable service logs for Monitoring into that log group.
0. Prerequisites
- OCI CLI installed and configured (
oci setup config) - Values ready:
TENANCY_OCIDCOMPARTMENT_OCID(where you want the log group and logs)REGION(e.g.,us-ashburn-1)
1. Check if any active log groups already exist
- If you see a log group with
"lifecycle-state": "ACTIVE"you can reuse it. - Note its
id(log group OCID). If none exist, create one.
2. Create a log group (if none exists)
3. Enable Monitoring service logs in that log group
OCI Monitoring writes service logs under the Logging service. You enable a service log withoci logging log create using --source-service monitoring.3.1. Identify the log you want (region/compartment specific)
For basic Monitoring service activity logs, a common pattern is:source-service:monitoringsource-resource: usually the compartment or tenancy (for tenancy‑level logs)categoryandservice-logsdiffer by region/service version; a simple way is to list available service categories:
3.2. Create a Monitoring service log
Example: enable Monitoring service log at tenancy scope (replace with compartment if needed):categorymay vary by region/tenant (api,workrequests, etc.). Ifapifails, check documentation or UI for available categories for Monitoring in your region.- If you want logs scoped to a compartment instead of tenancy:
4. Verify the log is active
lifecycle-stateisACTIVEis-enabledistrue
5. (Optional) Enable additional Monitoring categories
If you need more than one category (e.g.,api, workrequests), repeat step 3.2 with another display-name and category.Once you have at least one
ACTIVE log group and at least one ENABLED Monitoring service log in it, the “OCI Logging Should Have Active Log Groups” finding for Monitoring should be remediated.Using Python
Using Python
Below is a minimal, step‑by‑step approach to ensure OCI Logging has at least one active log group, and to programmatically create and enable a log for Monitoring using Python.
1. Prerequisites
-
Install OCI Python SDK:
-
Ensure you have a valid OCI config file (usually
~/.oci/config) with:- tenancy
- user
- fingerprint
- key_file
- region
- A profile name (e.g.
DEFAULT).
- Have the Compartment OCID where you want to manage logs (often the root compartment or a specific app compartment).
2. Python: Ensure Active Log Group + Create Monitoring Log
This script:- Connects using OCI SDK.
- Checks if there is at least one ACTIVE log group in a given compartment.
- If none exists, creates one.
- Ensures a SERVICE log for the monitoring service is created and enabled in that log group.
3. Summary of Remediation Logic
- Identify compartment where Logging should be configured.
- Ensure at least one ACTIVE log group exists (create if not).
- Create and enable a Monitoring SERVICE log in that log group.
- This satisfies the requirement that “OCI Logging Should Have Active Log Groups” and that Monitoring is sending logs into them.
Using Terraform
Using Terraform
terraform plan should show one new oci_logging_log_group resource to be created (no changes or destroys to existing resources).
