Audit Logs and Workbooks

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 10 read · keep scrolling

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

Mastering Identity Governance: Audit Logs and Workbooks in Microsoft Entra ID

Introduction: Why Identity Monitoring Matters

In the modern digital landscape, identity is the new perimeter. As organizations transition away from traditional network-based security models, the ability to track, analyze, and report on who is doing what within your cloud environment has become the primary defense against unauthorized access and data breaches. Microsoft Entra ID (formerly Azure Active Directory) serves as the central identity provider for millions of users, and because of this, it is the most targeted component of an organization’s infrastructure. If you cannot see what is happening inside your identity provider, you are essentially flying blind.

Monitoring Microsoft Entra ID is not just about meeting regulatory compliance requirements; it is about operational awareness. Whether it is detecting a suspicious sign-in from an unfamiliar location, identifying a service principal that has been granted excessive permissions, or troubleshooting why a user cannot access a specific application, the Audit Logs and Workbooks are your primary diagnostic tools. This lesson explores how to navigate these logs, build meaningful visualizations, and maintain a high-security posture through proactive monitoring.


Not read yet

Understanding the Microsoft Entra ID Audit Logs

The Audit Logs in Microsoft Entra ID provide a comprehensive record of all system activities. Every time a user changes their password, an administrator modifies a group, or an application is registered, a log entry is generated. These logs are the "who, what, and when" of your directory. They are essential for forensic investigations, compliance reporting, and troubleshooting configuration issues.

The Anatomy of an Audit Log

When you look at an entry in the Audit Logs, you are seeing a structured data object. Understanding the components of this object is critical for effective searching and filtering. Each log entry typically contains the following fields:

  • Date and Time: Exactly when the activity occurred.
  • Target: The object that was changed (e.g., a user, a group, or an application).
  • Initiated By (Actor): The identity that performed the action. This could be a user, a service principal, or a system process.
  • Activity: The specific action taken, such as "Add member to group" or "Update user."
  • Status: Whether the action succeeded or failed.
  • Additional Details: A JSON-formatted blob containing specific property changes, such as the old value and the new value of an attribute.

Callout: Audit Logs vs. Sign-in Logs A common point of confusion is the difference between Audit Logs and Sign-in Logs. Audit Logs track changes to the directory configuration and objects (the "management plane"). Sign-in Logs track the authentication attempts of users and service principals (the "access plane"). You need both to build a complete picture of identity health.

Practical Search and Filter Techniques

Navigating the logs through the Entra portal is the most common starting point. However, simply scrolling through thousands of events is ineffective. To find relevant information, you must master the filtering capabilities:

  1. Date Range: Always start by narrowing the time window. If you are investigating a specific incident that occurred at 2:00 PM, filter for that hour rather than looking at the last 30 days.
  2. Service: Filter by the service involved. For example, if you are investigating changes to Conditional Access policies, filter by "Conditional Access."
  3. Category: Use categories to group actions. Common categories include "UserManagement," "ApplicationManagement," and "GroupManagement."
  4. Activity: This is the most granular filter. You can search for specific actions like "Delete user" or "Add service principal."

Not read yet

Automating Log Analysis with Log Analytics and KQL

While the portal is great for ad-hoc investigations, it does not scale for long-term trend analysis or complex correlation. To gain deeper insights, you should stream your Entra ID logs to an Azure Log Analytics workspace. Once the data is in Log Analytics, you can use Kusto Query Language (KQL) to perform powerful data analysis.

Getting Started with KQL

KQL is a read-only query language that is highly efficient for processing large datasets. Even if you are not a developer, learning a few basic KQL commands will make you far more effective at identity governance.

Example 1: Finding recent group membership changes

If you want to see who has been adding users to privileged groups, you can use a query like this:

AuditLogs
| where OperationName contains "Add member to group"
| project TimeGenerated, InitiatedBy.user.userPrincipalName, TargetResources[0].displayName, Result
| sort by TimeGenerated desc

In this query, we filter for a specific operation, project the relevant columns to make the output readable, and then sort by time. This allows you to quickly audit who is modifying sensitive groups.

Example 2: Tracking password resets

Tracking password resets is vital for identifying potential account takeovers.

AuditLogs
| where OperationName == "Reset user password"
| extend Actor = InitiatedBy.user.userPrincipalName
| extend Target = TargetResources[0].userPrincipalName
| project TimeGenerated, Actor, Target

Tip: Using the "Extend" Operator In KQL, the extend operator is your best friend. Microsoft Entra logs store data in nested JSON objects. Using extend allows you to "flatten" these objects into clear, top-level columns that you can easily read and export.


Not read yet

Leveraging Microsoft Entra Workbooks

