Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel6
outlinefalse
stylenone
typeflat
printabletrue

Purpose

An analyst wants to detect abusive resource consumption in Azure Virtual Machines.  Using the VM Metrics Azure collector to send CPU and disk usage to Devo, the analyst will find machines with too much resource usage.  As a result, the analyst will remove the malicious mining programs, preventing  them preventing them from degrading service and stealing compute.

Example tables

Table

Description

cloud.azure.vm.metrics_simple

Virtual machine performance data in Azure

Authorize It

Microsoft credentials are confusing. Consult Microsoft collector OAuth authentication before you beginBefore beginning, be aware of the different credential fields.

  1. In Azure, search for Entra ID.

    image-20250206-182248.pngImage Removedimage-20250217-211507.pngImage Added
  2. Click App registrations in the left menu and click the app (or Service Principal) that you are going to use.

...

  1. image-20250217-211531.pngImage Added
  2. Register the application

    image-20250206-190600.pngImage Modified
  3. In the Overview area, find the Application (client) ID and the Directory (tenant) ID.

    image-20250206-183036.pngImage Modified
  4. Click Certificates & Secrets on the menu and create a new client secret by clicking the New client secret button.

    image-20250206-183225.pngImage Modified
  5. Add the secret.

Warning

Data loss warning: At the secret expiration time, the collector will stop working until the secret is replaced.

...

  1. Copy the secret value.

Note

Save the client secret value. It will only be shown once.

The value contains a tilde ~ character.

...

  1. Open Subscriptions.

    image-20250206-184445.pngImage Modified
  2. Select the correct subscription and note the subscription ID.

    image-20250206-184643.pngImage Modified

...

  1. Select Access control (IAM) in the left menu and click Add and Add role assignment.

    image-20250206-191214.pngImage Modified
  2. Select the Reader role.

    image-20250206-184900.pngImage Modified
  3. Click “Select members” and add the VM Metrics application.

    image-20250206-191511.pngImage Modified

9. Confirm the changes with Review + Assign.

Run It

In the Cloud Collector App, create an Azure Collector instance using this parameters template, replacing the values enclosed in < >.

Code Block

Secure It

Cryptominer

Detect excessive CPU usage, which may be caused by mining software that is stealing CPU.

Code Block
from cloud.azure.vm.metrics_simple where eq(metricName,"Percentage CPU"), isnotnull(average)
group every 1h by resourceId select avg(average) as cpu_percent
where cpu_percent>90 

Load balancer

A malicious user has gained access to Azure Load Balancer. Unbalancing network load would be a devious way to degrade service and increase costs. Check if the network load has become unbalanced.

Code Block
from cloud.azure.vm.metrics_simple 

//Traffic going in and out.
where endswith(metricName,"Flows")

//Each collector corresponds to an Azure subscription.
//Group by collector under the assumption that each subscription should be load balanced.
group every 1h by split(hostname,"-",1) as collector,metricName,resourceId select avg(average) as average
group every 1h by collector,metricName select stddev(average) as deviation_across_resources
//If the deviation_across_resources has increased, load balancing has been disrupted.

Monitor It

Create an inactivity alert to detect interruptions of transfer of data from the source to the SQS queue using the query

...