Join our Newsletter — 33% off our NHI Course
Home› Guides› Entra ID Sign-In and Audit Log Detection Guide:…
Guide SOC & Detection Engineering

Entra ID Sign-In and Audit Log Detection Guide: Fields, Error Codes and Detections That Work

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 15 min read
On this page

Most Entra ID compromises are visible in the sign-in and audit logs, but many teams collect only the interactive sign-in stream, keep it for 30 days and alert on little more than impossible travel. Attackers who spray passwords slowly, phish device codes, replay stolen tokens or add a secret to a forgotten app registration leave records in log streams that are often not exported at all. This guide is for detection engineers and SOC analysts who already have Microsoft Entra ID and want to know which log holds which evidence, which fields and error codes matter, and how to build detections that survive contact with real tenants. It assumes the tenant hardening basics in the Entra ID Security Guide and goes deeper on the logs themselves.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

Key takeaways

  • There are several sign-in logs, not one. Interactive, non-interactive, service principal and managed identity sign-ins are separate streams, and token replay and workload abuse mostly appear outside the interactive log.
  • ResultType is the backbone of sign-in detection. Zero is success; codes such as 50126, 50053, 50074, 50076 and 53003 tell you whether a password failed, an account locked or a Conditional Access policy blocked the attempt.
  • Audit logs catch persistence that sign-in logs never show. New app credentials, consent grants, role assignments and new authentication methods are the changes attackers make once they are in.
  • Plan retention beyond the defaults. Entra keeps sign-in and audit data for 7 days on Free and 30 days on P1 or P2, so export to a workspace, storage or Event Hubs from day one.
  • Workload identities need their own baselines. Service principals sign in from predictable places with predictable credentials, which makes deviations easy to detect if the log is collected.

The Entra ID log streams and what each one proves

