Query Details

List Antivirus Scan Activities

Manual Antivirus Scans

Query

CloudAppEvents
| where ActionType == "RunAntiVirusScan"
| extend DeviceName = tostring(parse_json(RawEventData).DeviceName), ActionComment = tostring(parse_json(RawEventData).ActionComment), ActionScope = tostring(parse_json(RawEventData).ActionScope)
| summarize TotalAntivirusScans = count(), ScanTypes = make_set(ActionScope), Comments = make_set(ActionComment) by DeviceName

About this query

List Antivirus Scan Activities

Query Information

Description

This query lists all manual (and playbook related) anvitius actions that are initiated and the related comments per device.

References

Defender XDR

Sentinel

CloudAppEvents
| where ActionType == "RunAntiVirusScan"
| extend DeviceName = tostring(parse_json(RawEventData).DeviceName), ActionComment = tostring(parse_json(RawEventData).ActionComment), ActionScope = tostring(parse_json(RawEventData).ActionScope)
| summarize TotalAntivirusScans = count(), ScanTypes = make_set(ActionScope), Comments = make_set(ActionComment) by DeviceName

Explanation

This query is designed to list all antivirus scan activities that have been manually initiated or triggered by a playbook on various devices. It extracts and organizes information about these scan activities from the CloudAppEvents data source. Here's a breakdown of what the query does:

  1. Filter Events: It looks for events where the action type is "RunAntiVirusScan," which indicates that an antivirus scan was initiated.

  2. Extract Information: For each event, it extracts the device name, any comments associated with the action, and the scope of the action (e.g., full scan, quick scan) from the raw event data.

  3. Summarize Data: The query then summarizes the data by device name, providing:

    • The total number of antivirus scans initiated on each device.
    • A set of different scan types (scopes) that were executed on each device.
    • A set of comments related to the scan actions on each device.

This summary helps in understanding the frequency and types of antivirus scans performed on each device, along with any additional context provided through comments. The query is applicable to both Defender XDR and Sentinel environments, as indicated by the identical KQL used for both.

Details

Bert-Jan Pals profile picture

Bert-Jan Pals

Released: December 1, 2024

Tables

CloudAppEvents

Keywords

CloudAppEventsDeviceNameActionCommentActionScope

Operators

whereextendtostringparse_jsonsummarizecountmake_set

Actions

GitHub