Sign-In Logs Analysis

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 9 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Lesson: Mastering Sign-In Logs Analysis in Microsoft Entra ID

Introduction: The Critical Role of Identity Monitoring

In the modern digital landscape, the perimeter of your organization is no longer defined by a physical office wall or a corporate firewall. Instead, the perimeter has shifted to the identity of the user. When your employees, partners, and applications connect to your resources, they do so using credentials managed by Microsoft Entra ID (formerly Azure Active Directory). Because the identity is now the primary gateway, understanding exactly how, when, and from where users are accessing your environment is the single most important task for any identity administrator.

Sign-in logs are the heartbeat of your identity security posture. They provide a granular, chronological record of every authentication attempt made against your tenant. Whether a user is logging into their email, an administrator is accessing the management portal, or an automated service principal is retrieving a secret, these events are captured in the sign-in logs. Without a proactive strategy for analyzing these logs, you are effectively flying blind, unable to distinguish between a legitimate business process and a sophisticated credential-stuffing attack.

This lesson is designed to take you beyond simply knowing where the logs are located. We will explore how to interpret the data, identify patterns of suspicious behavior, automate the detection of anomalies, and maintain a hygiene-focused approach to identity governance. By the end of this guide, you will have the technical knowledge and the analytical framework required to turn raw log data into actionable security intelligence.


Not read yet

Understanding the Anatomy of a Sign-In Log

Before we can analyze the data, we must understand the structure of the information Microsoft Entra ID provides. A sign-in log entry is not merely a "success" or "failure" message; it is a rich data object containing dozens of attributes that provide context to the authentication event.

Key Data Categories

To make sense of the logs, we categorize the information into several logical buckets:

  • User Information: This includes the User Principal Name (UPN), the user ID, and the user type (member or guest). It identifies who is attempting the action.
  • Authentication Details: This section details the authentication method used, such as password, multi-factor authentication (MFA), or FIDO2 security keys. It also lists the status of the request, including the specific error code if the sign-in failed.
  • Device and Client Information: This category provides details about the browser, operating system, and the device ID. It tells you what tool was used to access the resource.
  • Network and Location: This includes the source IP address, the city, state, and country of origin, and the ISP associated with that IP. This is crucial for detecting impossible travel or access from unexpected geographic regions.
  • Risk Data: Entra ID assigns risk scores to sign-ins based on internal threat intelligence. This tells you if the identity protection engine flags the login as a potential compromise.

Callout: The Difference Between Sign-In Types It is vital to distinguish between Interactive, Non-interactive, and Service Principal sign-ins. Interactive sign-ins involve a user providing credentials directly. Non-interactive sign-ins are performed by client apps (like Outlook or Teams) on behalf of a user using refresh tokens. Service Principal sign-ins involve automated applications or scripts. Misinterpreting these types often leads to "false positive" alerts, such as flagging a background sync process as a suspicious login.


Not read yet

Step-by-Step: Accessing and Filtering Logs

Navigating the Microsoft Entra admin center is the first step in your analysis journey. While you can export these logs to external systems, understanding the native interface is essential for quick investigations.

Navigating the Portal

  1. Log in to the Microsoft Entra admin center.
  2. Navigate to Monitoring & health in the left-hand menu.
  3. Select Sign-in logs.
  4. You will see three tabs at the top: Interactive, Non-interactive, and Service principal.

Mastering the Filter Interface

The filter bar is your most powerful tool for narrowing down millions of events to the few that matter. You should practice using the following filters:

  • Status: Filter by "Failure" to immediately see who is having trouble or who is being blocked.
  • Date Range: Narrow your view to the last 24 hours for incident response, or the last 30 days for pattern analysis.
  • Risk Level: Filter by "High," "Medium," or "Low" to focus on events where Microsoft’s threat intelligence has already identified a potential issue.
  • Application: Filter by specific apps (e.g., "Office 365 Exchange Online") to isolate sign-in issues related to specific services.

Tip: Use the "Add Filters" option liberally. Do not rely on the default view. If you are investigating a specific user, use the "User" filter. If you are investigating a suspicious IP address, use the "IP address" filter. Combining these filters allows you to drill down into specific attack vectors.


Not read yet

