Microsoft Defender Update
Synopsis
Updates existing alerts in Microsoft Defender for Endpoint using the Alerts API, enabling automated alert management including status changes, assignment, classification, determination, and comment updates for centralized incident response workflows.
Schema
- msdefender_update:
tenant_id: <string>
client_id: <string>
client_secret: <string>
alert_id: <string>
status: <string>
assigned_to: <string>
classification: <string>
determination: <string>
comment: <string>
description: <text>
if: <script>
disabled: <boolean>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
| Field | Required | Default | Description |
|---|---|---|---|
tenant_id | N | ${GRAPH_TENANT_ID} | Azure AD tenant ID |
client_id | N | ${GRAPH_CLIENT_ID} | Application (client) ID from Azure AD app registration |
client_secret | N | ${GRAPH_CLIENT_SECRET} | Client secret for authentication |
alert_id | Y | Alert identifier to update in Defender for Endpoint | |
status | N | Alert status: New, InProgress, or Resolved (case-insensitive) | |
assigned_to | N | Email address of user to assign the alert to | |
classification | N | Alert classification: TruePositive, InformationalExpectedActivity, or FalsePositive | |
determination | N | Alert determination (see valid values below) | |
comment | N | Comment to add to the alert | |
description | N | Explanatory note | |
if | N | Condition to run | |
disabled | N | false | Disable this processor |
ignore_failure | N | false | See Handling Failures |
ignore_missing | N | false | Continue if alert does not exist |
on_failure | N | See Handling Failures | |
on_success | N | See Handling Success | |
tag | N | Identifier |
Details
The msdefender_update processor modifies existing alerts in Microsoft Defender for Endpoint, enabling automated alert lifecycle management and incident response workflows through the Microsoft Defender API.
Authentication: Uses OAuth 2.0 client credentials flow with Azure AD. The processor automatically obtains and caches access tokens. Ensure your Azure AD application has the necessary API permissions (Alert.ReadWrite.All) for Defender for Endpoint.
Alert ID: The unique identifier of the alert to update. Alert IDs can be obtained from Defender alert creation responses, alert query APIs, or event data from Defender integrations. The processor supports template syntax for dynamic alert ID resolution from event fields.
Status Values: Valid status values are case-insensitive and normalized to proper case:
New: Alert is newly created and not yet investigatedInProgress: Alert is currently under investigationResolved: Alert investigation is complete
Classification Values: Alert classification determines the final verdict of investigation:
TruePositive: Confirmed security threat requiring actionInformationalExpectedActivity: Known benign activityFalsePositive: Incorrectly flagged as a threat
Determination Values: Provides specific categorization of the alert outcome:
True Positive Determinations:
MultiStagedAttack: Complex attack with multiple stagesMaliciousUserActivity: Malicious actions by user accountCompromisedUser: User account compromise detectedMalware: Malicious software detectionPhishing: Phishing attempt or credential harvestingUnwantedSoftware: Potentially unwanted programs
Informational/Expected Activity Determinations:
SecurityTesting: Authorized security testing activityLineOfBusinessApplication: Legitimate business application behaviorConfirmedActivity: Known and approved activity
False Positive Determinations:
NotMalicious: Confirmed benign activityInsufficientData: Not enough information to determine
Common Determination:
Other: Does not fit predefined categories
Field Requirements: At least one update field (status, assigned_to, classification, determination, or comment) must be provided. The processor will return an error if called with no fields to update.
Token Caching: Access tokens are cached for the duration of their validity period, reducing authentication overhead for multiple alert updates. The processor automatically handles token expiration and renewal.
Template Support: All string fields support Go template syntax with event field interpolation using {{{field_name}}} notation.
For integration patterns with Defender alert workflows, see Microsoft Sentinel.
Examples
Update Alert Status
Changing alert status to InProgress... | |
Alert status updated in Defender portal... |
Assign Alert to Analyst
Assigning alert to security analyst... | |
Alert assigned to specified analyst account... |
Resolve as True Positive
Resolving alert with classification and determination... | |
Alert resolved with malware classification... |
Resolve as False Positive
Closing alert as false positive... | |
Alert closed with false positive verdict... |
Complete Investigation Workflow
Updating alert with full investigation results... | |
Alert fully updated with investigation findings... |
Add Investigation Comment
Adding investigative notes to alert... | |
Comment added to alert timeline... |
Case-Insensitive Status Update
Using lowercase status value (automatically normalized)... | |
Status normalized to "Resolved" automatically... |
With Error Handling
Ignoring failures for non-existent alerts... | |
Processing continues even if alert doesn't exist... |
Azure AD App Registration
To use the msdefender_update processor, you must register an application in Azure AD with appropriate permissions:
-
Register Application:
- Navigate to Azure Portal > Microsoft Entra ID > App registrations > New registration
- Choose a name and select supported account types
- Register the application
-
Create Client Secret:
- Go to Certificates & secrets > New client secret
- Add description and expiration
- Copy the secret value (shown only once)
-
Assign API Permissions:
- Go to API Permissions > Add permission
- Select "APIs my organization uses" > Search for "WindowsDefenderATP"
- Choose Application permissions > Alert.ReadWrite.All
- Grant admin consent
-
Configure Environment Variables:
export GRAPH_TENANT_ID="your-tenant-id"
export GRAPH_CLIENT_ID="your-client-id"
export GRAPH_CLIENT_SECRET="your-client-secret" -
Obtain Alert IDs:
- Alert IDs are returned when creating alerts via the defender processor
- Or retrieved via the Alerts API query endpoints
- Available in Defender event data from integrated systems
For detailed setup instructions, see Microsoft Defender for Endpoint API Documentation.