Ensure OCI Compute Instance has monitoring enabled

Error: OCI Compute Instance has monitoring disabled
Bridgecrew Policy ID: BC_OCI_LOGGING_1
Checkov Check ID: CKV_OCI_6
Severity: HIGH

OCI Compute Instance has monitoring disabled

Description

This policy identifies the OCI Compute Instances that are configured with Monitoring disabled. It is recommended that Compute Instances should be configured with monitoring is enabled following security best practices.

Fix - Runtime

OCI Console

  1. Login to the OCI Console
  2. Type the resource reported in the alert into the Search box at the top of the Console.
  3. Click the resource reported in the alert from the Resources submenu
  4. Under Resources, click Metrics.
  5. Click Enable monitoring. (If monitoring is not enabled (and the instance uses a supported image), then a button is available to enable monitoring.)

FMI : https://docs.cloud.oracle.com/en-us/iaas/Content/Compute/Tasks/enablingmonitoring.htm#ExistingEnabling

Fix - Buildtime

Terraform

  • Resource: oci_core_instance
  • Arguments: agent_config.is_monitoring_disabled
resource "oci_core_instance" "pass" {
  ...
  agent_config {
    ...
    is_monitoring_disabled   = false
   ....
}