← Back to SOC feed Coverage →

Failed Logon Attempt

kql MEDIUM Azure-Sentinel
DeviceLogonEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-22T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may attempt to brute force access to high-value assets through repeated failed logon attempts. SOC teams should proactively hunt for this behavior to identify potential credential compromise or reconnaissance efforts targeting critical systems.

KQL Query

DeviceLogonEvents
| where DeviceName in ("DeviceName1","DeviceName2")
| where ActionType == "LogonFailed"
| summarize LogonFailures=count() by DeviceName, LogonType, InitiatingProcessCommandLine
| where LogonFailures > 3
| project LogonFailures, DeviceName, LogonType, InitiatingProcessCommandLine
| sort by LogonFailures desc

Analytic Rule Definition

id: 95d68a9c-91d3-41ce-ab9f-f1baadc74f8a
name: Failed Logon Attempt
description: |
  Sample query to detect If there are more then 3 failed logon authentications on high value assets.
  Update DeviceName to reflect your high value assets.
  For questions @MiladMSFT on Twitter or [email protected].
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceLogonEvents
query: |
  DeviceLogonEvents
  | where DeviceName in ("DeviceName1","DeviceName2")
  | where ActionType == "LogonFailed"
  | summarize LogonFailures=count() by DeviceName, LogonType, InitiatingProcessCommandLine
  | where LogonFailures > 3
  | project LogonFailures, DeviceName, LogonType, InitiatingProcessCommandLine
  | sort by LogonFailures desc

Required Data Sources

Sentinel TableNotes
DeviceLogonEventsEnsure this data connector is enabled

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/General queries/Failed Logon Attempt.yaml