Advanced Analysis: Detecting Suspicious Patterns

Once you can access the logs, the real work begins: pattern recognition. Security incidents rarely announce themselves with a single clear alert; they often manifest as subtle deviations from the baseline.

1. Impossible Travel Detection

Impossible travel occurs when a user signs in from two locations that are geographically distant within a timeframe that makes it physically impossible for them to have traveled between them. While Entra ID has built-in risk detections for this, you should verify these manually by looking for sign-ins from the same user ID with different IP addresses and wildly different geographic locations within a short window.

2. High-Frequency Failure (Brute Force)

A sudden spike in failed sign-ins for a single user account is a classic sign of a password spraying or brute force attack. When analyzing logs, look for a high volume of failure codes such as 50126 (Invalid password) or 50053 (Account locked). If you see hundreds of these in a few minutes from a single IP address, you are witnessing an active attack.

3. Unusual User-Agent Strings

Attackers often use custom scripts or outdated libraries to automate login attempts. By examining the "Device" tab in the sign-in log, you can identify browsers or operating systems that don't match your company’s standard image. If you see a sign-in from a "Python-requests" library or an ancient version of Internet Explorer, it should trigger an immediate investigation.

4. Access from Known Bad IPs

If you have access to threat intelligence feeds, you can cross-reference the IP addresses in your logs against known malicious actors. Even without external feeds, you can look for sign-ins coming from anonymizing services like Tor exit nodes or public VPNs that are not sanctioned by your organization.


Not read yet

Automating Log Analysis with KQL

While the portal is great for ad-hoc investigations, it is not scalable for deep, automated analysis. For that, you need to use Kusto Query Language (KQL) within Log Analytics Workspaces. This is the industry standard for enterprise-level identity monitoring.

Why KQL?

KQL allows you to perform complex calculations, aggregations, and joins that the web interface cannot handle. You can write queries to summarize activity, calculate the duration between events, and create custom alerts.

Example: Identifying Failed Sign-ins by User

This query retrieves a list of users who have had more than 10 failed sign-ins in the last hour:

SigninLogs
| where TimeGenerated > ago(1h)
| where ResultType != 0
| summarize FailedCount = count() by UserPrincipalName, IPAddress
| where FailedCount > 10
| sort by FailedCount desc

Explanation of the Query:

  1. SigninLogs: This is the table containing the data.
  2. where TimeGenerated > ago(1h): We filter the time window to the last hour to focus on active threats.
  3. where ResultType != 0: A result type of 0 indicates success. Therefore, we filter for everything that is not success.
  4. summarize FailedCount = count() by UserPrincipalName, IPAddress: This groups the data by user and IP, counting the failures for each combination.
  5. where FailedCount > 10: We filter out the "noise" of occasional typos and only show significant patterns.

Warning: Avoid "Log Overload" When setting up automated alerts, do not alert on every single failure. You will quickly encounter "alert fatigue," where your team begins to ignore notifications because they are constantly flooded with minor, non-critical events. Focus your alerts on anomalies, such as a high volume of failures from a single IP or successful logins from unexpected countries.


Not read yet

Best Practices for Log Maintenance and Hygiene

Logging is only useful if the data is reliable, accessible, and compliant with your organization’s retention policies.

1. Establish a Retention Policy

By default, Microsoft Entra ID stores logs for a limited period (usually 30 days in the standard portal). If you need to perform forensic analysis on an attack that occurred months ago, you will be out of luck. You must stream your logs to an Azure Log Analytics Workspace or an external SIEM (Security Information and Event Management) system like Microsoft Sentinel.

2. Implement Diagnostic Settings

You cannot rely on the portal alone. You must configure Diagnostic Settings to export sign-in logs to a Storage Account or a Log Analytics Workspace. This ensures that you maintain a long-term archive for compliance audits and historical threat hunting.

3. Regular Audits of Service Principals

Service Principals are often overlooked because they don't have "users" behind them. However, they are high-value targets. If a Service Principal is compromised, an attacker can gain persistent access to your cloud resources. Regularly audit the logs for Service Principals to ensure they are only accessing the resources they are explicitly authorized to use.

4. Integration with Microsoft Sentinel

