<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Identity - Modern Security</title><link>https://www.modernsecurity.nl/identity/</link><description>Deep-dive articles on identity security, identity protection, attack detection, and Zero Trust identity design in Microsoft environments.</description><language>en-us</language><copyright>© 2026 Modern Security</copyright><generator>Hugo</generator><lastBuildDate>Sun, 05 Jul 2026 08:46:45 +0100</lastBuildDate><atom:link href="https://www.modernsecurity.nl/identity/index.xml" rel="self" type="application/rss+xml"/><image><url>https://www.modernsecurity.nl/img/logo-light_hu_98d13a0e48fc51de.png</url><title>Identity - Modern Security</title><link>https://www.modernsecurity.nl/identity/</link></image><item><title>Identity attack graph in Microsoft Sentinel: easy find lateral movement paths</title><link>https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/</link><guid isPermaLink="true">https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/</guid><pubDate>Sat, 09 May 2026 19:17:30 +0100</pubDate><dc:creator>Farid Kalaidji</dc:creator><category>Identity</category><category>Microsoft Entra ID (Azure AD)</category><category>Microsoft Sentinel</category><description>Map lateral movement paths across Entra and Azure. Step-by-step setup guide for the Microsoft Sentinel identity attack graph.</description><content:encoded><![CDATA[<p>Sentinel graph ships with two layers. One is custom graphs, where you build your own schema from any data in the lake, which I will cover in a new blog post later. The other is a set of Microsoft-managed graphs that require no authoring at all.</p>
<p>The identity attack graph is the most useful of those managed graphs. Enable two connectors, turn on the graph, wait for the initial build, and you have a query-able model of how identities in your tenant connect to Azure resources through permissions and group memberships. No notebooks, no schema design, no GQL to write upfront.</p>
<p><strong>The graph is currently in preview</strong></p>

<h2 class="relative group">What it shows you
    <div id="what-it-shows-you" class="anchor"></div>
    
</h2>
<p>The identity attack graph models three things: identities (users, service principals, managed identities, groups), Azure resources (subscriptions, resource groups, VMs, storage accounts, Key Vaults), and the access relationships connecting them via role assignments and group memberships.</p>
<p>The focus is lateral movement paths, not just direct access. A user who is a member of a group that has a role assignment on a subscription containing a Key Vault is three hops from that Key Vault. That chain doesn’t appear in a flat permissions table. It appears in a graph because each of those relationships is modelled as an edge you can traverse.</p>
<p>It’s built to answer questions like:</p>
<ul>
<li>What resources could an attacker reach if this account is compromised?</li>
<li>Which identities have indirect paths to privileged roles?</li>
<li>Which service principals can reach VMs, and via how many hops?</li>
<li>Are there circular group memberships creating unintended privilege inheritance?</li>
</ul>
<p>The predefined queries surface these without any GQL knowledge required. You can also write your own once you’re familiar with the schema.</p>

<h2 class="relative group">Prerequisites
    <div id="prerequisites" class="anchor"></div>
    
</h2>

<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th>Requirement</th>
              <th>Details</th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td><strong>Microsoft Sentinel data lake</strong></td>
            <td>Must be enabled. The identity attack graph reads from the data lake tier and won’t work without it.</td>
        </tr>
        <tr>
            <td><strong>Microsoft Entra ID Assets connector</strong></td>
            <td>Required. Provides identity data: users, groups, service principals, managed identities, and the relationships between them.</td>
        </tr>
        <tr>
            <td><strong>Azure Resource Graph connector</strong></td>
            <td>Required. Provides Azure subscription and resource hierarchy.</td>
        </tr>
        <tr>
            <td><strong>Role to create the graph</strong></td>
            <td>Global Administrator or Security Administrator.</td>
        </tr>
    </tbody>
  </table>
</div>
<p>Both connectors are bundled in their respective Sentinel solution packages. If not yet installed, find them in Content Hub under <strong><a href="https://www.modernsecurity.nl/microsoft-sentinel/" >Microsoft Sentinel</a></strong> &gt; <strong>Content Management</strong> &gt; <strong>Content Hub</strong>.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Azure Resource Graph solution installed from the Sentinel Content hub"
    width="1919"
    height="998"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image_hu_ba4e51b0f6759177.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image.webp"></figure><figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Microsoft Entra ID Assets solution installed from the Sentinel Content hub"
    width="1919"
    height="995"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-7_hu_d2186a1b06479634.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-7.webp"></figure><p>Asset data snapshots are taken once every 24 hours. After enabling a connector, data can take up to 24 hours to arrive in the lake. Initial graph processing after that can take up to 48 hours. Enable this well before you need it for an investigation.</p>

<h2 class="relative group">One thing most guides don’t mention: ARG connector coverage
    <div id="one-thing-most-guides-dont-mention-arg-connector-coverage" class="anchor"></div>
    
</h2>
<p>The Azure Resource Graph connector has a coverage limitation worth understanding before you enable it.</p>
<p>When enabled, its managed identity is automatically granted the Reader role only on subscriptions where <em>you</em> have the Owner role. If you don’t have Owner across your entire Azure estate (most people don’t), the connector ingests a partial view. The graph gets built, but it won’t include resources from subscriptions the managed identity can’t read.</p>
<p>In my case I had the owner permissions and the identity was correctly setup:</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Reader role assigned to the msg-resources managed identity on the tenant root management group"
    width="1919"
    height="995"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-1_hu_ab7e9526545e9bb0.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-1.webp"></figure><p>To get full tenant coverage, someone with elevated permissions needs to assign the Reader role to the connector’s managed identity at a broader scope if it failed. The managed identity is named <code>msg-resources-</code> followed by an alphanumeric ID, for example <code>msg-resources-b05e</code>. Reader can be assigned at:</p>
<ul>
<li><strong>Tenant root management group</strong> covers all subscriptions in the tenant</li>
<li>A specific <strong>management group</strong> covers a subset</li>
<li>Individual <strong>subscriptions</strong> covers only those</li>
</ul>
<p>Steps to assign:</p>
<ol>
<li>
<p>Navigate to the scope you want to cover, for example Tenant Root Group &gt; <strong>Access control (IAM)</strong></p>
</li>
<li>
<p>Select <strong>+ Add</strong> &gt; <strong>Add role assignment</strong></p>
</li>
<li>
<p>Assign the <strong>Reader</strong> role to the managed identity</p>
</li>
<li>
<p>Locate the <code>msg-resources-*</code> managed identity and complete the assignment</p>
</li>
</ol>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Selecting the managed identity for the Reader role assignment"
    width="1919"
    height="999"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-2_hu_f4ecacb19df53aaf.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-2.webp"></figure><p>After the assignment propagates, the next ingestion cycle picks up the additional resources. Up to 24 hours for the new data to appear in the lake.</p>
<p>If your graph is missing subscriptions or resources you’d expect to find, this is almost certainly the reason.</p>

<h2 class="relative group">Setting up the identity attack graph
    <div id="setting-up-the-identity-attack-graph" class="anchor"></div>
    
</h2>

<h3 class="relative group">Step 1: Navigate to Graphs
    <div id="step-1-navigate-to-graphs" class="anchor"></div>
    
</h3>
<p>In the Microsoft Defender portal, go to <strong>Microsoft Sentinel</strong> &gt; <strong>Graphs</strong>.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Graphs page in Sentinel with the identity attack graph available to set up"
    width="1919"
    height="997"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-3_hu_9343ac3a3f515db6.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-3.webp"></figure>
<h3 class="relative group">Step 2: Set up the graph
    <div id="step-2-set-up-the-graph" class="anchor"></div>
    
</h3>
<p>Find the <strong>identity attack graph</strong> card and select <strong>Set up graph</strong>.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Identity attack graph setup with Azure Resource Graph and Entra ID data connected"
    width="1919"
    height="997"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-4_hu_7069c80c24b0c0d9.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-4.webp"></figure>
<h3 class="relative group">Step 3: Enable the required connectors
    <div id="step-3-enable-the-required-connectors" class="anchor"></div>
    
</h3>
<p>The setup flow walks you through both connectors:</p>
<ul>
<li><strong>Microsoft Entra ID</strong> <strong>Assets</strong> covers identity data, group memberships, and service principals</li>
<li><strong>Azure Resource Graph</strong> covers Azure subscriptions and resource hierarchy</li>
</ul>
<p>If either is not yet installed, go to Content Hub first and install the relevant solution. Already installed but not enabled, the setup flow will prompt you to turn them on.</p>
<p>This is also the point to think about ARG connector coverage. If full tenant coverage matters for your use case, sort out the managed identity Reader assignment before continuing.</p>

