More Info:
Compute instances should have monitoring enabled. Without monitoring, performance degradation, security incidents, and resource exhaustion go undetected until service impact occurs.Risk Level
MediumAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- 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)
- 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 SP 800-171
- NYDFS 23 NYCRR 500
- Reserve Bank of India (RBI) Master Direction – Information Technology 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 step‑by‑step instructions to enable OCI Compute Monitoring from the OCI Console for both:
Following these steps will remediate the “OCI Compute Instances Should Have Monitoring Enabled” finding via the OCI Console.
- New instances (at creation time)
- Existing instances (after they are already running)
1. Prerequisite: IAM Policy for Monitoring
Before enabling instance monitoring, make sure the Monitoring and Metrics services are allowed to write metrics into your compartment:-
In the OCI Console, open the navigation menu and go to:
Identity & Security → Policies - Choose the compartment where you want to store metrics (often the root compartment).
- Click Create Policy.
-
Give it a name (e.g.,
allow-monitoring-write-metrics) and description. -
Under Policy Builder, choose Show manual editor and add something like:
- Click Create.
<compartment-name> with the actual compartment where metrics will be stored.2. Enable Monitoring for a New Compute Instance
- In the OCI Console, open the navigation menu:
Core Infrastructure → Compute → Instances. - Click Create instance.
- Fill out the basic details (name, compartment, image, shape, network, etc.).
- Scroll down to the Placement and hardware or Additional configuration section (label may vary slightly by region/console version).
- Find the Monitoring or Instance Monitoring subsection.
- Check/enable the option such as:
- Enable monitoring, or
- Collect metrics for monitoring, or
- Enable compute instance monitoring.
- If prompted, select:
- Metrics compartment – choose the compartment where metrics should be stored (the one covered by your policy).
- Complete the rest of the instance configuration and click Create.
3. Enable Monitoring on an Existing Compute Instance
- In the OCI Console, open:
Core Infrastructure → Compute → Instances. - Select the compartment where the instance resides.
- Click the instance name to open the Instance details page.
- Look for a section or tab related to Monitoring or Oracle Cloud Agent:
- Sometimes this is under Resources → Oracle Cloud Agent,
- Or a Monitoring panel on the instance details page.
- If you see that monitoring is Disabled or that the Monitoring plugin is disabled:
- Click Manage plugins / Edit Oracle Cloud Agent configuration / Edit (wording varies slightly).
- Ensure the plugin named Compute Instance Monitoring (or similar) is Enabled.
- Save/Apply the changes.
- Click Edit (top right of the instance details page).
- Find the Monitoring option.
- Check Enable monitoring (or equivalent).
- Choose the Metrics compartment if prompted.
- Click Save changes.
4. Verify That Monitoring Is Working
- In the Console, go to:
Observability & Management → Metrics Explorer. - Select:
- Compartment: the one you configured for metrics.
- Namespace: something like
oci_computeagentor similar.
- Choose a metric such as:
CpuUtilizationMemoryUtilization(if supported by the plugin)DiskUtilization
- Set the Resource group or Instance OCID filter to your instance.
- Confirm that metrics are being displayed over time.
Following these steps will remediate the “OCI Compute Instances Should Have Monitoring Enabled” finding via the OCI Console.
Using CLI
Using CLI
You remediate this by updating each instance’s Oracle Cloud Agent configuration so that monitoring is enabled.Below is a minimal, step‑by‑step using OCI CLI.
Look for:
If you already have other plugins configured, include them too in
Confirm:
This will remediate the “OCI Compute Instances Should Have Monitoring Enabled” finding using OCI CLI.
1. Prerequisites
- OCI CLI installed and configured (
oci setup config) - OCID of the instance you want to fix
(you can list instances with:
oci compute instance list --compartment-id <compartment_ocid>)
2. Check current monitoring status for an instance
isMonitoringDisabledpluginsConfig(especiallyCompute Instance Monitoring)
3. Enable instance monitoring (basic flag)
If monitoring is just disabled at the agent level:4. Explicitly enable the “Compute Instance Monitoring” plugin
To be explicit and ensure the plugin is ON:pluginsConfig rather than overwriting.5. Verify monitoring is enabled
isMonitoringDisabledisfalse- Plugin
Compute Instance MonitoringhasdesiredState=ENABLED
6. (Optional) Script for all instances in a compartment
Using Python
Using Python
To remediate “OCI Compute Instances Should Have Monitoring Enabled” using Python, you need to ensure the Oracle Cloud Agent monitoring plugin is enabled on each instance by updating its
This explicitly turns monitoring ON for that instance.
agentConfig.Below is a step‑by‑step guide using the OCI Python SDK.1. Prerequisites
- Install the OCI Python SDK:
- Have an OCI config file (e.g.
~/.oci/config) with:
- Your IAM user/principal must have permissions like:
2. Enable Monitoring on a Single Instance
3. Remediate All Instances in a Compartment
This example finds all instances in a compartment and enables monitoring where it’s disabled.4. Notes / Validation
- After running, verify in the OCI Console:
- Go to Compute → Instances → [your instance] → Oracle Cloud Agent and confirm monitoring plugins are enabled.
- If the monitoring plugin was manually disabled inside the OS, you may also need to:
- Ensure
oracle-cloud-agentservice is installed and running on the instance OS.
- Ensure
Using Terraform
Using Terraform
terraform plan should show agent_config.is_monitoring_disabled changing from true (or null) to false for the oci_core_instance.THIS_INSTANCE resource, with no -/+ replacement indicator.