If your organization is large enough, integrate Entra ID logs with Microsoft Sentinel. Sentinel uses machine learning to correlate sign-in events with other data sources (like endpoint logs or firewall logs), providing a much clearer picture of an attack lifecycle.


Not read yet

Common Pitfalls and How to Avoid Them

Even experienced administrators fall into common traps when analyzing identity logs. Here is how to avoid the most frequent mistakes:

  • Ignoring Non-Interactive Sign-ins: Many admins focus exclusively on interactive logs. However, attackers often use refresh tokens to maintain access. If you ignore non-interactive logs, you might miss an attacker who is already "inside" your environment.
  • Misinterpreting "Success": A successful login does not mean the user is authorized. Always check the application being accessed. A user might successfully log into an application they should not have access to, which is a compliance issue, not necessarily a security breach.
  • Over-reliance on IP Filtering: Attackers frequently cycle through residential proxy networks. An IP that is "clean" today might be part of a botnet tomorrow. Use IP filtering as one layer, but always combine it with other signals like device compliance and risk scores.
  • Lack of Context: Never look at a log entry in isolation. Always look at the user’s history. Has this user ever logged in from this browser before? Is this the time of day they usually work? Context is what turns a data point into a security insight.

Not read yet

Comparison: Manual Analysis vs. Automated SIEM

Feature Manual Portal Analysis SIEM/Sentinel Integration
Data Scope Limited to last 30 days Years of historical data
Analysis Speed Slow, manual, ad-hoc Near real-time, automated
Correlation None (siloed data) Cross-source correlation
Alerting Manual checks required Automated, intelligent alerts
Complexity Low (easy to use) High (requires KQL expertise)

Frequently Asked Questions (FAQ)

Q: Why do I see so many "Success" sign-ins for a user who is on vacation?

A: This is likely due to non-interactive sign-ins. Applications like Outlook or OneDrive on the user's mobile device refresh their tokens periodically in the background. Check the "Non-interactive" tab to confirm these are coming from known devices.

Q: What is the difference between "ResultType" and "ResultSignature"?

A: ResultType is the general category of the outcome (success or failure). ResultSignature provides the specific error code, which is essential for troubleshooting. For example, ResultType might show "Failure," while ResultSignature shows 50126, telling you exactly why the login failed (invalid credentials).

Q: How do I know if an IP address is a VPN or a Proxy?

A: Microsoft Entra ID does not always explicitly label an IP as a VPN. You may need to use external "IP reputation" services or geo-location APIs to identify if an IP range belongs to a known VPN provider or a data center.

Q: Can I block a user directly from the sign-in log?

A: You cannot block a user directly inside the log viewer. However, you can use the information from the log to identify the user and then navigate to the user's profile to disable their account or force a password reset.


Not read yet

Key Takeaways for Identity Governance

  1. Identity is the Perimeter: Treat sign-in logs as the primary source of truth for your security posture. If it isn't in the logs, it didn't happen—and if it is in the logs, you need to be watching it.
  2. Understand the Data Types: You must be able to distinguish between Interactive, Non-interactive, and Service Principal sign-ins to avoid chasing false positives.
  3. Leverage KQL for Scale: Learn the basics of Kusto Query Language. It is the only way to effectively analyze logs in an enterprise environment and create meaningful, proactive alerts.
  4. Prioritize Long-Term Retention: Ensure your logs are being exported to a long-term storage solution like a Log Analytics Workspace. You cannot perform a forensic investigation on data you no longer possess.
  5. Context is King: Never judge a sign-in event by the IP address alone. Use the full context—time of day, device health, user behavior, and application access—to make an informed decision about the legitimacy of an event.
  6. Avoid Alert Fatigue: Fine-tune your monitoring rules. If you alert on every minor error, your security team will eventually ignore the dashboard. Alert only on high-confidence anomalies.
  7. Continuous Improvement: The threat landscape changes daily. Review your log analysis queries and alert configurations at least quarterly to ensure they are still effective against current attack techniques.

By mastering the analysis of sign-in logs, you move from a reactive state of "putting out fires" to a proactive state of "preventing arson." Use these tools, practice your queries, and keep a watchful eye on your identity environment—it is the most important asset you are tasked with protecting.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.