Microsoft Defender XDR ListAlerts
Certified
List Microsoft Defender XDR alerts
Microsoft Defender XDR ListAlerts
List Microsoft Defender XDR alerts
Lists alerts from the Microsoft Graph security API (/security/alerts_v2) in the order Microsoft Graph
returns them, following @odata.nextLink until top alerts are collected. Requires the Microsoft Graph
application permission SecurityAlert.Read.All.
type: io.kestra.plugin.microsoft365.defender.ListAlertsExamples
Store all new high-severity alerts in internal storage
id: defender_list_high_alerts
namespace: company.security
inputs:
- id: severity
type: SELECT
values: [INFORMATIONAL, LOW, MEDIUM, HIGH]
defaults: HIGH
tasks:
- id: list_alerts
type: io.kestra.plugin.microsoft365.defender.ListAlerts
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
severity: "{{ inputs.severity }}"
status: NEW
top: 200
fetchType: STORE
- id: log
type: io.kestra.plugin.core.log.Log
message: "{{ outputs.list_alerts.count }} open {{ inputs.severity }} alerts written to {{ outputs.list_alerts.uri }}"
List Defender for Endpoint alerts with a raw OData filter
id: defender_list_endpoint_alerts
namespace: company.security
tasks:
- id: list_alerts
type: io.kestra.plugin.microsoft365.defender.ListAlerts
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
filter: "serviceSource eq 'microsoftDefenderForEndpoint'"
top: 50
fetchType: FETCH
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-microsoft365 --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
Properties
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150clientId string
Client ID
Client ID of the Azure service principal. If you don't have a service principal, refer to create a service principal with Azure CLI.
clientSecret string
Client Secret
Service principal client secret. Use this for Client Secret authentication. Provide clientId, tenantId, and clientSecret. Either clientSecret OR pemCertificate must be provided, not both.
fetchType string
FETCHSTOREFETCHFETCH_ONENONEHow to output the alerts
FETCH - outputs the alerts as alerts
FETCH_ONE - outputs the first alert as alert
STORE - stores the alerts in an ION file and outputs its uri
NONE - only outputs count
Default FETCH.
filter string
OData filter
Raw OData $filter expression, e.g. serviceSource eq 'microsoftDefenderForEndpoint'. Combined with severity and status using and.
pemCertificate string
PEM Certificate
Alternative authentication method using certificate-based authentication.
Use this for Client Certificate authentication. Provide clientId, tenantId, and pemCertificate.
Either clientSecret OR pemCertificate must be provided, not both.
severity string
INFORMATIONALLOWMEDIUMHIGHSeverity
Only return alerts with this severity. Allowed values: INFORMATIONAL, LOW, MEDIUM, HIGH.
status string
NEWIN_PROGRESSRESOLVEDStatus
Only return alerts with this status. Allowed values: NEW, IN_PROGRESS, RESOLVED.
tenantId string
Tenant ID
top integerstring
100Maximum number of alerts
Between 1 and 2000. Default 100.
Outputs
alert object
First alert (FETCH_ONE)
alerts array
Alerts (FETCH)
Alert objects with the Microsoft Graph field names.
count integer
0Number of alerts retrieved
uri string
uriURI of the ION file with the alerts (STORE)