Skip to main content

More Info:

Monitor for anomalous GPU instance provisioning. Attackers frequently deploy high-cost, high-compute GPU instances for illicit cryptocurrency mining after compromising cloud accounts

Risk Level

Medium

Address

Compliance, Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • AWS Well Architected Framework
  • 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)
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

Below are concise, console‑only steps to configure an anomalous GPU usage alarm in OCI Monitoring.

1. Confirm GPU Metrics Are Available

  1. In OCI Console, open Observability & Management → Monitoring → Service Metrics.
  2. In Compartment, select the compartment where your GPU instances run.
  3. Set:
    • Metric namespace: oci_computeagent
    • Resource group: often gpu (or leave as “All” if unsure).
  4. In Metric name, look for GPU metrics such as:
    • GpuUtilization
    • GpuMemoryUtilization
    • GpuTemperature
  5. Select a metric and verify you see recent data points in the chart.
    If there is no data, ensure the Oracle Cloud Agent (Management Agent) with GPU plugins is enabled on the instance.

2. Create an Alarm for Anomalous GPU Usage

  1. Go to Observability & Management → Monitoring → Alarms.
  2. Click Create alarm.
Basic configuration:
  1. Name: e.g., gpu-anomaly-usage-alarm.
  2. Description: e.g., Alarm when GPU utilization behaves anomalously.
  3. Compartment: choose the compartment of the GPU metrics.
  4. Metric namespace: oci_computeagent.
  5. Resource group: gpu (or as confirmed in step 1).
Choose the metric and anomaly rule:
  1. Under Metric name, select GpuUtilization (or the specific GPU metric you want to monitor).
  2. For Dimensions, optionally scope to:
    • Specific instance: resourceId = <instance-OCID>
    • Or other relevant dimensions if needed.
  3. Under Trigger rule (Alarm condition), select:
    • Rule type: Anomaly (or Dynamic threshold / Anomaly detection if phrased that way in your tenancy).
  4. Configure anomaly condition:
    • Statistic: avg (or max depending on your policy).
    • Period: e.g., 1 minute or 5 minutes.
    • Anomaly model / Baseline: leave as Automatic unless you have specific training data.
    • Sensitivity: set to Medium (adjust later based on noise).

3. Set Alarm Threshold & Evaluation

  1. Configure when to fire:
    • Condition: e.g., Anomaly score > 0 or the UI’s default anomaly trigger (often “When metric is anomalous”).
    • Trigger delay / trigger after: e.g., 3 consecutive periods to avoid noise.
  2. Severity: choose (e.g., Critical or Warning as per your policy).

4. Configure Notifications

  1. Under Destination, select or create an OCI Notifications topic:
    • If needed, click Create topic and then add Subscriptions (email, Slack via HTTPS, PagerDuty, etc.) in Developer Services → Notifications.
  2. In the alarm:
    • Choose Notification topic: select the topic you created.
(Optionally, configure Repeat notification and Suppression windows if supported and needed.)

5. Finalize and Test

  1. Click Create alarm.
  2. Confirm the alarm appears in Alarms list with OK or FIRING state.
  3. To test:
    • Intentionally increase GPU load (e.g., run a GPU‑heavy workload) to cause anomalous behavior versus normal baseline.
    • Verify that the alarm transitions to FIRING and that you receive the notification.

This completes remediation: OCI Monitoring now has an anomalous GPU usage alarm configured through the OCI Console.
Below is a minimal, CLI‑only way to set up an “anomalous GPU usage” alarm in OCI Monitoring. I’ll assume Linux/macOS shell; on Windows, adjust quoting.

1. Prereqs

  1. Ensure the instance has GPU metrics published:
    • It must be a GPU shape.
    • Compute Instance Agent must be running (default on OCI images).
  2. Your OCI user must have policies like:
  3. OCI CLI configured:

2. Identify GPU Metric and Namespace

List available GPU metrics in the instance’s compartment:
Typical GPU utilization metric is under namespace oci_computeagent with a name like:
  • GpuUtilization or similar (use exactly what you see in the output).
Note the:
  • namespace (e.g., oci_computeagent)
  • metric name (e.g., GpuUtilization)
  • dimensions (e.g., resourceId, gpuIndex)

3. Create a Notification Topic (for the Alarm)

If you already have a topic OCID, skip to step 4.
Save the returned OCID as:
Optionally subscribe an email:
Then confirm the email.

4. Build an “Anomalous GPU Usage” Query

Two common ways (pick one):

4.1. Simple “High GPU Utilization” (practical anomaly proxy)

Example: GPU utilization > 90% for 5 minutes on any GPU in a compartment:
You can restrict to a specific instance:

4.2. If you want deviation from baseline (pseudo‑anomaly)

Some tenants use a rule like “> 2× the 1‑hour rolling average”. OCI Monitoring doesn’t yet have a native anomalyDetection() function generally available in all regions, so you usually approximate anomaly with a high threshold or derivative‑type rules. If your tenancy has advanced query features, adapt accordingly; otherwise use 4.1.

5. Create the Alarm via OCI CLI

Notes:
  • --namespace must match the namespace from step 2.
  • --query-text is the full alarm expression (no extra where/select syntax, just Monitoring query).
  • pending-duration is ISO‑8601 (e.g., PT5M = 5 minutes).

6. Update or Fix an Existing Alarm (if misconfigured)

List alarms:
Get the alarm OCID:
Update the query to the correct GPU anomaly condition:

If you paste your actual metric list output (for GPU) and your tenancy’s region, I can give you the exact QUERY_TEXT line you should use.
Below is a practical way to remediate this in OCI using Python by:
  1. Making sure GPU metrics are available.
  2. Creating a Monitoring Alarm that fires on anomalous GPU usage.

1. Ensure GPU metrics are available

  1. Use a GPU shape (e.g. VM.GPU3.1, BM.GPU4.8, etc.).
  2. Ensure the Oracle Cloud Agent is enabled on the instance.
    • In OCI Console:
      Compute → Instances → your instance → Oracle Cloud Agent → ensure it’s enabled and monitoring plugins are running.
  3. Confirm GPU metrics exist:
    • Monitoring → Metrics Explorer
    • Namespace: usually oci_computeagent
    • Look for metrics like GpuUtilization, GpuMemoryUtilization, etc.
Once metrics are visible, you can create an alarm programmatically.

2. Concept for “anomalous” GPU usage

OCI doesn’t have a built‑in anomaly engine on GPU metrics. A practical approach for “anomalous GPU usage” is:
  • Alarm if GPU utilization is too high for too long (e.g. potential abuse / runaway job).
  • Optionally add another alarm if utilization is too low during expected workload hours.
Example high-usage rule:

3. Python setup

Install and configure the OCI Python SDK:
Configure credentials (config file in ~/.oci/config):

4. Python code to create a GPU anomaly alarm

This example creates a high GPU utilization alarm on a specific instance.

5. Optional: “Low GPU usage” (expected workload hours)

If “anomalous” for you means “GPU is unexpectedly idle during work”, you can add another alarm:
You can further filter by availabilityDomain, displayName, or custom tags in the query if you want one alarm for a group of GPU instances instead of a single resourceId.
If you share your exact GPU metrics (namespace/metric names as seen in Metrics Explorer) and how you define “anomaly” (thresholds, times), I can adjust the query and Python code precisely.
Changing this alarm’s query, thresholds, or destinations is an in-place update and does not force replacement of other resources (no outage risk beyond normal alarm behavior changes).To verify, terraform plan should show either creation of oci_monitoring_alarm.anomalous_gpu_usage_alarm or an in-place update (~) of the existing alarm with the new query (and any other changed fields).