<h3 class="relative group">Step 4: Turn on the graph
    <div id="step-4-turn-on-the-graph" class="anchor"></div>
    
</h3>
<p>Select <strong>Turn on graph</strong>. The graph starts ingesting data and building its relationship model.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Turn on graph confirmation dialog with the cost notice"
    width="1919"
    height="999"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-5_hu_3253b8c9213e1e82.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-5.webp"></figure><p>Initial processing can take up to 48 hours. The graph is not query-able until the first build completes.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Identity attack graph turning on in the Graphs page"
    width="1919"
    height="997"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-6_hu_4fa0a751c99a88ee.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-6.webp"></figure>
<h3 class="relative group">Step 5: Open the query interface
    <div id="step-5-open-the-query-interface" class="anchor"></div>
    
</h3>
<p>When the graph shows as ready, select <strong>Query graph</strong> on the identity attack graph tile.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Identity attack graph and internet attack surface graphs ready to use"
    width="1919"
    height="1000"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-8_hu_1e5c35974dd47a75.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-8.webp"></figure>
<h2 class="relative group">Querying the identity attack graph
    <div id="querying-the-identity-attack-graph" class="anchor"></div>
    
</h2>

<h3 class="relative group">Step 6: Review the schema
    <div id="step-6-review-the-schema" class="anchor"></div>
    
</h3>
<p>Before running anything, open the <strong>Schema</strong> tab.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Identity attack graph schema with Entra and Azure node types"
    width="1919"
    height="1199"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-10_hu_26022a4f894b5d6a.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-10.webp"></figure><p>The schema defines what you can match in GQL. Node types include Entra users, groups, service principals, managed identities, Azure subscriptions, resource groups, VMs, storage accounts, and Key Vaults. Edge types include group memberships and role assignments. Checking the schema before writing queries saves time.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Identity attack graph schema filtered on the HasIdentity edge relationship"
    width="1919"
    height="1199"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-11_hu_6f2344b928ba7ed5.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-11.webp"></figure><p>Worth being explicit: the query language here is <strong>GQL (Graph Query Language)</strong>, not KQL. The syntax looks familiar in places but the logic is different. GQL uses <code>MATCH (x)-[y]-&gt;(z)</code> patterns to traverse relationships. You follow edges between nodes rather than joining rows. The predefined queries are a good way to see what working GQL looks like before writing your own.</p>

<h3 class="relative group">Step 7: Start with the predefined queries
    <div id="step-7-start-with-the-predefined-queries" class="anchor"></div>
    
</h3>
<p>Start with the predefined queries before writing custom GQL. They cover the most useful scenarios and show you the query structure.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Identity attack graph schema filtered on the HasIdentity edge relationship"
    width="1919"
    height="1199"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-12_hu_6f2344b928ba7ed5.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-12.webp"></figure>
<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th>Query</th>
              <th>What it surfaces</th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td><strong>Visualize any graph</strong></td>
            <td>All nodes and edges, good starting point for exploration</td>
        </tr>
        <tr>
            <td><strong>Map Azure management structure</strong></td>
            <td>Subscription, resource group, and resource hierarchy</td>
        </tr>
        <tr>
            <td><strong>Identity attack paths: Entra users to Azure Key Vaults</strong></td>
            <td>Users with direct or indirect Key Vault access</td>
        </tr>
        <tr>
            <td><strong>Identity attack paths: service principals to virtual machines</strong></td>
            <td>Service principals that can reach VMs</td>
        </tr>
        <tr>
            <td><strong>Identity attack paths to Azure subscriptions</strong></td>
            <td>Identities with paths to subscription-level access</td>
        </tr>
        <tr>
            <td><strong>Identity attack paths to privileged roles</strong></td>
            <td>Identities that can reach privileged directory roles</td>
        </tr>
        <tr>
            <td><strong>Entra group memberships: detect circular relationships</strong></td>
            <td>Groups that form circular membership chains</td>
        </tr>
    </tbody>
  </table>
</div>
<p>Select <strong>Edit query</strong> on any of these to copy the GQL into the editor, then adjust filters, change the target node type, or add conditions for your specific investigation.</p>

<h3 class="relative group">Step 8: Run and explore
    <div id="step-8-run-and-explore" class="anchor"></div>
    
</h3>
<p>Select <strong>Run GQL query</strong>. Results render as an interactive graph (in this case I used the <strong>Visualize any graph</strong> as base):</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Identity attack graph query results as an interactive graph of users, groups and subscriptions"
    width="1919"
    height="1199"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-15_hu_9c026b744093740e.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-15.webp"></figure><p>From here:</p>
<ul>
<li>Select any node to open the details pane with account status, department, role assignments, and last password change</li>
<li>Right-click a node and select <strong>Explore connected assets</strong> to traverse one hop further without a new query</li>
<li>Switch to <strong>Table view</strong> to see results in rows and export to CSV</li>
<li>Hover over a node to highlight its direct connections and mute everything else</li>
<li>Use the filters in the top right of the canvas to narrow by node type or edge relationship</li>
</ul>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Node details for a service principal in the identity attack graph"
    width="1919"
    height="1199"
    src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-14_hu_b3d99f68c9ffa08a.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/image-14.webp"></figure>
<h2 class="relative group">What to look for
    <div id="what-to-look-for" class="anchor"></div>
    
</h2>
<p><strong>Short paths to privileged roles.</strong> The fewer hops between an identity and a privileged directory role, the more exposed you are. An identity two hops from Global Administrator via a nested group chain and a role assignment is a different risk profile than one eight hops away.</p>
<p><strong>Service principals with unexpected resource access.</strong> Service principals reaching VMs or Key Vaults via indirect role assignments, through inherited group memberships or role assignments higher up the subscription hierarchy, often come from earlier deployments that were never cleaned up.</p>
<p><strong>Circular group memberships.</strong> These create privilege inheritance chains that are invisible from the portal’s flat group membership view. The graph shows them immediately as cycles.</p>
<p><strong>Identities whose access exceeds their apparent role.</strong> Someone in a non-privileged department with indirect access to production Key Vaults via three layers of group nesting. Not malicious activity, just environment drift. The graph surfaces it; the follow-up is a permissions review.</p>

<h2 class="relative group">Billing and data retention
    <div id="billing-and-data-retention" class="anchor"></div>
    
</h2>
<p>The identity attack graph is billed under the Sentinel graph meter. Two cost elements to know about:</p>
<ul>
<li><strong>Asset data ingestion</strong>: charges apply for ingesting data through the Entra ID Assets and Azure Resource Graph connectors</li>
<li><strong>Asset data retention</strong>: default retention is 30 days, expandable up to 12 years, and you pay for whatever period you configure</li>
</ul>
<p>Check the <a href="https://www.microsoft.com/en-us/security/pricing/microsoft-sentinel"  target="_blank" rel="noreferrer">Sentinel pricing page</a> for current rates on the graph meter and asset ingestion.</p>

<h2 class="relative group">Limitations
    <div id="limitations" class="anchor"></div>
    
</h2>
<ul>
<li><strong>Up to 48 hours for initial build</strong>: The graph is not queryable during this window.</li>
<li><strong>ARG connector ingests partial coverage by default</strong>: Only subscriptions where the enabling user has Owner. Expand manually for full tenant coverage (see the ARG section above).</li>
<li><strong>Schema is Microsoft-managed</strong>: You can query what’s there but cannot add custom node or edge types.</li>
<li><strong>Asset data refreshes once every 24 hours</strong>: The graph is a point-in-time snapshot. Recent permission changes may not appear until the next ingestion cycle.</li>
<li><strong>Preview</strong>: Functionality and query behavior are subject to change before GA.</li>
</ul>

<h2 class="relative group">Resources
    <div id="resources" class="anchor"></div>
    
</h2>
<ul>
<li><a href="https://learn.microsoft.com/en-us/azure/sentinel/datalake/identity-attack-graph"  target="_blank" rel="noreferrer">What is the identity attack graph? (preview)</a></li>
<li><a href="https://learn.microsoft.com/en-us/azure/sentinel/datalake/enable-data-connectors"  target="_blank" rel="noreferrer">Asset data ingestion in the Microsoft Sentinel data lake</a></li>
<li><a href="https://learn.microsoft.com/en-us/azure/sentinel/datalake/sentinel-graph-overview"  target="_blank" rel="noreferrer">What is Microsoft Sentinel graph?</a></li>
<li><a href="https://learn.microsoft.com/en-us/azure/sentinel/datalake/graph-visualization"  target="_blank" rel="noreferrer">Visualize graphs in Microsoft Sentinel (preview)</a></li>
<li><a href="https://learn.microsoft.com/en-us/azure/sentinel/datalake/gql-reference-for-sentinel-custom-graph"  target="_blank" rel="noreferrer">GQL reference for Sentinel custom graph</a></li>
</ul>

