User and Entity Behavior Analytics UEBA
Earn 25 points (50 with Pro) in two steps
- ① Read through the lesson — each section gets a ✓ as you scroll through it.
- ② When every section has a ✓, tap Complete lesson.
0 of 11 read · keep scrolling
✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro
Mastering User and Entity Behavior Analytics (UEBA) in Microsoft Sentinel
Introduction: Why Behavioral Analytics Matters in Modern Security
In the landscape of modern cybersecurity, traditional signature-based detection methods—which rely on identifying known patterns of malicious code or specific file hashes—are no longer sufficient. Attackers have evolved to use living-off-the-land techniques, stolen credentials, and social engineering to bypass perimeter defenses. Once inside, an attacker often looks like a legitimate user performing legitimate tasks. This is where User and Entity Behavior Analytics (UEBA) becomes essential.
UEBA is a security process that focuses on identifying anomalies in the behavior of users, devices, applications, and network entities. Instead of looking for a specific indicator of compromise, UEBA establishes a baseline of "normal" behavior for every entity in your environment. When a user who typically accesses files from the office at 9:00 AM suddenly starts downloading massive amounts of data from a remote IP address at 3:00 AM, the UEBA system flags this as an anomaly. By shifting the focus from static rules to dynamic behavioral patterns, organizations can detect insider threats, compromised accounts, and lateral movement that would otherwise remain hidden in the noise of daily operations.
In this lesson, we will explore how Microsoft Sentinel implements UEBA, how to configure it, how to investigate the alerts it generates, and how to refine your detection strategies to reduce false positives.
Not read yet
Understanding the Architecture of UEBA in Sentinel
Microsoft Sentinel leverages machine learning (ML) models to process the vast amounts of data ingested into your workspace. It does not just look at individual logs; it correlates data across identity logs, sign-in logs, cloud activity, and endpoint telemetry to build a comprehensive picture of entity behavior.
How Data Flows into UEBA
The foundation of any effective UEBA implementation is high-quality data. Sentinel requires data sources that provide context about users and entities. This includes:
- Identity Data: Microsoft Entra ID (formerly Azure AD) sign-in logs and audit logs.
- Endpoint Data: Security events from servers and workstations, often collected via the Microsoft Monitoring Agent or Azure Monitor Agent.
- Cloud Activity: Logs from Microsoft 365, Azure resources, and third-party SaaS applications.
- Network Logs: DNS logs, firewall logs, and VPN logs that help track connection patterns.
Once this data is ingested, Sentinel runs pre-built ML models that perform peer group analysis, frequency analysis, and time-series analysis. For example, if a user belongs to the "Accounting" department, Sentinel compares their behavior against the baseline of all other users in that department to determine if their actions are truly anomalous or simply part of their job function.
Callout: UEBA vs. Traditional SIEM Rules Traditional SIEM rules are "if-then" statements: "If a user fails to log in five times in one minute, trigger an alert." This is rigid and prone to missing subtle, slow-burning attacks. UEBA, by contrast, is probabilistic: "This user usually logs in from New York, but today they logged in from a country they have never visited, and they are accessing a server they have never touched." UEBA provides the context that transforms a simple alert into a meaningful security story.
Not read yet
Enabling and Configuring UEBA in Microsoft Sentinel
Enabling UEBA in Sentinel is a straightforward process, but it requires careful planning regarding data ingestion and cost management. Since UEBA processes significant volumes of data, you should ensure that your workspace is configured to handle the increased load.
Step-by-Step: Enabling UEBA
- Navigate to the Sentinel Portal: Open your Microsoft Sentinel workspace in the Azure portal.
- Locate Configuration: Under the Configuration section in the left-hand navigation menu, select Entity behavior.
- Enable the Feature: Click on the Turn on button. You will be prompted to select the data sources you want to include in your behavior analysis.
- Select Data Sources: Choose the tables that provide identity and activity information. It is highly recommended to include Entra ID sign-in logs and security events.
- Save and Monitor: Once enabled, Sentinel will begin the "learning phase." This phase typically lasts for 7 to 14 days, during which the system builds the baseline for your users and entities.
Note: Do not expect immediate, high-fidelity alerts the moment you turn on UEBA. The system needs time to observe patterns. During the first two weeks, prioritize observing the data rather than creating aggressive automated response rules based on UEBA insights.
Not read yet
Analyzing Behavioral Insights: The Entity Page
Once your baselines are established, the most powerful tool at your disposal is the Entity Page. This page aggregates all activity related to a specific user or device, providing a single pane of glass for investigation.
Key Components of an Entity Page
- Timeline: A chronological view of all activities, alerts, and anomalies associated with the entity. This allows investigators to see the "before and after" of a potential incident.
- Insights: A summary of anomalous behaviors, such as "Unusual sign-in location" or "Access to sensitive file shares."
- Behavioral Indicators: Specific metrics that indicate how much a user's current behavior deviates from their historical norm.
- Peer Analysis: A breakdown of how the user's activity compares to others in their department or organizational unit.
Practical Example: Investigating a Compromised Account
Imagine an analyst receives an alert for "Unusual resource access." Instead of just looking at the log entry, the analyst navigates to the Entity Page for the user in question. They notice:
- The user logged in from a new IP address in a different region.
- Within five minutes, the user accessed an Azure Key Vault they had never touched before.
- The user then initiated a large data transfer to an external storage provider.
By seeing these three events on a single timeline, the analyst quickly confirms this is a compromised account scenario rather than a benign mistake, allowing for immediate account revocation and password reset.
Not read yet
Writing KQL Queries for Behavioral Investigations
While Sentinel provides automated insights, you will often need to perform manual hunting using Kusto Query Language (KQL). Understanding how to query the data that powers UEBA is a critical skill for any security analyst.
Example: Identifying Abnormal Sign-ins
This query helps you find users who are signing in from locations they have never used before, which is a common indicator of credential theft.
// Identify sign-ins from new locations
let historical_data = SigninLogs
| where TimeGenerated > ago(30d) and TimeGenerated < ago(1d)
| summarize KnownLocations = make_set(Location) by UserPrincipalName;
SigninLogs
| where TimeGenerated > ago(1d)
| join kind=leftouter (historical_data) on UserPrincipalName
| where not(set_has_element(KnownLocations, Location))
| project TimeGenerated, UserPrincipalName, IPAddress, Location, AppDisplayName
Explanation of the Query:
- We create a
historical_datavariable that aggregates all known locations for each user over the past 30 days. - We then look at the last 24 hours of sign-in logs.
- We use a
leftouter jointo compare current logins against the known history. - The
where not(set_has_element(...))filter isolates only those logins where the current location is not found in the historical set.
Example: Detecting Lateral Movement
This query looks for a user connecting to a new server via RDP, which is a common technique for attackers moving through a network.
// Find RDP connections to servers the user has never accessed
let UserServerHistory = SecurityEvent
| where EventID == 4624 and LogonType == 10
| summarize KnownServers = make_set(Computer) by Account;
SecurityEvent
| where EventID == 4624 and LogonType == 10
| join kind=leftouter (UserServerHistory) on Account
| where not(set_has_element(KnownServers, Computer))
| project TimeGenerated, Account, Computer, IpAddress
Tip: When writing KQL for behavioral analysis, always use a sufficient lookback period. If your baseline is too short (e.g., 3 days), you will get a flood of false positives. A 30-day lookback is generally considered the "sweet spot" for most organizations.
Not read yet
Best Practices for Managing UEBA
Implementing UEBA is not a "set it and forget it" task. To be successful, you must integrate it into your existing security operations workflow.
1. Tune Your Baselines
Not every anomaly is a threat. If a user is part of a special project that requires them to access new servers or work at odd hours, their behavior will naturally deviate from the norm. Use the Sentinel suppression rules to account for these legitimate exceptions, ensuring your analysts aren't chasing ghosts.
2. Prioritize High-Confidence Alerts
UEBA can generate a lot of data. Focus your initial efforts on alerts with high-confidence scores. These are typically cases where multiple behavioral anomalies occur in a short window of time, indicating a higher probability of malicious intent.
3. Integrate with SOAR
Use Microsoft Sentinel Playbooks (Logic Apps) to automate the response to UEBA alerts. For instance, if a user displays high-risk behavior that matches a specific threshold, you can trigger a playbook that automatically forces a password reset or requires a Multi-Factor Authentication (MFA) challenge.
4. Regularly Review Entity Pages
Encourage your Tier 2 and Tier 3 analysts to use the Entity Page as their primary investigation tool. The more they use it, the better they will become at identifying the subtle patterns that precede a major security incident.
Not read yet
Common Pitfalls and How to Avoid Them
Even experienced teams fall into common traps when implementing behavioral analytics. Awareness of these pitfalls is the first step toward avoiding them.
Pitfall 1: Data Silos
The Problem: Only ingesting logs from one source (e.g., just Entra ID). The Fix: UEBA thrives on correlation. You must ingest logs from endpoints, network devices, and cloud applications. If you only look at sign-ins, you miss what the attacker does after they log in.
Pitfall 2: Ignoring the "Learning Phase"
The Problem: Trying to act on alerts during the first few days of deployment. The Fix: Be patient. Allow the ML models to digest at least two weeks of data. If you act too early, your analysts will be overwhelmed by false positives, leading to "alert fatigue," where they start ignoring the system entirely.
Pitfall 3: Over-complicating Detection Rules
The Problem: Creating overly specific, complex KQL queries that break when the environment changes. The Fix: Keep your queries modular. Focus on the behavior (e.g., "new server access") rather than the implementation (e.g., "accessing server X with tool Y"). Use variables and functions to keep your code readable and maintainable.
Callout: The "Alert Fatigue" Reality A common mistake is to treat every anomaly as a critical incident. In reality, most anomalies are just users doing their jobs in new ways. Use the "Investigation Priority Score" provided by Sentinel to triage. Only escalate incidents where the score exceeds a threshold that your team can realistically manage.
Not read yet
Comparison: Traditional Detection vs. UEBA
| Feature | Traditional Detection | UEBA (Behavioral) |
|---|---|---|
| Logic | Static, rule-based | Dynamic, ML-based |
| Focus | Known bad patterns (signatures) | Deviations from normal behavior |
| Context | Limited to individual events | Holistic, entity-centric |
| Maintenance | High (must update rules frequently) | Moderate (requires tuning baselines) |
| Strength | Excellent for known threats | Excellent for unknown/insider threats |
Step-by-Step: Creating a Custom Behavioral Alert
While Sentinel’s built-in UEBA features are powerful, you may eventually want to create a custom alert based on a specific behavioral pattern unique to your organization.
Scenario: Detecting "Impossible Travel" for Service Accounts
Service accounts should generally not be moving around the globe. If a service account logs in from two distant locations within a short timeframe, it is a massive red flag.
- Open the Analytics Rule Wizard: In Sentinel, go to Analytics and click Create > Scheduled query rule.
- Define the Query:
SigninLogs | where ResultType == 0 | summarize FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Locations = make_set(Location) by UserPrincipalName, IPAddress | extend Lat = geo_info_from_ip_address(IPAddress).latitude, Lon = geo_info_from_ip_address(IPAddress).longitude | // Add distance calculation logic here - Set the Threshold: Define the time window for the "impossible travel" (e.g., 2 hours).
- Configure Mapping: Map the
UserPrincipalNameto theAccountentity and theIPAddressto theIPentity. This ensures that when the alert fires, it is automatically linked to the correct user in the Entity Page. - Enable Automation: Link the alert to a playbook that notifies your security team via Microsoft Teams or Slack.
Not read yet
Advanced Considerations: Entity Risk Scoring
Microsoft Sentinel calculates an "Investigation Priority Score" for every user and entity. This score is a dynamic value that increases when the entity exhibits anomalous behavior.
How the Score Works
The score is calculated based on the severity and frequency of the anomalies. A single minor anomaly (like a login from a new browser) might only add a few points to the score. However, a major anomaly (like an unusual administrative action) will add a significant number of points. When the total score for an entity crosses a predefined threshold, Sentinel generates an incident.
Why this matters
This scoring mechanism allows you to filter out the noise. You don't need to alert on every single anomaly; you only need to alert when the cumulative evidence suggests that something suspicious is happening. This is the core of modern, effective threat detection.
Not read yet
Troubleshooting Common Issues
Even with a well-configured system, you may encounter issues. Here is how to handle the most common ones:
Issue: "No data" or "Insufficient data" errors
- Check Data Connectors: Ensure the relevant connectors (e.g., Microsoft Entra ID) are active and healthy.
- Check Workspace Limits: If your workspace is hitting ingestion limits, Sentinel might drop data, causing the ML models to fail.
Issue: Too many false positives
- Revisit Baselines: Are there specific user groups (like IT admins or developers) that perform tasks that look "anomalous" to the system? You may need to create a separate "peer group" for these users.
- Tuning: Use the Entity behavior settings to adjust the sensitivity of the ML models. If the system is too sensitive, increase the threshold for what constitutes an anomaly.
Issue: Alerts are not showing up in the Incident Queue
- Check Automation Rules: Ensure that your analytics rules are configured to create incidents.
- Severity Filters: Ensure that your incident queue view is not filtering out lower-severity alerts that might be generated by UEBA.
Not read yet
Summary and Key Takeaways
User and Entity Behavior Analytics is a cornerstone of a proactive security strategy in Microsoft Sentinel. By moving away from static rules and embracing behavioral baselines, you can detect sophisticated threats that rely on compromised credentials or insider access.
Key Takeaways:
- Shift to Behavioral: Traditional detection is necessary but not sufficient. UEBA provides the context required to identify "low and slow" attacks that bypass perimeter security.
- Data is Foundation: The quality and breadth of your data dictate the quality of your insights. Ensure comprehensive ingestion of identity, endpoint, and network logs.
- Patience is Key: Never skip the learning phase. Allowing Sentinel 14+ days to baseline your environment is essential to preventing alert fatigue.
- Use the Entity Page: Make the Entity Page the primary destination for your investigations. It consolidates the "who, what, when, and where" of an incident.
- KQL is Your Lever: Learning KQL allows you to move beyond built-in alerts and hunt for specific, high-value behavioral patterns unique to your organization.
- Automate for Scale: Use playbooks to handle repetitive tasks, such as account suspension or MFA challenges, when a high-risk score is detected.
- Iterate and Tune: UEBA is an evolving process. Regularly review your alerts, tune your baselines, and adjust your sensitivity thresholds to keep your security posture aligned with your business needs.
By following these practices, you will transform your security operations from a reactive, alert-chasing team into a proactive unit capable of identifying and mitigating threats before they turn into full-scale breaches. Remember, the goal of UEBA is not to alert on everything, but to highlight what truly matters.
Not read yet
Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.
- Investigate Security Incidents
- Investigate Security Incidents Quiz5q
- Manage Incidents in Defender Portal
- Manage Incidents in Defender Portal Quiz5q
- Investigate Alerts and Alert Queues
- Investigate Alerts and Alert Queues Quiz5q
- Automated Investigation and Response
- Automated Investigation and Response Quiz5q
Spend your points to unlock exam-style practice questions
Spend points to unlock SC-200 exam-style practice questions.
Practice for SC-200