Query Details
id: c9d0e1f2-a3b4-4c5d-6e7f-8a9b0c1d2e3f
name: ADFS Sign-In from Threat Intelligence Malicious IP
version: 1.0.0
kind: Scheduled
description: |
Detects successful ADFS-federated authentication from IP addresses present in the
ThreatIntelIndicators table with any active threat tag. Any successful ADFS
authentication from a known-malicious IP is a high-confidence indicator that an attacker
holds valid ADFS credentials (stolen, phished, or brute-forced) and is actively using them.
The ADFS federation path may bypass cloud-based Conditional Access policies depending on
the federation configuration.
MITRE ATT&CK: T1078 (Valid Accounts), T1528 (Steal Application Access Token)
severity: High
requiredDataConnectors:
- connectorId: AzureActiveDirectory
dataTypes:
- ADFSSignInLogs
- connectorId: ThreatIntelligence
dataTypes:
- ThreatIntelIndicators
queryFrequency: 15m
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
- InitialAccess
- CredentialAccess
relevantTechniques:
- T1078
- T1528
query: |
let MaliciousIPs =
ThreatIntelIndicators
| where Pattern has "ipv4-addr:value"
| extend NetworkIP = extract(@"ipv4-addr:value\s*=\s*'([^']+)'", 1, Pattern)
| where isnotempty(NetworkIP)
| summarize ThreatTags = make_set(Tags)
by NetworkIP;
ADFSSignInLogs
| where TimeGenerated > ago(1h)
| where ResultType == 0
| join kind=inner MaliciousIPs on $left.IPAddress == $right.NetworkIP
| project
TimeGenerated,
UserPrincipalName,
AppDisplayName,
IPAddress,
Location,
ThreatTags,
AuthenticationRequirement,
TokenIssuerName,
ConditionalAccessStatus
| order by TimeGenerated desc
entityMappings:
- entityType: Account
fieldMappings:
- identifier: FullName
columnName: UserPrincipalName
- entityType: IP
fieldMappings:
- identifier: Address
columnName: IPAddress
customDetails:
ThreatTags: ThreatTags
AppDisplayName: AppDisplayName
alertDetailsOverride:
alertDisplayNameFormat: "ADFS Sign-In from Malicious IP - {{UserPrincipalName}} via {{IPAddress}}"
alertDescriptionFormat: "User {{UserPrincipalName}} authenticated via ADFS from threat-intelligence-tagged IP {{IPAddress}}. ThreatTags: {{ThreatTags}}."
alertSeverityColumnName: ""
alertTacticsColumnName: ""
incidentConfiguration:
createIncident: true
groupingConfiguration:
enabled: true
reopenClosedIncident: false
lookbackDuration: PT5H
matchingMethod: AnyAlert
groupByEntities:
- Account
- IP
groupByAlertDetails: []
groupByCustomDetails: []
This query is designed to detect successful sign-ins to Active Directory Federation Services (ADFS) from IP addresses that are flagged as malicious in a threat intelligence database. Here's a simplified breakdown:
Purpose: The query identifies successful ADFS logins from IP addresses known to be associated with malicious activity. This suggests that an attacker may have valid ADFS credentials, potentially obtained through theft, phishing, or brute force.
Data Sources: It uses data from two sources:
Detection Logic:
Alerting:
Incident Management:
Frequency: The query runs every 15 minutes, analyzing data from the past hour.
MITRE ATT&CK Techniques: The query is associated with techniques T1078 (Valid Accounts) and T1528 (Steal Application Access Token), indicating the tactics of initial access and credential access.
Overall, this query helps security teams quickly identify and respond to potential security breaches involving compromised ADFS credentials used from known malicious IP addresses.

David Alonso
Released: March 24, 2026
Tables
Keywords
Operators