<h2 class="relative group">Closing
    <div id="closing" class="anchor"></div>
    
</h2>
<p>I find these graphs a pleasant way to investigate identity risk. No query to write, no schema to design. Just enable, wait, and start exploring paths you didn’t know existed. What I appreciate most is that the predefined queries do the heavy lifting. You don’t need to know what you’re looking for; the graph shows you anyway.</p>
<p>What would make this even more powerful is the ability to take action directly based on what you find: trigger a remediation, flag a path for review, kick off a Conditional Access change. That’s the natural next step and I hope Microsoft moves in that direction.</p>
<p>Curious to see which managed graphs Microsoft ships next. The identity attack graph is clearly the first of several and the foundation is solid. I’ll might cover here more as they become available.</p>
]]></content:encoded><media:content url="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/featured_hu_51e9f696a63b42e7.jpg" medium="image" type="image/jpeg" width="1200" height="675"/><enclosure url="https://www.modernsecurity.nl/microsoft-sentinel-identity-attack-graph/featured_hu_51e9f696a63b42e7.jpg" type="image/jpeg" length="104850"/></item><item><title>How-to install guide for Microsoft Defender for Identity</title><link>https://www.modernsecurity.nl/install-microsoft-defender-for-identity/</link><guid isPermaLink="true">https://www.modernsecurity.nl/install-microsoft-defender-for-identity/</guid><pubDate>Mon, 02 Sep 2024 15:57:00 +0100</pubDate><dc:creator>Farid Kalaidji</dc:creator><category>Identity</category><category>Microsoft Defender for Identity</category><description>Step-by-step guide to install and configure Microsoft Defender for Identity, ensuring optimal security and performance for your environment.</description><content:encoded><![CDATA[
<h2 class="relative group">New blogpost and version Defender for Identity
    <div id="new-blogpost-and-version-defender-for-identity" class="anchor"></div>
    
</h2>
<p><strong>Refer to the new version: <a href="https://www.modernsecurity.nl/microsoft-defender-for-identity-guide-v3-x/" >Microsoft Defender for Identity guide v3.x</a></strong></p>

<h2 class="relative group">Introduction
    <div id="introduction" class="anchor"></div>
    
</h2>
<p>In today’s digital landscape, protecting your organization’s identity infrastructure is more critical than ever. Microsoft Defender for Identity is a robust cloud-based security solution designed to safeguard your on-premises Active Directory (AD) environment. By leveraging advanced analytics and real-time monitoring, it detects and responds to identity-based threats such as credential theft and lateral movement attempts. This guide will walk you through the setup, configuration, and optimization of Microsoft Defender for Identity, ensuring your AD environment is secure and resilient against modern cyber threats.</p>

<h2 class="relative group">What is Microsoft Defender for Identity?
    <div id="what-is-microsoft-defender-for-identity" class="anchor"></div>
    
</h2>
<p>Microsoft Defender for Identity is a cloud-based security solution that provides advanced protection for your on-premises Active Directory (AD) environment. It detects and analyzes identity-based attacks, such as credential theft and lateral movement attempts, and helps you respond quickly by correlating AD signals with cloud analytics.</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Defender for Identity architecture with on-premises sensors on domain controllers, AD FS and AD CS"
    width="1427"
    height="1497"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/architecture_hu_b56a50458aedb3d7.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/architecture.webp"></figure>
<h3 class="relative group">Key Features
    <div id="key-features" class="anchor"></div>
    
</h3>
<ul>
<li><strong>Real-time Monitoring</strong>: Detect suspicious activities, such as Pass-the-Hash, Pass-the-Ticket, and other credential theft techniques</li>
<li><strong>Behavioral Analytics</strong>: Use machine learning to understand the typical behavior of users and entities and flag anomalies</li>
<li><strong>Cloud Integration</strong>: Integrates with Microsoft 365 Defender for a unified security management experience</li>
</ul>

<h2 class="relative group">Prerequisites for Microsoft Defender for Identity Setup
    <div id="prerequisites-for-microsoft-defender-for-identity-setup" class="anchor"></div>
    
</h2>
<blockquote><p>Microsoft now offers a new sensor deployment method without installation, but for full control and compatibility, the classic sensor install remains the preferred approach.</p>
</blockquote>
<h3 class="relative group">Licensing
    <div id="licensing" class="anchor"></div>
    
</h3>

<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th>License Type</th>
              <th>Description</th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td>Enterprise Mobility + Security E5 (EMS E5/A5)</td>
            <td>Comprehensive security suite for enterprise environments</td>
        </tr>
        <tr>
            <td>Microsoft 365 E5 (Microsoft E5/A5/G5)</td>
            <td>Includes advanced security, compliance, and collaboration tools</td>
        </tr>
        <tr>
            <td>Microsoft 365 E5/A5/G5/F5 Security</td>
            <td>Focused on security and compliance features</td>
        </tr>
        <tr>
            <td>Microsoft 365 F5 Security + Compliance</td>
            <td>Requires Microsoft 365 F1/F3 or Office 365 F3 and EMS E3</td>
        </tr>
        <tr>
            <td>Standalone Defender for Identity License</td>
            <td>Specific license for Defender for Identity</td>
        </tr>
    </tbody>
  </table>
</div>

<h3 class="relative group">Permissions
    <div id="permissions" class="anchor"></div>
    
</h3>

<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th>Permission Type</th>
              <th>Description</th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td>Security Administrator</td>
            <td>Required to create and manage the Defender for Identity workspace</td>
        </tr>
        <tr>
            <td>Directory Service Account</td>
            <td>Read access to all objects in the monitored domains</td>
        </tr>
    </tbody>
  </table>
</div>

<h3 class="relative group">Supported Operating Systems
    <div id="supported-operating-systems" class="anchor"></div>
    
</h3>

<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th>Operating System</th>
              <th>Description</th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td>Windows Server 2012 R2</td>
            <td><em>Minimum supported version</em> – functional but lacks modern hardening</td>
        </tr>
        <tr>
            <td>Windows Server 2016</td>
            <td><em>Recommended minimum</em> – better performance and supportability</td>
        </tr>
        <tr>
            <td>Windows Server 2019</td>
            <td><em>Fully supported</em> – enhanced telemetry and sensor performance</td>
        </tr>
        <tr>
            <td>Windows Server 2025</td>
            <td><em>Latest supported version</em> – includes newest security capabilities</td>
        </tr>
    </tbody>
  </table>
</div>

<h3 class="relative group">Sensor Requirements
    <div id="sensor-requirements" class="anchor"></div>
    
</h3>

<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th>Requirement</th>
              <th>Description</th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td>RAM</td>
            <td>Minimum 6 GB (8 GB recommended for high-load environments)</td>
        </tr>
        <tr>
            <td>CPU</td>
            <td>Minimum 2 cores (dedicated preferred)</td>
        </tr>
        <tr>
            <td>Disk Space</td>
            <td>At least 6 GB free (10 GB recommended to account for logs and telemetry buffer)</td>
        </tr>
        <tr>
            <td>Network</td>
            <td>Outbound access to <code>*.atp.azure.com</code> over TCP/443 required</td>
        </tr>
        <tr>
            <td>.NET Framework</td>
            <td>Version 4.7 or higher must be installed</td>
        </tr>
        <tr>
            <td>Time Synchronization</td>
            <td>Clock skew must be less than 5 minutes from domain controllers</td>
        </tr>
    </tbody>
  </table>
</div>

<h3 class="relative group">Connectivity Requirements
    <div id="connectivity-requirements" class="anchor"></div>
    
</h3>

