Query Details

Defender for Cloud - CloudAuditEvents

DFC Cloud Audit Events

Query

CloudAuditEvents
| where Timestamp > ago(7d)
| where OperationName startswith "Microsoft.Compute/virtualMachines/write"
| extend Status = RawEventData["status"], SubStatus = RawEventData["subStatus"]
| sample 10

About this query

Defender for Cloud - CloudAuditEvents

Query Information

Description

The CloudAuditEvents table in the advanced hunting schema contains information about cloud audit events for various cloud platforms protected by the organization's Microsoft Defender for Cloud.

References

Microsoft Defender XDR

To get a sample list of VM creation commands performed in the last seven days:

Explanation

This KQL (Kusto Query Language) query is designed to analyze cloud audit events using Microsoft Defender for Cloud. Here's a simple breakdown of what the query does:

  1. Data Source: It uses the CloudAuditEvents table, which logs audit events related to cloud activities.

  2. Time Frame: The query filters for events that occurred in the last seven days.

  3. Operation Filter: It specifically looks for operations related to the creation of virtual machines, identified by the operation name starting with "Microsoft.Compute/virtualMachines/write".

  4. Data Extraction: The query extracts additional details about each event, specifically the status and subStatus from the raw event data.

  5. Sampling: It randomly selects 10 events from the filtered results to provide a sample list.

In summary, this query retrieves a sample of recent virtual machine creation events from the cloud audit logs, focusing on the last week of activity.

Details

Alex Verboon profile picture

Alex Verboon

Released: April 16, 2026

Tables

CloudAuditEvents

Keywords

CloudAuditEvents

Operators

CloudAuditEvents|where>agostartswithextend=sample

Actions

GitHub