Workbooks are the reporting engine of Microsoft Entra ID. They combine text, KQL queries, and interactive visualizations into a single, cohesive document. Instead of running the same KQL queries every day, you can save them into a Workbook that updates automatically.

Why Use Workbooks?

Workbooks solve the "dashboard fatigue" problem. Rather than having twenty different browser tabs open to monitor various identity metrics, you can create a single "Identity Health" workbook that displays:

  • Users with the most failed sign-ins.
  • Recent changes to high-privilege administrative roles.
  • A list of applications that have not been used in over 90 days.
  • Conditional Access policy success and failure rates.

Building a Custom Workbook

  1. Navigate to Entra ID: Go to the "Workbooks" blade in the Microsoft Entra admin center.
  2. Create New: Start with a blank template or use a pre-built one.
  3. Add Queries: Click "Add" and select "Query." Paste your KQL code into the editor.
  4. Visualize: Use the "Visualization" dropdown to choose between a bar chart, a pie chart, or a simple table.
  5. Parameters: Add parameters to your workbook, such as a time picker or a user dropdown, to make the report interactive for other team members.

Callout: Templates are Your Starting Point Microsoft provides many built-in workbook templates for common scenarios like "Sign-ins," "Conditional Access," and "Sensitive Operations." Do not reinvent the wheel. Start with a template, then customize the queries to match your organization’s specific naming conventions and security requirements.


Not read yet

Best Practices for Identity Monitoring

Monitoring is not a "set it and forget it" task. It requires a structured approach to ensure that the data you are collecting is actually useful and that you are not overwhelmed by noise.

1. Define Your "Crown Jewel" Objects

You cannot monitor everything with equal intensity. Identify the objects that represent the highest risk to your organization. This includes Global Administrator accounts, sensitive groups like "Domain Admins," and applications with high-privilege API permissions. Create specific alerts for any activity involving these assets.

2. Implement Alerting

Logs are reactive; alerts are proactive. Configure alerts in Azure Monitor so that you receive an email or a push notification when specific, high-risk events occur. For example, if a "Delete user" event occurs on an account with an administrative role, that should trigger an immediate alert to your security operations center (SOC).

3. Maintain Data Retention Policies

Log data is expensive to store in large volumes over long periods. Configure your Log Analytics workspace retention policy based on your organization's compliance needs. Typically, 30 to 90 days is sufficient for operational troubleshooting, while 1 year might be required for regulatory compliance.

4. Regularly Review Service Principals

Service principals (applications) are often forgotten. They are granted permissions and then left to run indefinitely. Use your Workbooks to identify applications that have not been used in the last 30 days and initiate a process to audit and potentially remove them.

Warning: The "Global Admin" Trap A common mistake is monitoring only human users. Service principals can be granted Global Administrator rights. If a service principal is compromised, the attacker has the same level of access as a human administrator. Always include service principals in your audit scopes.


Not read yet

Common Pitfalls and How to Avoid Them

Even experienced administrators fall into common traps when managing identity logs. Being aware of these pitfalls can save you hours of frustration.

Pitfall 1: Ignoring the "Additional Details"

Many administrators look only at the "Activity" column and ignore the "Additional Details" JSON. The activity might say "Update user," but it doesn't tell you what was updated. You must inspect the JSON content to see if the user’s email address was changed, their manager was updated, or their authentication methods were modified.

Pitfall 2: Over-Alerting (Alert Fatigue)

If you set an alert for every single login failure, your security team will quickly stop paying attention to alerts. Focus on alerts for "impossible travel," "brute force attacks," and "changes to sensitive roles." Filter out the noise of users simply forgetting their passwords.

Pitfall 3: Not Using Managed Identities

When building automation that interacts with Entra ID, developers often use hard-coded service principal secrets. If these secrets are leaked, they are difficult to rotate and track. Use Managed Identities wherever possible, as they do not require secret management and provide cleaner, more traceable logs in the Audit trail.

Pitfall 4: Relying on the 30-Day Portal Limit

The Microsoft Entra portal only keeps 30 days of logs. If you need to perform a forensic audit of an incident that happened two months ago, you will be unable to retrieve the data unless you have already set up log streaming to an external Log Analytics workspace. Set up your streaming as soon as you deploy your tenant.


Not read yet

Practical Step-by-Step: Setting Up Log Streaming

To ensure you have long-term visibility, follow these steps to stream your logs to Log Analytics:

  1. Create a Log Analytics Workspace: In the Azure portal, search for "Log Analytics workspaces" and create a new one. Choose a region that complies with your data residency requirements.
  2. Configure Diagnostic Settings: In the Microsoft Entra ID portal, navigate to "Diagnostic settings."
  3. Add Diagnostic Setting: Click "Add diagnostic setting."
  4. Select Logs: Check the boxes for AuditLogs, SignInLogs, and NonInteractiveUserSignInLogs.
  5. Select Destination: Choose "Send to Log Analytics workspace" and select the workspace you created in step 1.
  6. Save: Once saved, it may take up to 15 minutes for the first logs to appear in your workspace.