<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th><strong>Port(s)</strong></th>
              <th><strong>Description</strong></th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td><strong>443 (TCP)</strong></td>
            <td>Outbound communication with Microsoft Defender for Identity cloud (*.sensorapi.atp.azure.com) (<a href="https://learn.microsoft.com/en-us/defender-for-identity/deploy/prerequisites?utm_source=chatgpt.com"  target="_blank" rel="noreferrer">learn.microsoft.com</a>)</td>
        </tr>
        <tr>
            <td><strong>389 (TCP/UDP)</strong></td>
            <td>LDAP communication with Domain Controllers</td>
        </tr>
        <tr>
            <td><strong>636 (TCP)</strong></td>
            <td>Secure LDAPS communication (optional, if enabled)</td>
        </tr>
        <tr>
            <td><strong>3268 (TCP)</strong></td>
            <td>LDAP to Global Catalog (unencrypted)</td>
        </tr>
        <tr>
            <td><strong>3269 (TCP)</strong></td>
            <td>LDAPS to Global Catalog (secure)</td>
        </tr>
        <tr>
            <td><strong>53 (TCP/UDP)</strong></td>
            <td>DNS lookups (including reverse lookups for asset correlation)</td>
        </tr>
        <tr>
            <td><strong>88 (TCP/UDP)</strong></td>
            <td>Kerberos authentication communication</td>
        </tr>
        <tr>
            <td><strong>135 (TCP)</strong></td>
            <td>RPC endpoint mapper for NTLM-over-RPC name resolution</td>
        </tr>
        <tr>
            <td><strong>445 (TCP/UDP)</strong></td>
            <td>SMB/CIFS/SAM-R for NetLogon and lateral movement path detection</td>
        </tr>
        <tr>
            <td><strong>UDP 137</strong></td>
            <td>NetBIOS name resolution (one option for NNR)</td>
        </tr>
        <tr>
            <td><strong>TCP 3389</strong></td>
            <td>RDP handshake packet for network name resolution (NNR)</td>
        </tr>
        <tr>
            <td><strong>UDP 1813</strong></td>
            <td>RADIUS communication (if using RADIUS logs or workflows)</td>
        </tr>
        <tr>
            <td><strong>444 (TCP, localhost)</strong></td>
            <td>Local sensor updater service communication</td>
        </tr>
    </tbody>
  </table>
</div>

<h2 class="relative group">Pre-Checks and New Defender for Identity Module
    <div id="pre-checks-and-new-defender-for-identity-module" class="anchor"></div>
    
</h2>
<p>Before starting the installation, ensure that your environment meets all prerequisites. Microsoft provides a PowerShell module to help automate the configuration processes for domains, domain controllers, and other sensor servers.</p>
<p><strong>Installing the DefenderForIdentity Module:</strong></p>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">PowerShell</div><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="nb">Install-Module</span> <span class="n">-Name</span> <span class="n">DefenderForIdentity</span></span></span></code></pre></div></div>
<p><strong>Importing the Module:</strong></p>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">PowerShell</div><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="nb">Import-Module</span> <span class="n">DefenderForIdentity</span></span></span></code></pre></div></div>
<p><strong>Testing Configuration:</strong></p>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">PowerShell</div><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="nb">Test-MDIConfiguration</span> <span class="n">-Mode</span> <span class="n">LocalMachine</span> <span class="n">-Configuration</span> <span class="n">All</span></span></span></code></pre></div></div>
<p>(this is just to check the configuration – a False will be given as you don’t have anything installed at this point, but we’ll continue this in step 6)</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="PowerShell installing the DefenderForIdentity module and running Test-MDIConfiguration"
    width="839"
    height="393"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/capture_hu_762a0c04e4291171.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/capture.webp"></figure>
<h2 class="relative group">Step-by-Step Installation of Defender for Identity
    <div id="step-by-step-installation-of-defender-for-identity" class="anchor"></div>
    
</h2>

<h3 class="relative group">Step 1: Create a gMSA for the Sensor
    <div id="step-1-create-a-gmsa-for-the-sensor" class="anchor"></div>
    
</h3>
<p>Defender for Identity requires a Group Managed Service Account (gMSA). This account ensures the necessary access permissions for monitoring AD activity.</p>
<p><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/group-managed-service-accounts/group-managed-service-accounts/getting-started-with-group-managed-service-accounts"  target="_blank" rel="noreferrer">https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/group-managed-service-accounts/group-managed-service-accounts/getting-started-with-group-managed-service-accounts</a></p>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">PowerShell</div><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="c"># Create KDS root key for the gMSA (if not existing)</span>
</span></span><span class="line"><span class="cl"><span class="nb">Add-KdsRootKey</span> <span class="n">-EffectiveImmediately</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># Create the universal group (if needed)</span>
</span></span><span class="line"><span class="cl"><span class="nb">New-ADGroup</span> <span class="n">-Name</span> <span class="s2">&#34;MdiSvcAccountGroup&#34;</span> <span class="n">-GroupScope</span> <span class="n">Universal</span> <span class="n">-GroupCategory</span> <span class="n">Security</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># Create the gMSA account, specifying the group as PrincipalsAllowedToRetrieveManagedPassword</span>
</span></span><span class="line"><span class="cl"><span class="nb">New-ADServiceAccount</span> <span class="n">-Name</span> <span class="s2">&#34;MdiSvcAccount&#34;</span> <span class="n">-DNSHostName</span> <span class="s2">&#34;yourdomain.com&#34;</span> <span class="n">-KerberosEncryptionType</span> <span class="n">AES256</span> <span class="n">-PrincipalsAllowedToRetrieveManagedPassword</span> <span class="s2">&#34;MdiSvcAccountGroup&#34;</span> <span class="n">-ManagedPasswordIntervalInDays</span> <span class="mf">30</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># Add the gMSA to the group</span>
</span></span><span class="line"><span class="cl"><span class="nb">Add-ADGroupMember</span> <span class="n">-Identity</span> <span class="s2">&#34;MdiSvcAccountGroup&#34;</span> <span class="n">-Members</span> <span class="s2">&#34;MdiSvcAccount$&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># Verify the gMSA account</span>
</span></span><span class="line"><span class="cl"><span class="nb">Test-ADServiceAccount</span> <span class="n">-Identity</span> <span class="s2">&#34;MdiSvcAccount&#34;</span></span></span></code></pre></div></div>
<p>Make sure to add Log on as a service user rights on the servers added to MDI, otherwise the service(s) won’t start and will error in the Eventviewer.</p>

<h3 class="relative group">Step 2: Add the gMSA in the Defender for Identity Portal
    <div id="step-2-add-the-gmsa-in-the-defender-for-identity-portal" class="anchor"></div>
    
</h3>
<ol>
<li>Go to the Microsoft 365 Defender portal</li>
<li>Navigate to <strong>Settings &gt; Identities &gt; Directory services accounts</strong></li>
<li>Enter the account name and domain, then select <strong>Save</strong></li>
</ol>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Adding directory services account credentials in the Defender for Identity settings"
    width="1685"
    height="1083"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-5_hu_950a06b66f14f9fd.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-5.webp"></figure>
<h3 class="relative group">Step 3: Download and Install the Defender for Identity Sensor
    <div id="step-3-download-and-install-the-defender-for-identity-sensor" class="anchor"></div>
    
</h3>
<ol>
<li>Download the sensor installer from the Microsoft Defender portal through <strong>Settings &gt; Identities &gt; Sensor &gt; Add Sensor</strong></li>
<li>Install the sensor on your domain controllers. This can be done either through the GUI or silently using PowerShell</li>
</ol>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Adding a new Defender for Identity sensor with the installer download and access key"
    width="1772"
    height="1085"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-6_hu_e6279145410b062d.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-6.webp"></figure><p><strong>GUI Installation:</strong></p>
<ul>
<li>Run the installer</li>
<li>Follow the on-screen steps to choose the installation path</li>
<li>Enter the access key provided in the portal</li>
</ul>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Defender for Identity sensor installer language selection"
    width="669"
    height="411"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-7.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-7.webp"></figure><figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Sensor deployment type selection in the Defender for Identity installer"
    width="669"
    height="411"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-8.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-8.webp"></figure><figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Configuring the installation path and access key for the Defender for Identity sensor"
    width="669"
    height="411"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-9.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-9.webp"></figure><figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Defender for Identity sensor installation in progress"
    width="669"
    height="411"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-10.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-10.webp"></figure><p><strong>Silent Installation:</strong></p>
<p>Use this PowerShell script to automate the installation:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">.\Azure ATP sensor Setup.exe /quiet AccessKey=&#34;YOUR-ACCESS-KEY&#34;</span></span></code></pre></div></div>

<h3 class="relative group">Step 4: Validate Sensor Installation
    <div id="step-4-validate-sensor-installation" class="anchor"></div>
    
