Microsoft Graph Get
Synopsis
Retrieves detailed information about security alerts or incidents from Microsoft Graph Security API, enabling telemetry pipelines to enrich events with complete alert context, incident details, and investigation data from Microsoft Defender and Sentinel.
Schema
- msgraph_get:
tenant_id: <string>
client_id: <string>
client_secret: <string>
id: <string>
type: <string>
target_field: <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 for authentication |
client_id | N | ${GRAPH_CLIENT_ID} | Application (client) ID from Azure AD app registration |
client_secret | N | ${GRAPH_CLIENT_SECRET} | Client secret for OAuth 2.0 authentication |
id | Y | Alert or incident identifier to retrieve from Microsoft Graph API | |
type | N | alert | Resource type to retrieve: alert or incident (case-insensitive) |
target_field | N | Type value | Field name where retrieved resource data will be stored |
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 when resource does not exist |
on_failure | N | See Handling Failures | |
on_success | N | See Handling Success | |
tag | N | Identifier |
Details
The msgraph_get processor retrieves complete security alert or incident data from Microsoft Graph Security API, enabling telemetry pipelines to enrich events with detailed investigation context from Microsoft Defender and Sentinel platforms.
Authentication: Uses OAuth 2.0 client credentials flow with Azure AD. The processor automatically obtains and caches access tokens for the Microsoft Graph API scope (https://graph.microsoft.com/.default). Ensure your Azure AD application has appropriate API permissions (SecurityAlert.Read.All or SecurityIncident.Read.All).
Resource Types: Supports two resource types through the type parameter:
alert: Retrieves alerts from/security/alerts_v2/{id}endpoint (Microsoft Defender alerts)incident: Retrieves incidents from/security/incidents/{id}endpoint (Microsoft Sentinel incidents)
Default Behavior: When type is not specified, defaults to alert. When target_field is not specified, the processor stores the retrieved resource in a field matching the type value (e.g., alert or incident).
Template Support: All string fields support Go template syntax with event field interpolation using {{{field_name}}} notation. This enables dynamic resource ID retrieval based on event data.
Token Caching: Access tokens are automatically cached and reused across multiple processor invocations, reducing authentication overhead and improving performance for high-volume processing.
Error Handling: The processor supports both ignore_failure (continue on API errors) and ignore_missing (continue when resource not found) flags for graceful degradation in production pipelines.
API Timeout: HTTP requests to Microsoft Graph API have a 15-second timeout to prevent pipeline stalls during network issues or service degradation.
For Azure AD app registration requirements, see the defender processor documentation for detailed setup instructions.
Examples
Basic Alert Retrieval
Retrieving alert details from Microsoft Defender... | |
Complete alert data stored in alert_details field... | |
Incident Retrieval
Fetching incident data from Microsoft Sentinel... | |
Incident details with alerts and investigation status... | |
Default Type and Target Field
Using default type (alert) and target field... | |
Alert data stored in default "alert" field... | |
Dynamic Type Selection
Using template variables for dynamic resource type... | |
Resource retrieved based on event data... | |
With Error Handling
Gracefully handling missing or invalid resources... | |
Processing continues despite missing resource... | |
Alert Enrichment Pipeline
Enriching security events with full alert context... | |
Event enriched with alert severity and classification... | |
Case-Insensitive Type
Type parameter accepts case-insensitive values... | |
Type normalized to lowercase internally... | |
Azure AD App Registration
To use the msgraph_get 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 "Microsoft Graph" > Application permissions
- For alerts: Add
SecurityAlert.Read.AllorSecurityAlert.ReadWrite.All - For incidents: Add
SecurityIncident.Read.AllorSecurityIncident.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 Resource IDs:
- Alert IDs can be found in Microsoft Defender portal or via alerts API
- Incident IDs can be found in Microsoft Sentinel portal or via incidents API
For detailed API documentation, see Microsoft Graph Security API Reference.