[New] Remediate Identity - Suspected Phishing Kit or AiTM Compromise - #26
Open
terrancedejesus wants to merge 1 commit into
Open
Conversation
Add an OOTB identity response workflow that correlates open Entra AiTM / phishing-kit alerts by rule_id, corroborates post-auth persistence in the audit logs, and contains via the microsoft-graph connector (revoke sessions, disable, delete devices, revoke OAuth) with an analyst approval gate
terrancedejesus
marked this pull request as ready for review
July 9, 2026 14:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an example identity response workflow that investigates and contains a suspected AiTM or phishing-kit compromise. It mirrors the endpoint
Remediate ...response templates and is kit-agnostic so it responds to the attacker objective (session, refresh-token, or OAuth theft), not a specific kit (Tycoon, Kali365, etc.).How it works
.alerts-security.alerts-*): identifies victims from open alerts raised by the Entra AiTM / phishing-kit detection rules, matched by stablerule_id. Returns the UPN plus indicators (source IP, ASN, user agent, triggering rules, alert count).logs-azure.auditlogs-*): counts recent post-authentication persistence artifacts (auth-method registration, OAuth consent, device registration). This count gates hard containment.revokeSignInSessionsandconfirmCompromised.Triggers
manual(attach as a custom action on the detection rules) andscheduled(every 15m). Both run the samerule_id-filtered correlation.Graph access
All writes go through the
microsoft-graphHTTP connector (OAuth 2.0 client credentials). No inline credentials.Prerequisites
microsoft-graph: base URLhttps://graph.microsoft.com/v1.0, OAuth 2.0 client credentials, scopehttps://graph.microsoft.com/.default.User.ReadWrite.All,Device.ReadWrite.All,DelegatedPermissionGrant.ReadWrite.All,IdentityRiskyUser.ReadWrite.All.correlation_esqlrule_idset in sync with the tenant's installed Entra AiTM / phishing-kit rules.Correlated detection rules (13, rules/integrations/azure)
d2c02b2b-bd01-4d4a-a17a-8df8f357b015e5420ced-bc42-4783-a8df-99320567e0906e6376c1-a71e-4789-a795-198b056640644b11dbab-ce37-49c4-bdf1-cdf64b405d9614fa0285-fe78-4843-ac8e-f4b481f49da94f95e0f8-18b7-459a-b8b5-b2f5c94bf6eba83b3dac-325a-11ef-b3e6-f661ea17fbceaf22d970-7106-45b4-b5e3-460d15333727375132c6-25d5-11f0-8745-f661ea17fbcd82629eed-5516-446e-ad73-03b8c4f4d571d4695889-0410-4e7b-a4aa-59be525a11a690efea04-5675-11f0-8f80-f661ea17fbcd960b1cef-f94d-4150-863d-b1dc311739deDesign notes
rule_id(deployment-stable), notrule.uuid.initiated_byandtarget_resources[0..2]because audit logs lack ECSuser.nameand the victim's position varies by operation.revokeSignInSessionsin Entra ID.aitm-containmentcase.query, notpath(the connector encodes the path).Testing
Validated end to end in the Elastic Workflows engine against TRADE research tenant. Involved emulating the kit triggers (Kali365 user-agent sign-in and phishing-kit device registration) to raise real detection-rule alerts, then ran the workflow via the manual trigger. Confirmed correlation, corroboration, case creation with indicators, soft containment, the approval gate, hard containment (device deleted, account disabled, OAuth grant revoked, sessions revoked), and the validation comment showing registered devices = 0.