</h3>
<p>After installation, ensure the sensor is communicating with the Defender for Identity cloud service:</p>
<ol>
<li>Open the Microsoft 365 Defender portal and navigate to <strong>Settings &gt; Identities</strong></li>
<li>Verify the sensor’s status, ensuring it shows as “Connected” or “Running”</li>
</ol>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Defender for Identity sensors listed as running and up to date in the Defender portal"
    width="1685"
    height="1083"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-11_hu_fe542866d5c3b445.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-11.webp"></figure>
<h2 class="relative group">Post-Configuration Setup
    <div id="post-configuration-setup" class="anchor"></div>
    
</h2>

<h3 class="relative group">Step 5: Validating Defender for Identity configuration
    <div id="step-5-validating-defender-for-identity-configuration" class="anchor"></div>
    
</h3>
<p>To continue on the early steps you’ve taken on the MDI powershell script, you can now use it to check if the installation is succesful and/or you need to have (more) logging enabled as mentioned in step 6 or 7 (prefer step 7 – as it can directly set all the configuration FOR you).</p>
<p><strong>Running the script:</strong></p>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">PowerShell</div><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="nb">New-MDIConfigurationReport</span> <span class="n">-Path</span> <span class="s2">&#34;C:\Reports&#34;</span> <span class="n">-OpenHtmlReport</span></span></span></code></pre></div></div>
<p>Lot of failed checks? Move over to step 6 or 7</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="MDI configuration report with most domain configuration checks failed"
    width="874"
    height="475"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-12_hu_35a26bea2ec63c06.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/image-12.webp"></figure>
<h3 class="relative group">Step 6: Configuring Audit Policies (semi-manual way)
    <div id="step-6-configuring-audit-policies-semi-manual-way" class="anchor"></div>
    
</h3>
<p>Defender for Identity requires specific audit policies to be enabled on domain controllers. You can apply these settings using Group Policy Objects (GPOs) or PowerShell.</p>
<p><a href="https://learn.microsoft.com/en-us/defender-for-identity/deploy/configure-windows-event-collection"  target="_blank" rel="noreferrer">https://learn.microsoft.com/en-us/defender-for-identity/deploy/configure-windows-event-collection</a></p>
<p><strong>Required Audit Events:</strong></p>

<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th>Audit Policy</th>
              <th>Event ID</th>
              <th>Description</th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td>Logon Success/Failure</td>
            <td>4624</td>
            <td>A successful logon event</td>
        </tr>
        <tr>
            <td>Logon Success/Failure</td>
            <td>4625</td>
            <td>A failed logon event</td>
        </tr>
        <tr>
            <td>Account Logon Success/Failure</td>
            <td>4776</td>
            <td>The computer attempted to validate credentials</td>
        </tr>
        <tr>
            <td>Logoff Success</td>
            <td>4634</td>
            <td>The user has logged off</td>
        </tr>
        <tr>
            <td>Special Logon</td>
            <td>4672</td>
            <td>A privileged user has logged on</td>
        </tr>
        <tr>
            <td>Process Creation</td>
            <td>4688</td>
            <td>A process has been created</td>
        </tr>
        <tr>
            <td>Directory Service Access</td>
            <td>4662</td>
            <td>Permissions were requested for an object in AD</td>
        </tr>
        <tr>
            <td>Account Creation</td>
            <td>4720</td>
            <td>A user account was created</td>
        </tr>
        <tr>
            <td>Account Deletion</td>
            <td>4726</td>
            <td>A user account was deleted</td>
        </tr>
        <tr>
            <td>Privilege Use</td>
            <td>4673</td>
            <td>A privilege service was called</td>
        </tr>
        <tr>
            <td>Privilege Use</td>
            <td>4674</td>
            <td>A privilege operation was performed</td>
        </tr>
    </tbody>
  </table>
</div>
<p><strong>PowerShell commands to apply Audit Policies:</strong></p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl"># Enforce logon auditing
</span></span><span class="line"><span class="cl">auditpol /set /subcategory:&#34;Logon/Logoff&#34; /success:enable /failure:enable
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"># Enable account logon auditing
</span></span><span class="line"><span class="cl">auditpol /set /subcategory:&#34;Account Logon&#34; /success:enable /failure:enable</span></span></code></pre></div></div>

<h3 class="relative group">Step 7: Automate the configuration with PowerShell
    <div id="step-7-automate-the-configuration-with-powershell" class="anchor"></div>
    
</h3>
<p>Microsoft provides a PowerShell script to automate the configuration of audit policies and other settings, which you’ve used above. You can use this script to automatically all the correct ACL’s and logging.</p>
<p><strong>Running the Configuration Script:</strong></p>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">PowerShell</div><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="nb">Set-MDIConfiguration</span> <span class="n">-Mode</span> <span class="n">Domain</span> <span class="n">-Configuration</span> <span class="n">AdfsAuditing</span>
</span></span><span class="line"><span class="cl"><span class="nb">Set-MDIConfiguration</span> <span class="n">-Mode</span> <span class="n">Domain</span> <span class="n">-Configuration</span> <span class="n">AdvancedAuditPolicyCAs</span>
</span></span><span class="line"><span class="cl"><span class="nb">Set-MDIConfiguration</span> <span class="n">-Mode</span> <span class="n">Domain</span> <span class="n">-Configuration</span> <span class="n">AdvancedAuditPolicyDCs</span>
</span></span><span class="line"><span class="cl"><span class="nb">Set-MDIConfiguration</span> <span class="n">-Mode</span> <span class="n">Domain</span> <span class="n">-Configuration</span> <span class="n">CAAuditing</span>
</span></span><span class="line"><span class="cl"><span class="nb">Set-MDIConfiguration</span> <span class="n">-Mode</span> <span class="n">Domain</span> <span class="n">-Configuration</span> <span class="n">ConfigurationContainerAuditing</span>
</span></span><span class="line"><span class="cl"><span class="nb">Set-MDIConfiguration</span> <span class="n">-Mode</span> <span class="n">Domain</span> <span class="n">-Configuration</span> <span class="n">DomainObjectAuditing</span>
</span></span><span class="line"><span class="cl"><span class="nb">Set-MDIConfiguration</span> <span class="n">-Mode</span> <span class="n">Domain</span> <span class="n">-Configuration</span> <span class="n">NTLMAuditing</span>
</span></span><span class="line"><span class="cl"><span class="nb">Set-MDIConfiguration</span> <span class="n">-Mode</span> <span class="n">Domain</span> <span class="n">-Configuration</span> <span class="n">ProcessorPerformance</span></span></span></code></pre></div></div>

<h3 class="relative group">Step 8: Re-check the configuration
    <div id="step-8-re-check-the-configuration" class="anchor"></div>
    
</h3>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">PowerShell</div><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="nb">New-MDIConfigurationReport</span> <span class="n">-Path</span> <span class="s2">&#34;C:\Reports&#34;</span> <span class="n">-OpenHtmlReport</span></span></span></code></pre></div></div>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="MDI configuration report with all domain configuration checks passed"
    width="827"
    height="460"
    src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/2024-10-15-16-49-17_hu_5b1af16400d22db9.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/2024-10-15-16-49-17.webp"></figure>
<h2 class="relative group">Testing the Environment
    <div id="testing-the-environment" class="anchor"></div>
    
</h2>

<h3 class="relative group">Simulating Attacks
    <div id="simulating-attacks" class="anchor"></div>
    
</h3>
<p>To verify that Microsoft Defender for Identity is properly configured, simulate common attacks like Pass-the-Hash or Brute-force. Use the Mimikatz tool to extract NTLM hashes and attempt unauthorized access.</p>
<p><strong>Simulating Pass-the-Ticket Attack:</strong></p>
<ol>
<li>Use a tool like Mimikatz to extract a Kerberos ticket from a compromised host</li>
<li>Inject the ticket into another session to simulate lateral movement</li>
</ol>
<p><strong>Validating Detection:</strong></p>
<p>Check the Defender for Identity portal for alerts related to the simulated attack. The detection process should identify the Pass-the-Ticket activity and flag the suspicious behavior.</p>

<h2 class="relative group">Additional Configurations: AD FS, AD CS, and Entra Connect
    <div id="additional-configurations-ad-fs-ad-cs-and-entra-connect" class="anchor"></div>
    
</h2>
<p>Although Defender for Identity’s primary focus is monitoring Active Directory, it also supports integrating AD FS, AD CS, and Entra Connect for comprehensive identity protection.</p>

