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.
| Stream | Log Analytics table | What it proves | Typical detections |
|---|---|---|---|
| Interactive user sign-ins | SigninLogs | A user presented a factor (password, MFA, passkey) | Password spray, MFA fatigue, risky sign-ins, legacy protocols |
| Non-interactive user sign-ins | AADNonInteractiveUserSignInLogs | A client used a token or code on the user's behalf | Token replay from new IPs or ASNs, refresh token use after revocation, high-volume Graph access |
| Service principal sign-ins | AADServicePrincipalSignInLogs | An application authenticated with its own credential | New credential key in use, new source IP, failures after a secret change |
| Managed identity sign-ins | AADManagedIdentitySignInLogs | An Azure resource obtained a token for its managed identity | Tokens for unexpected resources such as Key Vault or Graph |
| Audit logs | AuditLogs | A directory object or policy was changed | App credential added, consent, role assignment, method registered, Conditional Access change |
| Identity Protection | Risk detection and risky user tables | Microsoft scored a sign-in or user as risky | Anomalous 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
| Field | Values to know | Why it matters |
|---|---|---|
| ResultType / ResultDescription | 0 = success, anything else = failure or interrupt | Primary filter for spray, lockout and policy blocks |
| IsInteractive | true when the user provided a factor; false when a token or code was used | Separates human logons from token use |
| AuthenticationProtocol | none, oAuth2, ropc, wsFederation, saml20, deviceCode | ROPC and device code are rare in most tenants and abused often |
| ClientAppUsed | Browser, Modern clients, Exchange ActiveSync, IMAP, POP, SMTP, MAPI | Legacy protocols bypass MFA |
| ConditionalAccessStatus | success, failure, notApplied | notApplied on a privileged sign-in means a policy gap |
| AuthenticationRequirement | singleFactorAuthentication, multiFactorAuthentication | Single factor success for an admin is an alert in itself |
| IncomingTokenType, TokenIssuerType | For example a primary refresh token or SAML assertion; AzureAD or ADFederationServices | Federated tokens and PRT use change what "MFA satisfied" means |
| IPAddress, AutonomousSystemNumber, LocationDetails | IP, ASN, city and country | ASN baselines catch residential proxy and hosting provider abuse better than country alone |
| AppId, AppDisplayName, ResourceDisplayName | Client application and target resource | First-party client IDs used for Graph access from new networks |
| DeviceDetail | deviceId, operating system, browser, compliant, managed | Unmanaged device for a privileged account |
| SessionId, UniqueTokenIdentifier, CorrelationId | Session and token tracking identifiers | Pivot from one suspicious sign-in to every use of the same session |
| HomeTenantId, ResourceTenantId, CrossTenantAccessType | Tenant identifiers | Your users signing in to other tenants, or guests into yours |
| RiskLevelDuringSignIn, RiskEventTypes_V2, RiskState | none, low, medium, high, hidden | Risk 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
| ResultType | Microsoft meaning | Detection use |
|---|---|---|
| 50126 | Invalid username or password | Spray: many accounts, few attempts each, same IP, ASN or user agent |
| 50053 | Account locked (Smart Lockout) or sign-in blocked from a malicious IP | Brute force against one account, or Microsoft blocking a known bad source |
| 50074 | Strong authentication required and the user did not pass the MFA challenge | Repeated 50074 against one user suggests MFA fatigue |
| 50076 | MFA required by policy or because of a location change | Correct password from a new location: treat as a likely valid credential |
| 500121 | Authentication failed during strong authentication | Denied or failed MFA after a correct password |
| 53003 | Blocked by Conditional Access | Valid credential stopped by policy, still a compromised password |
| 50199 | Interrupt: user confirmation required for security reasons | 50199 followed by success within minutes is Microsoft's device code phishing pattern |
| 65001, 90094 | Consent missing; administrator consent required | Spikes 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
| Attack | ATT&CK | Log | Detection logic |
|---|---|---|---|
| Password spray | T1110.003 | SigninLogs | Distinct users with 50126 per IP or ASN per hour above baseline; low and slow variant across 24 hours |
| Valid cloud account from a new network | T1078.004 | SigninLogs, non-interactive | Success from an ASN never seen for the user in 30 days, especially hosting or residential proxy ranges |
| MFA fatigue | T1621 | SigninLogs | Three or more 50074 or 500121 for one user in 10 minutes, then success; "MFA denied, fraud code entered" in AuthenticationDetails |
| Device code phishing | T1566.002, T1528 | SigninLogs, AuditLogs | AuthenticationProtocol = deviceCode for users with no input-constrained device need; device registration shortly after |
| Token replay | T1550.001, T1539 | Non-interactive | Same SessionId seen from two ASNs or countries; Identity Protection anomalousToken or attackerinTheMiddle |
| Additional app credentials | T1098.001 | AuditLogs, SP sign-ins | "Update Application-Certificates and secrets management" outside change, then a new ServicePrincipalCredentialKeyId in sign-ins |
| Privileged role added | T1098.003 | AuditLogs | "Add member to role" or "Add eligible member to role" outside PIM, or for a service principal |
| Rogue device registration | T1098.005 | AuditLogs | "Add device" or "Add registered owner to device" for a user who did not enrol a device |
| MFA method tampering | T1556.006 | AuditLogs | "User registered security information" or "Admin registered security info" (Temporary Access Pass) after a password reset or from a new IP |
| Federation or trust change | T1484.002, T1606.002 | AuditLogs, SigninLogs | Domain authentication changed to federated, new federation certificate, TokenIssuerType = ADFederationServices where you do not federate |
| Hybrid identity abuse | T1556.007 | AuditLogs | New 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
*.AllorMail.*); "Add delegated permission grant" with ConsentTypeAllPrincipals. - 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
- 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.
- 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.
- 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.
- 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.
- 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
| Framework | Reference | How this guide supports it |
|---|---|---|
| NIST CSF 2.0 | PR.PS-04, DE.CM-03, DE.AE-02, DE.AE-03 | Log generation, monitoring personnel and technology use, analysis and correlation |
| NIST SP 800-53 Rev. 5 | AU-2, AU-6, AU-11, AU-12, AC-7, SI-4 | Event logging, review, retention, generation, unsuccessful logons, system monitoring |
| CIS Controls v8.1 | 8.2, 8.9, 8.10, 8.11 | Collect, centralise, retain and review audit logs |
| ISO/IEC 27001:2022 | Annex A 8.15, 8.16 | Logging; monitoring activities |
| MITRE D3FEND | D3-ANET Authentication Event Thresholding | Spray 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
- Microsoft Learn: What are Microsoft Entra sign-in logs?
- Microsoft Learn: Azure Monitor Logs reference, SigninLogs
- Microsoft Learn: Microsoft Entra authentication and authorization error codes
- Microsoft Learn: Security operations for privileged accounts in Microsoft Entra ID
- Microsoft Learn: Microsoft Entra security operations guide for applications
- Microsoft Learn: What are risk detections?
- Microsoft Learn: Microsoft Entra data retention
Related NHI Mgmt Group resources: Entra ID Security Guide · Microsoft 365 Unified Audit Log Guide for Detection · ITDR Guide · Identity Provider Tenant Compromise Playbook