Microsoft documents four sign-in log types: interactive user sign-ins, non-interactive user sign-ins (a client signs in on the user's behalf, for example by redeeming a refresh token), service principal sign-ins and managed identity sign-ins. The audit log records changes to directory objects, and Identity Protection adds risk detections and risky user records. Sign-in entries are system generated and cannot be changed or deleted by tenant administrators, which makes them strong evidence.

StreamLog Analytics tableWhat it provesTypical detections
Interactive user sign-insSigninLogsA user presented a factor (password, MFA, passkey)Password spray, MFA fatigue, risky sign-ins, legacy protocols
Non-interactive user sign-insAADNonInteractiveUserSignInLogsA client used a token or code on the user's behalfToken replay from new IPs or ASNs, refresh token use after revocation, high-volume Graph access
Service principal sign-insAADServicePrincipalSignInLogsAn application authenticated with its own credentialNew credential key in use, new source IP, failures after a secret change
Managed identity sign-insAADManagedIdentitySignInLogsAn Azure resource obtained a token for its managed identityTokens for unexpected resources such as Key Vault or Graph
Audit logsAuditLogsA directory object or policy was changedApp credential added, consent, role assignment, method registered, Conditional Access change
Identity ProtectionRisk detection and risky user tablesMicrosoft scored a sign-in or user as riskyAnomalous token, password spray, attacker in the middle, leaked credentials

Collection and retention

  • Default retention: Microsoft states that audit and sign-in reports are kept for 7 days on Entra ID Free and 30 days on P1 and P2. Upgrading is not retroactive, so data that has already aged out is gone unless it was exported.
  • Diagnostic settings: configure a diagnostic setting in Entra ID (Security Administrator at minimum) and select every sign-in category plus audit, provisioning and risk categories. Destinations are a Log Analytics workspace, an Azure storage account or an Event Hubs namespace for a third-party SIEM. See the Microsoft Sentinel Guide.
  • Volume planning: non-interactive sign-ins are usually the largest stream by far. If cost forces a choice, use a cheaper table plan or storage archive for it rather than not collecting it; the service principal table supports Basic and Auxiliary plans.
  • Retention target: keep at least 12 months searchable or restorable. Token theft and app persistence are often found months after the event.
  • Test and legacy tenants: collect from every tenant you own, not only production, and apply the same MFA and Conditional Access policies to test tenants.

For general log pipeline design see the Log Management and Retention Guide.

Sign-in log fields that carry the signal

FieldValues to knowWhy it matters
ResultType / ResultDescription0 = success, anything else = failure or interruptPrimary filter for spray, lockout and policy blocks
IsInteractivetrue when the user provided a factor; false when a token or code was usedSeparates human logons from token use
AuthenticationProtocolnone, oAuth2, ropc, wsFederation, saml20, deviceCodeROPC and device code are rare in most tenants and abused often
ClientAppUsedBrowser, Modern clients, Exchange ActiveSync, IMAP, POP, SMTP, MAPILegacy protocols bypass MFA
ConditionalAccessStatussuccess, failure, notAppliednotApplied on a privileged sign-in means a policy gap
AuthenticationRequirementsingleFactorAuthentication, multiFactorAuthenticationSingle factor success for an admin is an alert in itself
IncomingTokenType, TokenIssuerTypeFor example a primary refresh token or SAML assertion; AzureAD or ADFederationServicesFederated tokens and PRT use change what "MFA satisfied" means
IPAddress, AutonomousSystemNumber, LocationDetailsIP, ASN, city and countryASN baselines catch residential proxy and hosting provider abuse better than country alone
AppId, AppDisplayName, ResourceDisplayNameClient application and target resourceFirst-party client IDs used for Graph access from new networks
DeviceDetaildeviceId, operating system, browser, compliant, managedUnmanaged device for a privileged account
SessionId, UniqueTokenIdentifier, CorrelationIdSession and token tracking identifiersPivot from one suspicious sign-in to every use of the same session
HomeTenantId, ResourceTenantId, CrossTenantAccessTypeTenant identifiersYour users signing in to other tenants, or guests into yours
RiskLevelDuringSignIn, RiskEventTypes_V2, RiskStatenone, low, medium, high, hiddenRisk fields show "hidden" without Entra ID P2

Service principal sign-ins add ServicePrincipalCredentialKeyId, ServicePrincipalCredentialThumbprint, ClientCredentialType (client secret or client assertion) and FederatedCredentialId. The key ID is what lets you tell which of an application's several secrets was used, which is essential when an attacker adds one of their own.

Error codes that drive detections

ResultTypeMicrosoft meaningDetection use
50126Invalid username or passwordSpray: many accounts, few attempts each, same IP, ASN or user agent
50053Account locked (Smart Lockout) or sign-in blocked from a malicious IPBrute force against one account, or Microsoft blocking a known bad source
50074Strong authentication required and the user did not pass the MFA challengeRepeated 50074 against one user suggests MFA fatigue
50076MFA required by policy or because of a location changeCorrect password from a new location: treat as a likely valid credential
500121Authentication failed during strong authenticationDenied or failed MFA after a correct password
53003Blocked by Conditional AccessValid credential stopped by policy, still a compromised password
50199Interrupt: user confirmation required for security reasons50199 followed by success within minutes is Microsoft's device code phishing pattern
65001, 90094Consent missing; administrator consent requiredSpikes after a phishing email point to a consent phishing app

Microsoft's security operations guidance treats 50126 thresholds, 53003, 50074, 500121 and 50053 on privileged accounts as high risk. The most useful single rule in many tenants is a correct password (50076, 50074, 500121 or 53003) from an IP or ASN that has also produced 50126 failures against other users: that is a spray that found a working password, even if MFA or policy stopped it. Reset that password. See the Password Spraying and Credential Stuffing Defence Guide.

Detections by attack pattern

AttackATT&CKLogDetection logic
Password sprayT1110.003SigninLogsDistinct users with 50126 per IP or ASN per hour above baseline; low and slow variant across 24 hours
Valid cloud account from a new networkT1078.004SigninLogs, non-interactiveSuccess from an ASN never seen for the user in 30 days, especially hosting or residential proxy ranges
MFA fatigueT1621SigninLogsThree or more 50074 or 500121 for one user in 10 minutes, then success; "MFA denied, fraud code entered" in AuthenticationDetails
Device code phishingT1566.002, T1528SigninLogs, AuditLogsAuthenticationProtocol = deviceCode for users with no input-constrained device need; device registration shortly after
Token replayT1550.001, T1539Non-interactiveSame SessionId seen from two ASNs or countries; Identity Protection anomalousToken or attackerinTheMiddle
Additional app credentialsT1098.001AuditLogs, SP sign-ins"Update Application-Certificates and secrets management" outside change, then a new ServicePrincipalCredentialKeyId in sign-ins
Privileged role addedT1098.003AuditLogs"Add member to role" or "Add eligible member to role" outside PIM, or for a service principal
Rogue device registrationT1098.005AuditLogs"Add device" or "Add registered owner to device" for a user who did not enrol a device
MFA method tamperingT1556.006AuditLogs"User registered security information" or "Admin registered security info" (Temporary Access Pass) after a password reset or from a new IP
Federation or trust changeT1484.002, T1606.002AuditLogs, SigninLogsDomain authentication changed to federated, new federation certificate, TokenIssuerType = ADFederationServices where you do not federate
Hybrid identity abuseT1556.007AuditLogsNew pass-through authentication agent registered or Entra Connect configuration changed

A minimal spray detection in KQL, as a starting point to tune rather than a finished rule:

SigninLogs
| where TimeGenerated > ago(1h)
| where ResultType == "50126"
| summarize Users = dcount(UserPrincipalName), Attempts = count() by IPAddress, AutonomousSystemNumber
| where Users > 10
| join kind=leftouter (
    SigninLogs | where TimeGenerated > ago(1h)
    | where ResultType in ("0","50074","50076","500121","53003")
    | summarize Hits = make_set(UserPrincipalName) by IPAddress
  ) on IPAddress

The join returns accounts where the password was correct from a spraying source. For query technique see the KQL for Threat Hunting Guide; for the attack families see the Device Code Phishing Guide, the MFA Fatigue and Bypass Guide and the AiTM Phishing Guide.

Audit log activities to alert on

Microsoft's security operations guides for privileged accounts and applications list the audit activities worth alerting on. The names below are as Microsoft writes them; filter on OperationName or ActivityDisplayName.

  • App credentials: "Update Application-Certificates and secrets management" together with "Update Service principal" or "Update Application" (Core Directory, ApplicationManagement). High risk outside change windows.
  • Application permissions: "Add app role assignment to service principal" where the target is Microsoft Graph, Exchange Online or SharePoint and the role is broad (for example *.All or Mail.*); "Add delegated permission grant" with ConsentType AllPrincipals.
  • User consent: "Consent to application" with IsAdminConsent false is low risk alone but worth reviewing for new apps; failures with the risky app block reason indicate an attempted consent phishing app. See the Consent Phishing and Illicit OAuth Grants Guide.
  • App configuration: "Update Application" with redirect URI changes to wildcards, non-HTTPS or domains you do not own; "Add owner to application" outside change management.
  • Roles and PIM: "Add member to role" (permanent assignment outside PIM), "Update role setting in PIM" (for example MFA on activation removed), "Disable PIM alert".
  • Authentication methods: "User registered security information", and "Admin registered security info" with a Temporary Access Pass status reason. Method removal followed by new registration on the same account, especially after a self-service reset, is the sequence to alert on.
  • Guests and tenants: "Update user" changing UserType from Guest to Member, "Invite external user" by non-approved inviters, and cross-tenant access setting changes.
  • Policy: any change to Conditional Access policies, named locations or authentication methods policy, especially exclusions.

Where identity fits: service principals and managed identities

Workload identities are the easiest identities to baseline and the least often monitored. A service principal normally uses one or two credential key IDs, from a small set of IP ranges, to a fixed set of resources. Detections worth building:

  • New credential key in use: a ServicePrincipalCredentialKeyId never seen before for that app, especially within days of an audit event adding a secret.
  • New source: service principal sign-in from an IP or ASN outside its baseline, or from a residential network.
  • Client secret where certificates or federation are the standard: ClientCredentialType = client secret on an app that should use a certificate or a federated credential.
  • Managed identity reaching new resources: a managed identity requesting tokens for Key Vault or Graph when its history shows only storage.

See the Azure RBAC and Service Principals Guide, the Azure Managed Identities Security Guide and the Entra ID Applications and Consent Guide.

Using Identity Protection signals

Identity Protection risk detections are useful enrichment but not a replacement for your own rules. Detections include unfamiliarFeatures, unlikelyTravel, anomalousToken and passwordSpray. User risk detections include attackerinTheMiddle, leakedCredentials, attemptedPrtAccess and suspiciousCredentialAddition. Most are Premium (Entra ID P2), and without P2 the risk fields show "hidden" and you receive only "Additional risk detected" (generic). Some detections also need Defender for Cloud Apps licensing. Treat high-risk detections on privileged users as incidents, correlate medium ones with your own rules, and watch RiskState changes to "dismissed" by administrators, which can itself hide an attack.

Rolling out detections

  1. Inventory the streams: confirm every sign-in category, audit, provisioning and risk logs are exported from every tenant, and check ingestion delay against your alert windows.
  2. Build baselines first: 30 days of ASNs per user, credential key IDs per service principal, protocols in use (ROPC, device code, legacy clients) and normal admin activity times.
  3. Start with high-fidelity rules: spray that found a valid password, single factor success on a privileged account, app credential added outside change, role assigned outside PIM, method registered after reset.
  4. Run new rules in report-only mode: send matches to a hunting queue for two to four weeks, measure false positives and tune before paging anyone.
  5. Automate the safe responses: revoke sessions (revokeSignInSessions) and require password change for confirmed sprays; disable a service principal only after the owner is paged, because automated disablement can stop production.

See the Detection Engineering Guide for rule lifecycle practice.

Decision guidance

  • Native Sentinel versus a third-party SIEM: Log Analytics gives direct KQL access and the built-in Entra connector; Event Hubs streaming suits organisations standardised on another SIEM. Either works if every stream is collected.
  • Small organisations: with P1 only, prioritise exporting logs and five rules: spray success, legacy protocol success, admin single factor, app credential added and role assignment. Risk-based detections need P2.
  • Large or multi-tenant estates: centralise all tenants in one workspace or SIEM, normalise tenant IDs, and add cross-tenant sign-in rules (ResourceTenantId differs from HomeTenantId).
  • Block or detect: where a protocol is not needed (ROPC, device code, legacy authentication), block it with Conditional Access and keep a detection for any success that slips through; detection alone leaves the door open.

Measuring whether it works

  • Stream coverage: percentage of tenants exporting all four sign-in categories plus audit logs (target 100).
  • Retention: days of searchable sign-in history (target at least 365).
  • Time to detect: median minutes from a test spray or app secret addition to alert.
  • Rule precision: share of alerts closed as true positive or benign true positive, reviewed monthly.
  • Legacy and risky protocol successes: count of successful ROPC, device code and legacy client sign-ins per month, trending to zero outside approved exceptions.

Common failure patterns

  • Collecting only interactive sign-ins: token replay, refresh token abuse and workload activity are invisible.
  • Alerting on failures only: a spray rule that ignores successes and 53003 blocks from the same source misses the one account that mattered.
  • Treating "MFA satisfied" as safe: AiTM proxies and device code phishing produce sign-ins with MFA satisfied. Look at the session, ASN and protocol, not only AuthenticationRequirement.
  • Ignoring the audit log for apps: new OAuth applications, app credentials and broad mailbox permissions are all audit log events, not sign-in events.
  • Excluding break-glass and service accounts from monitoring: they are excluded from Conditional Access by design, so they need the strictest alerting. See the Break-Glass Account Guide.
  • Letting retention default: discovering a compromise on day 45 with 30 days of logs ends the investigation before it starts.

Framework mapping

FrameworkReferenceHow this guide supports it
NIST CSF 2.0PR.PS-04, DE.CM-03, DE.AE-02, DE.AE-03Log generation, monitoring personnel and technology use, analysis and correlation
NIST SP 800-53 Rev. 5AU-2, AU-6, AU-11, AU-12, AC-7, SI-4Event logging, review, retention, generation, unsuccessful logons, system monitoring
CIS Controls v8.18.2, 8.9, 8.10, 8.11Collect, centralise, retain and review audit logs
ISO/IEC 27001:2022Annex A 8.15, 8.16Logging; monitoring activities
MITRE D3FENDD3-ANET Authentication Event ThresholdingSpray and brute force thresholds

Practitioner checklist

  • Export interactive, non-interactive, service principal and managed identity sign-ins, audit, provisioning and risk logs from every tenant, including test tenants.
  • Keep at least 12 months of sign-in and audit history searchable or restorable.
  • Build a spray rule that joins 50126 sources with correct-password outcomes (50074, 50076, 500121, 53003, 0).
  • Alert on any successful ROPC, device code or legacy client sign-in outside approved exceptions.
  • Alert on single factor success and ConditionalAccessStatus notApplied for privileged accounts.
  • Baseline credential key IDs and source IPs for every service principal and alert on new ones.
  • Alert on app credential additions, broad app role assignments, AllPrincipals grants and roles assigned outside PIM.
  • Alert on authentication method registration after a password reset or from a new network.
  • Monitor break-glass accounts on every sign-in.
  • Test each rule with controlled activity before and after every change.

Standards and references

Related NHI Mgmt Group resources: Entra ID Security Guide · Microsoft 365 Unified Audit Log Guide for Detection · ITDR Guide · Identity Provider Tenant Compromise Playbook

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.