<h3 class="relative group">AD FS Integration
    <div id="ad-fs-integration" class="anchor"></div>
    
</h3>
<p>To monitor AD FS (Active Directory Federation Services) for suspicious authentication events:</p>
<ol>
<li>Install the Defender for Identity sensor on the AD FS server</li>
<li>Enable verbose auditing on AD FS using PowerShell:</li>
</ol>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">PowerShell</div><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="nb">Set-AdfsProperties</span> <span class="n">-AuditLevel</span> <span class="n">Verbose</span></span></span></code></pre></div></div>
<ol start="3">
<li>Configure read permissions for the AD FS database:</li>
</ol>
<p>SQL</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">-- Grant read permissions to the Directory Service Account
</span></span><span class="line"><span class="cl">GRANT SELECT ON [AdfsConfiguration] TO [domain\gMSA$];</span></span></code></pre></div></div>

<h3 class="relative group">AD CS Integration
    <div id="ad-cs-integration" class="anchor"></div>
    
</h3>
<p>Configure AD CS (Active Directory Certificate Services) to monitor certificate-based authentications:</p>
<ol>
<li>Enable auditing on the AD CS server:</li>
</ol>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">auditpol /set /subcategory:&#34;Certification Services&#34; /success:enable /failure:enable</span></span></code></pre></div></div>
<ol start="2">
<li>Install the Defender for Identity sensor on the AD CS server</li>
</ol>

<h3 class="relative group">Entra Connect Sensor
    <div id="entra-connect-sensor" class="anchor"></div>
    
</h3>
<p>To monitor Microsoft Entra Connect, ensure that:</p>
<ul>
<li>Entra Connect version 2.0 or higher is installed</li>
<li>Install the Entra Connect Sensor on the Entra Connect server to capture authentication events between on-prem AD and Azure AD</li>
</ul>

<h2 class="relative group">Event IDs to Monitor
    <div id="event-ids-to-monitor" class="anchor"></div>
    
</h2>
<p>Defender for Identity relies on key event IDs to detect suspicious behavior. Here’s a list of the most critical ones:</p>

<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th>Component</th>
              <th>Event ID</th>
              <th>Description</th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td>Kerberos TGT Request</td>
            <td>4768</td>
            <td>Ticket-granting ticket (TGT) request received</td>
        </tr>
        <tr>
            <td>AD FS Authentication</td>
            <td>1200</td>
            <td>AD FS authentication</td>
        </tr>
    </tbody>
  </table>
</div>

<h2 class="relative group">Defender for Identity learning period
    <div id="defender-for-identity-learning-period" class="anchor"></div>
    
</h2>
<p>Microsoft Defender for Identity (MDI) uses a learning period to understand the typical behavior patterns within your network. This period is crucial for fine-tuning the detection capabilities, ensuring that alerts are both accurate and relevant. By establishing a baseline of normal activities, MDI can more effectively identify anomalies and potential security threats.</p>

<div class="ms-table" role="region" aria-label="Table" tabindex="0">
  <table>
      <thead>
          <tr>
              <th><strong>Source Type</strong></th>
              <th><strong>Learning Period</strong></th>
          </tr>
      </thead>
    <tbody>
        <tr>
            <td>Active Directory (AD)</td>
            <td>30 days</td>
        </tr>
        <tr>
            <td>Network Traffic</td>
            <td>30 days</td>
        </tr>
        <tr>
            <td>User and Entity Behavior</td>
            <td>30 days</td>
        </tr>
        <tr>
            <td>NTLM Authentication</td>
            <td>30 days</td>
        </tr>
        <tr>
            <td>Kerberos Authentication</td>
            <td>30 days</td>
        </tr>
    </tbody>
  </table>
</div>

<h2 class="relative group">Defender for Identity security posture recommendations
    <div id="defender-for-identity-security-posture-recommendations" class="anchor"></div>
    
</h2>
<p>Microsoft released impressive updates to the <a href="https://www.modernsecurity.nl/microsoft-defender-for-identity-posture/" ><strong>Microsoft Defender for Identity</strong> posture recommendations</a>, check out my previous blog post and make sure to walk through the findings:</p>
<p><strong>Related:</strong> <a href="https://www.modernsecurity.nl/microsoft-defender-for-identity-posture/" >Maximizing security with Microsoft Defender for Identity</a></p>

<h2 class="relative group">Conclusion
    <div id="conclusion" class="anchor"></div>
    
</h2>
<p><strong>Microsoft Defender for Identity</strong> offers comprehensive protection for on-premises Active Directory environments, leveraging advanced threat detection and behavioral analytics. This guide provides a clear, step-by-step process for deploying and configuring the solution, along with testing mechanisms to ensure proper functionality. By integrating it with AD FS, AD CS, and Entra Connect, organizations can achieve complete identity security monitoring across their hybrid environments.</p>
]]></content:encoded><media:content url="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/featured_hu_9cb310abc6e98c19.jpg" medium="image" type="image/jpeg" width="1200" height="884"/><enclosure url="https://www.modernsecurity.nl/install-microsoft-defender-for-identity/featured_hu_9cb310abc6e98c19.jpg" type="image/jpeg" length="64146"/></item><item><title>Maximizing security with Microsoft Defender for Identity</title><link>https://www.modernsecurity.nl/microsoft-defender-for-identity-posture/</link><guid isPermaLink="true">https://www.modernsecurity.nl/microsoft-defender-for-identity-posture/</guid><pubDate>Thu, 08 Aug 2024 20:03:00 +0100</pubDate><dc:creator>Farid Kalaidji</dc:creator><category>Identity</category><category>Microsoft Defender for Identity</category><category>Security</category><description>Protect your organization’s identities with Microsoft Defender for Identity. Detect threats, improve security posture, and reduce attack surfaces effectively.</description><content:encoded><![CDATA[
<h2 class="relative group">What is Microsoft Defender for Identity?
    <div id="what-is-microsoft-defender-for-identity" class="anchor"></div>
    
</h2>
<p><strong>Microsoft Defender for Identity</strong> is a robust, cloud-based security solution designed to safeguard your organization’s on-premises Active Directory (AD) and cloud identities. Leveraging signals from both environments, it identifies, detects, and investigates advanced threats, compromised identities, and malicious insider actions. Formerly known as Azure Advanced Threat Protection (Azure ATP), it integrates seamlessly with Microsoft Defender XDR to provide comprehensive identity threat detection and response (ITDR) capabilities.</p>
<p>In today’s cybersecurity landscape, identity-based attacks are increasingly common. Hackers frequently exploit identity vulnerabilities to gain unauthorized access, move laterally within networks, and escalate privileges. These techniques are not only prevalent in real-world attacks but also regularly encountered during red teaming engagements, where security professionals simulate attacks to test an organization’s defenses. Microsoft Defender for Identity is specifically designed to counter these sophisticated threats, providing organizations with the tools they need to protect their identities and maintain robust security postures.</p>

<h2 class="relative group">What’s New in Microsoft Defender for Identity?
    <div id="whats-new-in-microsoft-defender-for-identity" class="anchor"></div>
    
</h2>

<h3 class="relative group">October 2024: Enhanced threat detection capabilities
    <div id="october-2024-enhanced-threat-detection-capabilities" class="anchor"></div>
    
</h3>
<p><a href="https://learn.microsoft.com/en-us/defender-for-identity/whats-new#mdi-is-expanding-coverage-with-new-10-identity-posture-recommendations"  target="_blank" rel="noreferrer">In October 2024, Microsoft Defender for Identity introduced enhanced threat detection capabilities. These updates include improved machine learning algorithms for detecting lateral movement and credential theft, as well as new integrations with Microsoft Sentinel for more robust incident response.</a></p>

<h3 class="relative group">August 2024: New Entra Connect Sensor
    <div id="august-2024-new-entra-connect-sensor" class="anchor"></div>
    
</h3>
<p><a href="https://learn.microsoft.com/en-us/defender-for-identity/whats-new#august-2024"  target="_blank" rel="noreferrer">In August 2024, a new Entra Connect sensor was introduced to enhance coverage in hybrid identity environments. This update also included new hybrid security detections and identity posture recommendations.</a></p>

<h3 class="relative group">July 2024: Identity Posture insights
    <div id="july-2024-identity-posture-insights" class="anchor"></div>
    
</h3>
<p><a href="https://learn.microsoft.com/en-us/defender-for-identity/whats-new#july-2024"  target="_blank" rel="noreferrer">Released in July 2024, the Identity Posture Insights feature provides detailed assessments of an organization’s identity security posture, including recommendations for improving security configurations and reducing the attack surface.</a></p>