Once the data is flowing, you can use the "Logs" button within the workspace to start running the KQL queries we discussed earlier.


Not read yet

Comparison: Audit Logs vs. Other Monitoring Tools

Feature Audit Logs (Portal) Log Analytics (KQL) Microsoft Sentinel
Primary Use Ad-hoc investigation Deep analysis/Reporting Threat detection/SIEM
Retention 30 Days Configurable (Years) Configurable (Years)
Complexity Low Medium High
Automation None High (via Workbooks) Very High (via Playbooks)
Cost Included Pay-per-GB Pay-per-GB + Fixed

Advanced Monitoring: Integrating with SIEM

If your organization has a Security Information and Event Management (SIEM) system like Microsoft Sentinel, you should integrate your Entra ID logs directly into it. While Log Analytics is great for querying, a SIEM adds a layer of intelligence. It can correlate your identity logs with firewall logs, endpoint protection logs, and cloud infrastructure logs to detect complex, multi-stage attacks.

For example, if an attacker performs a "Password Spray" attack against your Entra ID (detected in your Sign-in logs) and then immediately accesses a sensitive file in your SharePoint (detected in your Office 365 logs), a SIEM can link these events together. This level of correlation is impossible to achieve by looking at individual log files.

The Role of Logic Apps

If you want to take action based on an audit event, consider using Azure Logic Apps. For instance, if an audit log detects that an account has been added to the "Global Administrator" role, you could trigger a Logic App that sends an automated request to the security team via Microsoft Teams, asking for confirmation that this change was authorized.

{
  "Action": "TriggerLogicApp",
  "Condition": "RoleAssignmentAdded",
  "Role": "Global Administrator",
  "Response": "SendTeamsMessage"
}

(This is a conceptual representation of how a workflow might be structured in a Logic App connector.)


Not read yet

Summary of Key Takeaways

To wrap up this module, remember that identity governance is a continuous cycle of observation and refinement. Use the following points as your guide:

  • Logs are foundational: The Audit and Sign-in logs are the single source of truth for your identity environment. Always ensure they are being streamed to a persistent storage location like Log Analytics.
  • Master the Query Language: KQL is the most important skill for an identity administrator. It transforms raw data into actionable insights and enables you to build custom reports.
  • Workbooks are your dashboard: Do not waste time manually filtering logs in the portal. Use Workbooks to build persistent, visual representations of your security posture.
  • Focus on the critical few: You cannot monitor everything with the same level of urgency. Prioritize your "crown jewel" accounts and roles, and set up automated alerts for any activity involving them.
  • Avoid the 30-day trap: Never rely on the default portal retention. Always configure diagnostic settings to export logs to a workspace where you control the retention period.
  • Correlate for context: Use SIEM tools to connect your identity logs with other telemetry sources to identify sophisticated, multi-vector attacks.
  • Automate your response: Use tools like Logic Apps to move beyond just "monitoring" and into "automated governance," where changes to sensitive configurations trigger verification workflows.

Monitoring Microsoft Entra ID is a journey, not a destination. As your organization grows and your identity landscape becomes more complex, your monitoring strategy must evolve. By consistently applying these principles, you will move from a reactive state—where you are only alerted to problems after they occur—to a proactive state, where you are actively maintaining the integrity and security of your digital identity perimeter.


Not read yet

Frequently Asked Questions (FAQ)

How do I know if my logging is configured correctly?

Go to the "Diagnostic settings" blade in Entra ID. If you see a row pointing to a Log Analytics workspace, you are set up. If the list is empty, you are currently relying on the default 30-day portal retention, which is a significant risk.

Is it expensive to store logs in Log Analytics?

The cost is based on the volume of data ingested and the length of time you store it. You can control costs by being selective about which logs you send and by setting a shorter retention period for less critical logs.

Can I monitor guest users differently than internal users?

Yes. You can use KQL to filter logs based on the userType attribute. This allows you to create specific workbooks that focus exclusively on external identity activity, which is a common vector for security incidents.

What should I do if I find a suspicious event?

First, isolate the account involved by disabling it or resetting its credentials. Second, investigate the "Initiated By" field to understand how the action was performed. Third, check the "Additional Details" to see the full scope of the change. Finally, review your Conditional Access policies to see why the activity was allowed in the first place and update your policies to prevent a recurrence.

Are there any performance impacts to monitoring?

No. Diagnostic settings operate asynchronously in the background. Enabling logging does not affect the sign-in speed or the performance of your applications. It is a strictly additive process that only consumes storage and compute resources on the monitoring side.

Not read yet

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