Azure Sentinel Destination Setup
Create incidents in Microsoft Sentinel for detection alerts using App Registration authentication.
Azure Sentinel Destination Setup
Create incidents in Microsoft Sentinel for detection alerts using App Registration authentication.
Prerequisites
- Azure subscription with Sentinel workspace
- Azure AD permissions to create App Registrations
- Sentinel workspace with incident creation permissions
Setup Steps
1. Create App Registration
In Azure Portal:
- Navigate to Azure Active Directory → App registrations
- Click New registration
- Enter name (e.g., "Query.ai Security Detections")
- Select Accounts in this organizational directory only
- Click Register
- Copy the Application (client) ID
- Copy the Directory (tenant) ID
2. Create Client Secret
- In your App Registration, navigate to Certificates & secrets
- Click New client secret
- Add description (e.g., "Detection alerts integration")
- Select expiration period (recommend 90 days for security)
- Click Add
- Copy the secret value immediately - you won't see it again
Important: Store the secret value securely. It cannot be retrieved after leaving the page.
3. Assign Sentinel Permissions
- Navigate to your Sentinel workspace in Azure Portal
- Go to Access control (IAM)
- Click Add role assignment
- Select Microsoft Sentinel Responder role
- Click Next
- Select User, group, or service principal
- Click Select members
- Search for and select your App Registration
- Click Review + assign
4. Test Access
Test that the App Registration can create incidents:
# Install Azure CLI if needed
az login
# Test incident creation (replace with your values)
az rest --method put \
--url "https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{rg-name}/providers/Microsoft.OperationalInsights/workspaces/{workspace-name}/providers/Microsoft.SecurityInsights/incidents/test-incident-001?api-version=2022-07-01-preview" \
--body '{"properties":{"title":"Test Incident","severity":"Low","status":"New"}}'Expected Response: JSON object with incident details
5. Configure in Query.ai
Contact your Query.ai administrator to configure the Azure Sentinel destination with:
Required Configuration:
- Tenant ID (Azure AD Directory ID) - stored securely
- Client ID (Application ID) - stored securely
- Client Secret - stored securely
- Subscription ID
- Resource Group name
- Workspace name
Incident Fields
Azure Sentinel incidents are created with the following fields:
| Sentinel Field | Value | Notes |
|---|---|---|
title | Detection name | Incident title |
description | Detection details | Complete description with all metadata |
severity | High/Medium/Low | Mapped from detection severity |
status | New | All incidents created as "New" |
firstActivityTimeUtc | Detection range start | ISO 8601 format |
lastActivityTimeUtc | Detection ran at | ISO 8601 format |
Severity Mapping
Detection severity maps to Sentinel severity:
| Detection Severity | Sentinel Severity |
|---|---|
| CRITICAL | High |
| HIGH | High |
| MEDIUM | Medium |
| LOW | Low |
Description Field Contents
The description includes:
- Detection name, severity, outcome, and match count
- Run type (SCHEDULED or MANUAL)
- Threshold configuration (operator, value, eagerness)
- Execution metadata (exhaustiveness, search ID, trace ID if available)
- Detection description
- Replay link for investigation
- Error messages (if any)
Incident ID
Incidents use a deterministic UUID based on detection ID + run ID. This prevents duplicate incidents if the same detection run is processed multiple times.
Testing
Test App Registration Credentials
Test authentication with Python:
from azure.identity import ClientSecretCredential
from azure.mgmt.securityinsight import SecurityInsights
credential = ClientSecretCredential(
tenant_id="your-tenant-id",
client_id="your-client-id",
client_secret="your-client-secret"
)
client = SecurityInsights(credential, "your-subscription-id")
# List existing incidents
incidents = client.incidents.list(
resource_group_name="your-rg",
workspace_name="your-workspace"
)
for incident in incidents:
print(f"Incident: {incident.name} - {incident.properties.title}")Test with Detection
- Create a test detection with low threshold
- Add Azure Sentinel destination
- Click Run Now
- Check Sentinel workspace for new incident
Troubleshooting
Common Issues
| Error | Cause | Solution |
|---|---|---|
Authentication failed | Invalid credentials | Verify tenant_id, client_id, client_secret are correct |
Forbidden / 403 | Insufficient permissions | Assign Microsoft Sentinel Responder role to App Registration |
Resource not found | Incorrect configuration | Verify subscription_id, resource_group_name, workspace_name |
Tenant not found | Wrong tenant ID | Check tenant_id matches Azure AD tenant |
| Incident not created | Detection didn't match | Verify detection outcome is MATCHED, check destination is enabled |
Verify App Registration Permissions
- Navigate to Sentinel workspace in Azure Portal
- Go to Access control (IAM)
- Click Role assignments
- Search for your App Registration name
- Verify Microsoft Sentinel Responder role is assigned
Check Client Secret Expiration
- Navigate to Azure Active Directory → App registrations
- Select your App Registration
- Go to Certificates & secrets
- Check expiration date of client secret
- Create new secret before expiration
View Logs
Contact your Query.ai administrator to review CloudWatch logs:
aws logs tail /aws/lambda/detection-outcome-handler --followLook for Azure Sentinel-related errors in the logs.
Multiple Workspaces
Create separate destinations for different Sentinel workspaces:
Example Use Cases:
- Production incidents → Production Sentinel workspace
- Test detections → Development Sentinel workspace
- Different regions → Region-specific workspaces
Each destination uses different workspace configurations.
Configuration Options
Required
tenant_id (secret)
- Azure AD Tenant ID (Directory ID)
- Format: UUID (e.g.,
aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee) - Stored securely in AWS Secrets Manager
client_id (secret)
- App Registration Application (client) ID
- Format: UUID (e.g.,
11111111-2222-3333-4444-555555555555) - Stored securely in AWS Secrets Manager
client_secret (secret)
- App Registration client secret value
- Generated in Azure Portal
- Stored securely in AWS Secrets Manager
- Rotate every 90 days
subscription_id
- Azure Subscription ID containing Sentinel workspace
- Format: UUID
- Not secret (can be stored in configuration)
resource_group_name
- Resource Group name containing Sentinel workspace
- Case-sensitive
- Not secret (can be stored in configuration)
workspace_name
- Sentinel workspace name
- Case-sensitive
- Not secret (can be stored in configuration)
Sentinel Workflow Integration
Automation Rules
Configure Sentinel automation rules to process detection incidents:
- Navigate to Sentinel → Automation
- Click Create → Automation rule
- Set trigger: When incident is created
- Add condition: Title contains "Detection"
- Add actions:
- Assign to analyst
- Add tags
- Run playbook
Playbooks
Create Logic Apps playbooks for automated response:
- Navigate to Sentinel → Automation
- Click Create → Playbook
- Design Logic App workflow
- Trigger on incident creation
- Add actions (e.g., send to Slack, create ticket)
Analytics Rules
Sentinel incidents from Query.ai appear alongside native analytics rules:
- View in Incidents dashboard
- Filter by source: "Query.ai Federated Detections"
- Investigate using built-in investigation tools
Incident Investigation
When Sentinel incident is created:
- Open incident in Sentinel portal
- Review incident details and description
- Click replay link to investigate in Query.ai
- Use Sentinel investigation graph for context
- Document findings in incident comments
- Update incident status as investigation progresses
Security Best Practices
- Never Commit Credentials: Always store credentials in Secrets Manager
- Use Dedicated App Registration: Don't use personal accounts
- Rotate Client Secrets: Rotate every 90 days
- Least Privilege Role: Use Sentinel Responder, not Contributor or Owner
- Monitor Sign-ins: Review App Registration sign-in logs for anomalies
- Set Expiration Reminders: Configure alerts before secret expiration
- Audit Access: Regularly review IAM role assignments
Client Secret Rotation
To rotate client secret:
- Navigate to App Registration in Azure Portal
- Go to Certificates & secrets
- Click New client secret
- Copy new secret value
- Update secret in Query.ai configuration
- Test with a manual detection run
- Delete old secret after verification
Best Practice: Create new secret before old one expires to avoid service interruption.
Resources
Updated 2 days ago