<h2 class="relative group">Detailed overview of Identity Posture recommendations
    <div id="detailed-overview-of-identity-posture-recommendations" class="anchor"></div>
    
</h2>

<h3 class="relative group">October 2024
    <div id="october-2024" class="anchor"></div>
    
</h3>
<ul>
<li><strong>Accounts with non-default primary group id</strong><a href="https://techcommunity.microsoft.com/t5/microsoft-defender-for-identity/secure-score-accounts-with-non-default-primary-group-id/m-p/4262784"  target="_blank" rel="noreferrer">: Identifies accounts with a primary group ID that is not the default, which can be a sign of misconfiguration or potential security risk</a>.</li>
<li><strong>Change domain controller computer account old password</strong><a href="https://learn.microsoft.com/en-us/troubleshoot/windows-server/windows-security/use-netdom-reset-domain-controller-password"  target="_blank" rel="noreferrer">: Recommends changing the old password for domain controller computer accounts to prevent unauthorized access</a>.</li>
<li><strong>GPO assigns unprivileged identities to local groups with elevated privileges</strong><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/appendix-b--privileged-accounts-and-groups-in-active-directory"  target="_blank" rel="noreferrer">: Detects Group Policy Objects (GPOs) that assign unprivileged identities to local groups with elevated privileges, which can be exploited by attackers</a>.</li>
<li><strong>GPO can be modified by unprivileged accounts</strong><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/implementing-least-privilege-administrative-models"  target="_blank" rel="noreferrer">: Identifies GPOs that can be modified by unprivileged accounts, posing a significant security risk</a>.</li>
<li><strong>Reversible passwords found in GPOs</strong><a href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/security-policy-settings/store-passwords-using-reversible-encryption"  target="_blank" rel="noreferrer">: Alerts on GPOs that store passwords in a reversible format, which can be easily compromised</a>.</li>
<li><strong>Built-in Active Directory guest account is enabled</strong><a href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/security-policy-settings/accounts-guest-account-status"  target="_blank" rel="noreferrer">: Detects if the built-in AD Guest account is enabled, which can be a security vulnerability</a>.</li>
<li><strong>Unsafe permissions on the DnsAdmins group</strong><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-groups"  target="_blank" rel="noreferrer">: Identifies unsafe permissions on the DnsAdmins group, which can be exploited to gain elevated privileges</a>.</li>
<li><strong>Ensure all privileged accounts have the configuration flag “This Account is sensitive and cannot be delegated”</strong><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/how-to-configure-protected-accounts"  target="_blank" rel="noreferrer">: Recommends ensuring that all privileged accounts have this configuration flag set to prevent delegation attacks</a>.</li>
<li><strong>Change password of krbtgt account</strong><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/forest-recovery-guide/ad-forest-recovery-reset-the-krbtgt-password"  target="_blank" rel="noreferrer">: Advises changing the password of the krbtgt account to mitigate the risk of Kerberos ticket-granting ticket (TGT) attacks</a>.</li>
</ul>

<h3 class="relative group">August 2024
    <div id="august-2024" class="anchor"></div>
    
</h3>
<ul>
<li><strong>Rotate password for Entra Connect Connector account</strong>: Recommends changing the password of MSOL accounts with the password last set over 90 days ago to prevent unauthorized access.</li>
<li><strong>Remove unnecessary replication permissions for Entra Connect account</strong>: Advises removing unnecessary permissions to reduce the potential attack surface.</li>
<li><strong>Change password for Entra Seamless SSO account configuration</strong>: Lists all Entra seamless SSO computer accounts with passwords last set over 90 days ago and recommends changing them to prevent lateral movement attacks.</li>
<li><strong>Suspicious interactive logon to the Entra Connect server</strong>: Detects unusual and potentially malicious direct logins to Entra Connect servers.</li>
</ul>

<h3 class="relative group">July 2024
    <div id="july-2024" class="anchor"></div>
    
</h3>
<ul>
<li><strong>Lateral movement path analysis</strong>: Identifies potential paths attackers could use to move laterally within the network.</li>
<li><strong>Security configuration assessments</strong>: Evaluates current security settings and suggests improvements.</li>
<li><strong>User Behavior Analytics</strong>: Monitors user activities to detect anomalies that could indicate compromised identities.</li>
</ul>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Microsoft Secure Score recommended actions for Defender for Identity"
    width="1789"
    height="1097"
    src="https://www.modernsecurity.nl/microsoft-defender-for-identity-posture/afbeelding_hu_fde2ac8ef61a8195.webp"
   
   
    data-zoom-src="https://www.modernsecurity.nl/microsoft-defender-for-identity-posture/afbeelding.webp"><figcaption>Updated October 2024 screenshot with the latest recommendations</figcaption></figure>
<h2 class="relative group">Prerequisites for Microsoft Defender for Identity
    <div id="prerequisites-for-microsoft-defender-for-identity" class="anchor"></div>
    
</h2>
<p>Before deploying Microsoft Defender for Identity, ensure the following prerequisites are met:</p>
<ul>
<li><strong>Licensing requirements</strong>: One of the following Microsoft 365 licenses is required:
<ul>
<li>Enterprise Mobility + Security E5 (EMS E5/A5)</li>
<li>Microsoft 365 E5 (Microsoft E5/A5/G5)</li>
<li>Microsoft 365 E5/A5/G5/F5 Security</li>
<li>Microsoft 365 F5 Security + Compliance</li>
<li>A standalone Defender for Identity license.</li>
</ul>
</li>
<li><strong>Required permissions</strong>: At least one Security administrator access on your Microsoft Entra ID tenant.</li>
<li><strong>Connectivity requirements</strong>: The Defender for Identity sensor must communicate with the Defender for Identity cloud service via proxy, ExpressRoute, or firewall configurations.</li>
<li><strong>System requirements</strong>: Ensure the servers where the sensors will be installed meet the necessary specifications.</li>
</ul>

<h2 class="relative group">How to Deploy the New Features in Microsoft Defender for Identity
    <div id="how-to-deploy-the-new-features-in-microsoft-defender-for-identity" class="anchor"></div>
    
</h2>
<p>(<a href="" >check out my new blog post for an extensive overview on how to install the Defender for Identity Sensor or Entra Connector sensor – below is just a quick summary</a>)</p>

<h3 class="relative group">Deployment via Entra Connector Sensor
    <div id="deployment-via-entra-connector-sensor" class="anchor"></div>
    
</h3>
<ol>
<li><strong>Install the Entra Connector sensor</strong>: Download the Entra Connector Sensor from the Microsoft Defender for Identity portal. Download and run the installer and follow the on-screen instructions to complete the installation.</li>
<li><strong>Configure the sensor</strong>: Open the Entra Connector Sensor configuration tool. Enter the required credentials and configuration settings. Save the configuration and start the sensor.</li>
<li><strong>Verify deployment</strong>: Log in to the Microsoft Defender for Identity portal. Navigate to the Sensors page and verify that the Entra Connector Sensor is active and reporting data.</li>
<li><strong>Configure logging and event logs</strong>: Ensure that the necessary Windows event logs are being collected. Configure Advanced Audit Policy settings to ensure these events are logged correctly.</li>
</ol>

<h3 class="relative group">Deployment via Defender for Identity
    <div id="deployment-via-defender-for-identity" class="anchor"></div>
    
</h3>
<ol>
<li><strong>Access the Defender for Identity portal</strong>: Log in to the Microsoft Defender for Identity portal.</li>
<li><strong>Configure Identity sensors</strong>: Navigate to the Sensors page. Click on “Add Sensor” and select the appropriate sensor type. Follow the on-screen instructions to configure the sensor settings.</li>
<li><strong>Monitor and manage sensors</strong>: Once configured, monitor the sensor status and data flow from the Sensors page. Ensure that all sensors are active and reporting data correctly.</li>
<li><strong>Configure logging and event logs</strong>: Ensure that the necessary Windows event logs are being collected. Configure Advanced Audit Policy settings to ensure these events are logged correctly.</li>
<li><strong>Review and troubleshoot logs</strong>: The Defender for Identity sensor logs are located in the installation directory, typically at <code>C:\Program Files\Azure Advanced Threat Protection Sensor\Logs</code>. Key logs include: Microsoft.Tri.Sensor.log (contains overall status and operations), Microsoft.Tri.Sensor-Errors.log (contains error logs for troubleshooting), Microsoft.Tri.Sensor.Updater.log (logs related to sensor updates).</li>
</ol>

