Skip to content

Instantly share code, notes, and snippets.

@nathanmcnulty
Created July 18, 2025 04:41
Show Gist options
  • Select an option

  • Save nathanmcnulty/bc97d15096ddb052826bb82c70de46d5 to your computer and use it in GitHub Desktop.

Select an option

Save nathanmcnulty/bc97d15096ddb052826bb82c70de46d5 to your computer and use it in GitHub Desktop.
Playbook to remove user from CA exclusion group when Sentinel sees user registered passkey
AuditLogs
| where ResultReason == @"User registered Fido2 Authentication Method"
| extend UserId = parse_json(TargetResources)[0]["id"]
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"triggers": {
"Microsoft_Sentinel_alert": {
"type": "ApiConnectionWebhook",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azuresentinel']['connectionId']"
}
},
"body": {
"callback_url": "@{listCallbackUrl()}"
},
"path": "/subscribe"
}
}
},
"actions": {
"HTTP": {
"runAfter": {},
"type": "Http",
"inputs": {
"uri": "https://graph.microsoft.com/v1.0/groups/b208b1c3-6135-4eb8-b088-e196f556e6b6/members/@{triggerBody()?['Entities'][0]['AadUserId']}/$ref",
"method": "DELETE",
"authentication": {
"type": "ManagedServiceIdentity",
"audience": "https://graph.microsoft.com"
}
},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
}
},
"outputs": {},
"parameters": {
"$connections": {
"type": "Object",
"defaultValue": {}
}
}
},
"parameters": {
"$connections": {
"type": "Object",
"value": {
"azuresentinel": {
"id": "/subscriptions/43babb60-9e73-4dc8-b769-4401c01aad73/providers/Microsoft.Web/locations/westus2/managedApis/azuresentinel",
"connectionId": "/subscriptions/43babb60-9e73-4dc8-b769-4401c01aad73/resourceGroups/sml-sentinel/providers/Microsoft.Web/connections/azuresentinel-sentinel-passkey-exclusion-group",
"connectionName": "azuresentinel-sentinel-passkey-exclusion-group",
"connectionProperties": {
"authentication": {
"type": "ManagedServiceIdentity"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment