Skip to main content

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

Medium

Address

Compliance, Security

Compliance 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

Using Console

Below are step‑by‑step instructions to enable OCI Compute Monitoring from the OCI Console for both:
  1. New instances (at creation time)
  2. Existing instances (after they are already running)
I’ll also include the needed IAM policy.

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:
  1. In the OCI Console, open the navigation menu and go to:
    Identity & Security → Policies
  2. Choose the compartment where you want to store metrics (often the root compartment).
  3. Click Create Policy.
  4. Give it a name (e.g., allow-monitoring-write-metrics) and description.
  5. Under Policy Builder, choose Show manual editor and add something like:
  6. Click Create.
Replace <compartment-name> with the actual compartment where metrics will be stored.

2. Enable Monitoring for a New Compute Instance

  1. In the OCI Console, open the navigation menu:
    Core Infrastructure → Compute → Instances.
  2. Click Create instance.
  3. Fill out the basic details (name, compartment, image, shape, network, etc.).
  4. Scroll down to the Placement and hardware or Additional configuration section (label may vary slightly by region/console version).
  5. Find the Monitoring or Instance Monitoring subsection.
  6. Check/enable the option such as:
    • Enable monitoring, or
    • Collect metrics for monitoring, or
    • Enable compute instance monitoring.
  7. If prompted, select:
    • Metrics compartment – choose the compartment where metrics should be stored (the one covered by your policy).
  8. Complete the rest of the instance configuration and click Create.
This ensures monitoring is enabled from the start.

3. Enable Monitoring on an Existing Compute Instance

  1. In the OCI Console, open:
    Core Infrastructure → Compute → Instances.
  2. Select the compartment where the instance resides.
  3. Click the instance name to open the Instance details page.
  4. 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.
  5. 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.
If there is a separate toggle for Enable compute instance monitoring directly on the instance:
  1. Click Edit (top right of the instance details page).
  2. Find the Monitoring option.
  3. Check Enable monitoring (or equivalent).
  4. Choose the Metrics compartment if prompted.
  5. Click Save changes.

4. Verify That Monitoring Is Working

  1. In the Console, go to:
    Observability & Management → Metrics Explorer.
  2. Select:
    • Compartment: the one you configured for metrics.
    • Namespace: something like oci_computeagent or similar.
  3. Choose a metric such as:
    • CpuUtilization
    • MemoryUtilization (if supported by the plugin)
    • DiskUtilization
  4. Set the Resource group or Instance OCID filter to your instance.
  5. 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.
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.

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

Look for:
  • isMonitoringDisabled
  • pluginsConfig (especially Compute 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:
If you already have other plugins configured, include them too in pluginsConfig rather than overwriting.

5. Verify monitoring is enabled

Confirm:
  • isMonitoringDisabled is false
  • Plugin Compute Instance Monitoring has desiredState = ENABLED

6. (Optional) Script for all instances in a compartment

This will remediate the “OCI Compute Instances Should Have Monitoring Enabled” finding using OCI CLI.
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 agentConfig.Below is a step‑by‑step guide using the OCI Python SDK.

1. Prerequisites

  1. Install the OCI Python SDK:
  1. Have an OCI config file (e.g. ~/.oci/config) with:
  1. Your IAM user/principal must have permissions like:

2. Enable Monitoring on a Single Instance

This explicitly turns monitoring ON for that 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-agent service is installed and running on the instance OS.
If you tell me your tenancy/compartment layout (e.g., need to run this across tenancy or by tag), I can adjust the script accordingly.
This change is an in-place update of the instance’s agent configuration and does not force replacement of the instance.Verification: 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.