<h2 class="relative group">Configuration steps for Microsoft Defender for Identity
    <div id="configuration-steps-for-microsoft-defender-for-identity" class="anchor"></div>
    
</h2>
<ol>
<li><strong>View and configure sensor settings</strong>:
<ul>
<li>Navigate to Settings &gt; Identities &gt; Sensors in the Microsoft Defender XDR portal.</li>
<li>Configure sensor details such as domain controllers, network adapters, and update settings.</li>
</ul>
</li>
<li><strong>Set up directory service accounts</strong>:
<ul>
<li>Add Directory Service Accounts with read access to all objects in the monitored domains.</li>
</ul>
</li>
<li><strong>Enable advanced features</strong>:
<ul>
<li>Enable features like sensitive accounts monitoring, alert notifications, and syslog integration for enhanced security.</li>
</ul>
</li>
</ol>

<h2 class="relative group">Post-Deployment Steps
    <div id="post-deployment-steps" class="anchor"></div>
    
</h2>
<p>After deploying Microsoft Defender for Identity, follow these steps to ensure optimal performance and security:</p>
<p><strong>Regularly review security posture</strong>: Use the Identity Posture Insights feature to regularly review and improve <a href="https://www.modernsecurity.nl/microsoft-security-exposure-management/" >your organization’s identity security posture</a>.</p>
<p><strong>Verify sensor health</strong>: Regularly check the health status of all deployed sensors in the Microsoft Defender for Identity portal.</p>
<p><strong>Configure alerts and notifications</strong>: Set up alerts and notifications for suspicious activities and potential threats.</p>
<p><strong>Integrate with other security tools</strong>: Integrate Defender for Identity with other Microsoft security tools like Microsoft Sentinel and Microsoft Defender for Endpoint for comprehensive threat detection and response.</p>

<h2 class="relative group">Conclusion
    <div id="conclusion" class="anchor"></div>
    
</h2>
<p>Microsoft Defender for Identity is a powerful tool for protecting your organization’s identities and reducing the attack surface. With its advanced threat detection capabilities, proactive security posture assessments, and automated response features, it helps organizations stay ahead of potential threats. By deploying the latest features through the Entra Connector Sensor or directly via Defender for Identity, you can ensure comprehensive protection for your identity infrastructure.</p>

<h2 class="relative group">Changelog
    <div id="changelog" class="anchor"></div>
    
</h2>
<ul>
<li>July 2024 – initial blog post</li>
<li>October 2024 – updates to new recommendations</li>
</ul>
]]></content:encoded><media:content url="https://www.modernsecurity.nl/microsoft-defender-for-identity-posture/featured_hu_56945e9e05d21115.jpg" medium="image" type="image/jpeg" width="1200" height="797"/><enclosure url="https://www.modernsecurity.nl/microsoft-defender-for-identity-posture/featured_hu_56945e9e05d21115.jpg" type="image/jpeg" length="251969"/></item><item><title>Monitoring admin roles in LogAnalytics</title><link>https://www.modernsecurity.nl/monitoring-admin-roles-in-loganalytics/</link><guid isPermaLink="true">https://www.modernsecurity.nl/monitoring-admin-roles-in-loganalytics/</guid><pubDate>Thu, 28 Dec 2023 21:27:00 +0100</pubDate><dc:creator>Farid Kalaidji</dc:creator><category>Identity</category><category>Security</category><description>A KQL query for Log Analytics that shows who added users to Entra ID admin roles outside PIM, and who assigned admin role eligibility.</description><content:encoded><![CDATA[<p>When it gets to know your environment, I always want to know who added admin roles to a user account. At least, I like to know who added which user to an admin role.</p>
<p>But…</p>
<p>In LogAnalytics you’ll find AuditLogs, but what to do you need to check? Do I find PIM activations interesting? Probably not. Do I want to all see PIM elevations? Maybe.</p>
<p>What I do find interesting in specific is the behaviour of adding user accounts outside PIM and who added a possible eligibility/assignment of an admin role to one of the users.</p>
<p>But looking up that information might end you up frustrated with a lot of information you will never use in any case.</p>
<p>Most of the time I use a KQL query that looks up the 2 mentioned scenarios in 1 query. With this query you can create alerts in LogAnalytics to monitor the behaviour:</p>
<ol>
<li>Who added an admin role outside PIM? (users with a name “admin”)</li>
<li>Who added an eligibility of an admin role in PIM?</li>
</ol>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">KQL</div><pre tabindex="0" class="chroma"><code class="language-kql" data-lang="kql">AuditLogs
<span class="o">|</span> <span class="k">where</span> (OperationName <span class="k">contains</span> <span class="s">&#34;Add member to role&#34;</span> <span class="k">and</span> TargetResources <span class="k">contains</span> <span class="s">&#34;admin&#34;</span> <span class="k">and</span> Identity <span class="o">&lt;</span><span class="o">&gt;</span> <span class="s">&#34;MS-PIM&#34;</span> <span class="k">and</span> LoggedByService <span class="o">&lt;</span><span class="o">&gt;</span> <span class="s">&#34;PIM&#34;</span>) <span class="k">or</span> (OperationName <span class="k">contains</span> <span class="s">&#34;Add eligible member to role in PIM requested&#34;</span> <span class="k">and</span> TargetResources <span class="k">contains</span> <span class="s">&#34;admin&#34;</span>)</code></pre></div>
</div>
<p>In case you have specific users with the name “admin” you can also workaround this by using the following query, that will only target by roles explicitly:</p>
<div class="highlight-wrapper"><div class="highlight"><div class="ms-code-label">KQL</div><pre tabindex="0" class="chroma"><code class="language-kql" data-lang="kql">AuditLogs
<span class="o">|</span> <span class="k">where</span> role <span class="k">contains</span> <span class="s">&#34;Administrator&#34;</span> <span class="k">and</span> (<span class="k">where</span> (OperationName <span class="k">contains</span> <span class="s">&#34;Add member to role&#34;</span> <span class="k">and</span> Identity <span class="o">&lt;</span><span class="o">&gt;</span> <span class="s">&#34;MS-PIM&#34;</span> <span class="k">and</span> LoggedByService <span class="o">&lt;</span><span class="o">&gt;</span> <span class="s">&#34;PIM&#34;</span>) <span class="k">or</span> (OperationName <span class="k">contains</span> <span class="s">&#34;Add eligible member to role in PIM requested&#34;</span>))</code></pre></div>
</div>
<p>If you use Sentinel, you’ll see some of the available analytics rules that will do the same for you, but as in my case, not every customer uses Sentinel.</p>
<p>And we DO want to know what is going on in the customer environment 😉</p>
]]></content:encoded><media:content url="https://www.modernsecurity.nl/monitoring-admin-roles-in-loganalytics/featured_hu_34c43fab797ec84b.jpg" medium="image" type="image/jpeg" width="1200" height="806"/><enclosure url="https://www.modernsecurity.nl/monitoring-admin-roles-in-loganalytics/featured_hu_34c43fab797ec84b.jpg" type="image/jpeg" length="170255"/></item><item><title>New website</title><link>https://www.modernsecurity.nl/new-website/</link><guid isPermaLink="true">https://www.modernsecurity.nl/new-website/</guid><pubDate>Fri, 01 Dec 2023 18:30:59 +0100</pubDate><dc:creator>Farid Kalaidji</dc:creator><category>Security</category><category>Compliance</category><category>Identity</category><description>For a while, I managed several tech blogs, but due to time constraints, I had to let them go. Now, I'm eager to set one up again, focusing primarily on</description><content:encoded>&lt;p>For a while, I managed several tech blogs, but due to time constraints, I had to let them go. Now, I’m eager to set one up again, focusing primarily on security. It won’t be your typical website; rather, it’ll incorporate more modern security elements. I’m particularly enthusiastic about the current Microsoft ecosystem, so expect posts covering Microsoft Defender XDR, Sentinel and related topics. Additionally, I’ll delve into important CVEs and other areas of personal interest.&lt;/p>
&lt;p>P.S. I post under my own title.&lt;/p>
</content:encoded><media:content url="https://www.modernsecurity.nl/new-website/featured_hu_f8297301accb69de.jpg" medium="image" type="image/jpeg" width="1200" height="800"/><enclosure url="https://www.modernsecurity.nl/new-website/featured_hu_f8297301accb69de.jpg" type="image/jpeg" length="105528"/></item></channel></rss>