Query Details
## Linux – Antivirus Activity – Last 7d
### Purpose
Provides **visibility into Defender AV enforcement**, including malware and PUA detections.
### Query
```kql
let LinuxDeviceIds =
DeviceInfo
| where OSPlatform == "Linux"
| distinct DeviceId;
DeviceEvents
| where Timestamp > ago(7d)
| where DeviceId in (LinuxDeviceIds)
| where ActionType startswith "Antivirus"
| extend AF = parse_json(AdditionalFields)
| project
Timestamp,
DeviceName,
ActionType,
ThreatName = tostring(AF.ThreatName),
FileName,
FolderPath,
WasRemediated = tostring(AF.WasRemediated),
ReportId
| order by Timestamp desc
```
### Use this for
* Validating PUA block mode effectiveness
* Investigating why a binary was blocked
* Tracking AV detections across Linux hosts
* Supporting security exception decisions
### Typical activity you’ll see
* Malware detections
* PUA detections (block mode only)
* Scan reportsThis query is designed to provide insights into antivirus activities on Linux devices over the past seven days. It specifically focuses on events related to Microsoft Defender Antivirus enforcement, such as malware and potentially unwanted application (PUA) detections. Here's a breakdown of what the query does:
Identify Linux Devices: It first identifies all devices running on the Linux operating system by filtering the DeviceInfo table for entries where the OSPlatform is "Linux". It then collects the unique DeviceId values for these devices.
Filter Device Events: The query then looks at the DeviceEvents table to find events from the past seven days (Timestamp > ago(7d)) that are associated with the identified Linux devices. It specifically filters for events where the ActionType starts with "Antivirus", indicating they are related to antivirus activities.
Extract and Present Data: For each relevant event, it extracts and presents several pieces of information:
Timestamp: When the event occurred.DeviceName: The name of the device where the event was recorded.ActionType: The type of antivirus action taken.ThreatName: The name of the detected threat, extracted from the AdditionalFields.FileName and FolderPath: The file and location involved in the event.WasRemediated: Whether the threat was successfully remediated, also extracted from the AdditionalFields.ReportId: An identifier for the report.Order Results: The results are ordered by the Timestamp in descending order, so the most recent events appear first.

Nathan Hutchinson
Released: February 2, 2026
Tables
Keywords
Operators