<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ethan Bowen on Medium]]></title>
        <description><![CDATA[Stories by Ethan Bowen on Medium]]></description>
        <link>https://medium.com/@cybureauocracy?source=rss-adfb4d235fa6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ihj2OdOF902ImF0JuJswqQ.jpeg</url>
            <title>Stories by Ethan Bowen on Medium</title>
            <link>https://medium.com/@cybureauocracy?source=rss-adfb4d235fa6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 04:25:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cybureauocracy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[MDE’s DeviceNetworkEvents table [Part 3 — Http and SslConnectionInspected ActionTypes]]]></title>
            <link>https://medium.com/@cybureauocracy/mdes-devicenetworkevents-table-part-3-http-and-sslconnectioninspected-actiontypes-31a4ab66fbf1?source=rss-adfb4d235fa6------2</link>
            <guid isPermaLink="false">https://medium.com/p/31a4ab66fbf1</guid>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[defender-for-endpoint]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Ethan Bowen]]></dc:creator>
            <pubDate>Sun, 14 Dec 2025 19:25:41 GMT</pubDate>
            <atom:updated>2025-12-14T19:25:41.228Z</atom:updated>
            <content:encoded><![CDATA[<h3>MDE’s DeviceNetworkEvents table [Part 3 — Http and SslConnectionInspected ActionTypes]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rd_kHCrvLLamhXvtWpsqZQ.jpeg" /><figcaption>Your detection ideas when you learn more about this table</figcaption></figure><h3>Series Overview</h3><p>This is the third post in my series on <a href="https://learn.microsoft.com/en-us/defender-xdr/advanced-hunting-devicenetworkevents-table"><strong>DeviceNetworkEvents</strong></a><strong>. </strong>If you are new to MDE and Advanced Hunting, please also read the other posts in the series.</p><ul><li><a href="https://medium.com/@cybureauocracy/mdes-devicenetworkevents-table-for-soc-analysts-part-1-overview-094ca99b50c9">Part 1 — Overview</a></li><li><a href="https://medium.com/@cybureauocracy/mdes-devicenetworkevents-table-part-2-connection-actiontypes-1c5ee20d2fc4">Part 2 — Connection* ActionTypes</a></li></ul><p>This post is focused on the <strong>HttpConnectionInspected </strong>and <strong>SslConnectionInspected </strong>events.</p><h3>⚠️Caution: Windows Clients Only⚠️</h3><p>In my testing, these events are only generated on Windows client devices. That means <strong>no </strong>Linux, Mac, or Windows Servers OSes. This is not documented anywhere and is a huge limitation. If you have seen these ActionTypes on other device types, please let me know.</p><p>As a result, if you plan your network detection and investigation strategies around MDE logs like this, you will miss a lot of information. This also reinforces that MDE is <strong>not </strong>a 1:1 replacement for network-based sensors like Zeek.</p><h3>⚠️Caution: No TLS visibility⚠️</h3><p>Most HTTP (and other) traffic on the internet is now encrypted by encapsulating it inside a TLS connection. Even though the MDE agent runs on an endpoint that is part of the connection, it is not able to see inside the TLS connection. Therefore, HTTPS traffic is <strong>NOT visible </strong>to MDE and you will not see the <strong>URLs</strong> people access on Google, or SharePoint, or whatever other site uses HTTPS. You may still get <strong>SslConnectionInspected </strong>events or a <strong>ConnectionSuccess </strong>event with the domain information.</p><h3>HttpConnectionInspected</h3><p>Hypertext Transport Protocol (HTTP) is the most common protocol used to access the web. This ActionType monitors HTTP requests <strong>sent to </strong>a remote server or requests <strong>received by</strong> the device. It includes the following HTTP headers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*Pj58OHZ1wAUX6KB-vOsjaQ.png" /><figcaption>Example inbound HTTP connection</figcaption></figure><p>The most interesting things are:</p><ul><li><strong>direction</strong> (the direction of the overall connection) [In / Out]</li><li><strong>uri </strong>(which part of the site was accessed) [/file.mp3]</li><li><strong>user_agent</strong> (the browser or client application that sent the request)</li><li><strong>host </strong>(the domain requested)</li><li><strong>method</strong> (was data requested [GET] or sent [PUT, POST, etc])</li><li><strong>status_code</strong> (was it successful?)</li></ul><p>This data is nested inside the <strong>AdditionalFields </strong>column, which has different data for every ActionType.</p><h3>SslConnectionInspected</h3><p>This ActionType monitors SSL connections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*pbvIYeEeZN3gSFJJtsPbeA.png" /></figure><p>Some interesting fields here:</p><ul><li><strong>server_name</strong> — the TLS Server Name Identification (SNI) value, which can help identify the domain being accessed.</li><li><strong>subject</strong> — the server’s certificate’s subject name</li><li><strong>issuer</strong> — the server’s certificate’s issuer</li><li><a href="https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967/"><strong>ja3</strong></a> — the unique hash of the client’s TLS client hello, which can sometimes be used to fingerprint malware (and ja3s for the server side)</li></ul><h4>Always review the ‘direction’ field</h4><p>The direction field tells you if the MDE device is the client or server in the HTTP or SSL connection.</p><ul><li><strong>In</strong> — the device is the <strong>server</strong></li><li><strong>Out</strong> — the device is the <strong>client</strong></li></ul><h3>Potential Detection Ideas</h3><p>In my opinion, there are a lot of possibilities here. As I said in earlier posts, the visibility into east-west traffic (meaning within a corporate network) is unique and allows detections that might not be possible with logs from a central network sensor.</p><h4>1. Inbound HTTP connections from private IPs</h4><p>Attackers can move laterally through a network by conducting internal AiTM attacks and harvesting credentials using various protocols. To do this, they may start an HTTP server on a compromised endpoint. Then they can try to use DNS or other name resolution poisoning in order to serve malicious responses. So in this scenario, the MDE device is compromised and running a malicious web server.</p><p>Since we know that <strong>HttpConnectionInspected </strong>events are <strong>not </strong>generated on server OSes, it would therefore be quite odd for a device to <strong>receive</strong> an HTTP request. Looking for inbound HTTP requests from private IPs, or maybe even private IPs on the same network (potentially by joining with <strong>DeviceNetworkInfo</strong>) could be interesting, because this could be a sign of a compromised device doing AiTM attacks.</p><pre>DeviceNetworkEvents<br>| where ActionType startswith &quot;Http&quot;<br>| where parse_json(AdditionalFields).direction == &quot;In&quot;<br>| where ipv4_is_private(LocalIP) //note: LocalIP is the client here</pre><h4>2. Outbound SSL connections to an internal IP with a self-signed certificate.</h4><p>Keeping with the same AiTM scenario, we could also look for clients connecting to internal resources that present a self-signed certificate (meaning it is not issued by a trusted certificate authority and it may not be legitimate) or where the issuer is not a company certificate or one used inside your environment.</p><p>This could also be an interesting AI-enhanced detection. For example, maybe an automation sends a list of subject certificates and issuers seen internally and ask if it finds any suspicious.</p><pre>DeviceNetworkEvents<br>| where ActionType startswith &quot;Ssl&quot;<br>| where ipv4_is_private(RemoteIP)<br>| where parse_json(AdditionalFields).direction == &quot;Out&quot;<br>| where parse_json(AdditionalFields).issuer == parse_json(AdditionalFields).subject</pre><p>Thanks for reading! If you have feedback, please let me know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31a4ab66fbf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MDE’s DeviceNetworkEvents table [Part 2 — Connection* ActionTypes]]]></title>
            <link>https://medium.com/@cybureauocracy/mdes-devicenetworkevents-table-part-2-connection-actiontypes-1c5ee20d2fc4?source=rss-adfb4d235fa6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c5ee20d2fc4</guid>
            <category><![CDATA[log-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[defender-for-endpoint]]></category>
            <category><![CDATA[incident-response]]></category>
            <dc:creator><![CDATA[Ethan Bowen]]></dc:creator>
            <pubDate>Tue, 24 Jun 2025 07:08:11 GMT</pubDate>
            <atom:updated>2025-12-14T19:26:16.290Z</atom:updated>
            <content:encoded><![CDATA[<h3>MDE’s DeviceNetworkEvents table [Part 2 — Connection* ActionTypes]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*8kR-zRsImdJ138tTEPid-g.jpeg" /><figcaption>What I think of whenever I use this table</figcaption></figure><h3>Series Overview</h3><p>This is the second post in my series on <a href="https://learn.microsoft.com/en-us/defender-xdr/advanced-hunting-devicenetworkevents-table"><strong>DeviceNetworkEvents</strong></a><strong>. </strong>If you are new to MDE and Advanced Hunting, please read the Overview post below.</p><ul><li><a href="https://medium.com/@cybureauocracy/mdes-devicenetworkevents-table-for-soc-analysts-part-1-overview">Part 1 — Overview</a></li><li><a href="https://medium.com/@cybureauocracy/mdes-devicenetworkevents-table-part-3-http-and-sslconnectioninspected-actiontypes-31a4ab66fbf1">Part 3 — Http and SslConnectionInspected</a></li></ul><p>In the overview, I hinted at some of the confusing parts of this table. In this post, we’ll explore how some <strong>ActionTypes </strong>only cover TCP, or only monitor one direction, or only certain OSes!</p><h3>Disclaimer!</h3><p>Some of my conclusions are based on my testing in different tenants with various device configurations and not on Microsoft documentation (because it is not descriptive enough). I could be wrong about some things. I try to provide a validation query with each conclusion. If you notice something else in your tenant, let me know and I’ll update this!</p><h4>Caution ⚠️: Forward proxies</h4><p>Most events in this table capture the <strong>RemoteIP </strong>and <strong>LocalIP </strong>of a connection. These can be confusing if you use a forward proxy in your environment. This is most common in controlled environments, like enterprises. These proxies sit between the client and the internet and handle the connection on your behalf.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ergaVfrdVtMYGhIKs7dWKQ.png" /><figcaption>Inline proxy messing up your logs</figcaption></figure><p>As a result, the device connects to the <strong>proxy</strong>, not to the site. Therefore, MDE sees the proxy IP address and <strong>not </strong>the website’s IP address. If you’re hunting for IP IOCs in MDE logs, this will also create false negatives, because the device never sees the server’s IP address. This limitation is one reason to still capture proxy logs.</p><h3>ConnectionAcknowledged</h3><blockquote>“an acknowledgement that a TCP connection was accepted (<strong>syn/ack</strong>) was made”.</blockquote><p>This <strong>ActionType </strong>is part of MDE’s <a href="https://learn.microsoft.com/en-us/defender-endpoint/device-discovery#query-network-related-information">device discovery</a> feature, which helps identify non-MDE devices in networks. Before we discuss it, a quick recap of the TCP handshake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QYZzQHXQ6qnGcCj4u0ixYA.png" /><figcaption>TCP handshake between a client and server (<a href="https://thepythoncode.com/media/articles/syn-flooding-attack-using-scapy-in-python/3-way-tcp-handshake.png">source</a>)</figcaption></figure><p>In TCP, a client wants to talk to a server.</p><ul><li>It sends a TCP packet <strong>to </strong>the server with the <strong>SYN </strong>flag set.</li><li>It receives a TCP packet <strong>from </strong>the server with the <strong>SYN + ACK</strong> flags set.</li><li>Last, it sends a TCP packet <strong>to </strong>the server with the <strong>ACK </strong>flag set. Now data can be sent.</li></ul><p>Unfortunately, this means the description in the documentation is not very clear. It says:</p><blockquote>“an acknowledgement that a TCP connection was accepted (<strong>syn/ack</strong>) was made”.</blockquote><p>Does this mean that the event is generated when:</p><ul><li>the MDE device <strong>sent </strong>a SYN/ACK response (so it is the server)</li><li>the MDE device <strong>received </strong>a SYN/ACK response (so it is the client)</li><li>either?</li></ul><p>To answer this, we can look at the logs.</p><h4>Caution ⚠️: Outbound TCP connections only</h4><p>The short answer is: it only logs when the device is the <strong>client</strong> (outbound TCP connections).</p><p>Our evidence is in the <strong>AdditionalFields </strong>column, which contains information about the <strong>direction </strong>of the traffic and some information about the TCP <strong>flags</strong>. In the picture below, you can see the direction was <strong>In </strong>and the flags field value is <strong>18</strong> (SYN=2 + ACK=16).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gtuwI43bc3SIycGreUGzdg.png" /><figcaption>Inbound packets with SYN/ACK flags (18)</figcaption></figure><p>The <strong>direction</strong> refers to the <strong>packet’s</strong> direction (inbound) and <strong>NOT </strong>the <strong>connection’s</strong> direction (outbound). This distinction of direction of the<strong> packet </strong>vs <strong>connection </strong>is important for many events in this table. We know the connection is outbound, because we received a SYN/ACK packet. To verify this in your tenant, you can run this and review the flag combinations:</p><pre>DeviceNetworkEvents<br>| where ActionType == &quot;ConnectionAcknowledged&quot;<br>| summarize count() by tostring(todynamic(AdditionalFields).direction), tostring(todynamic(AdditionalFields).[&#39;Tcp Flags&#39;])</pre><p>When you’re investigating malicious network traffic, you need to know which IP <strong>initiated </strong>the connection. If an attacker gets access to a host, you want to know where they connect <strong>to</strong>. In this <strong>ActionType</strong>, the <strong>LocalIP </strong>initiated the connection and <strong>RemoteIP </strong>received it.</p><p><em>However</em>, this is not true for every <strong>ActionType</strong>, which we’ll see with <strong>ConnectionAttempt</strong>.</p><h3>ConnectionAttempt</h3><blockquote>An attempt to establish a TCP connection (syn) was made.</blockquote><p>This description has the same issue as before. What does “was made” mean?</p><h4>Caution ⚠️: Inbound TCP connections only</h4><p>It means: only <strong>inbound </strong>TCP connections are recorded. So the opposite of <strong>ConnectionAcknowledged.</strong></p><p>Again, we look at <strong>AdditionalFields </strong>and the direction and flags fields and can see this is an <strong>inbound SYN </strong>packet connecting to the device on port 8080. That means that the <strong>LocalIP </strong>is still the MDE device, but it is now the <strong>server</strong> in the TCP connection. It did not initiate the connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GCiVuQJJDqcGx2LkeM5tdQ.png" /><figcaption>An inbound connection attempt was made</figcaption></figure><p>Validation query:</p><pre>DeviceNetworkEvents<br>| where ActionType == &quot;ConnectionAttempt&quot;<br>| summarize count() by tostring(todynamic(AdditionalFields).direction), tostring(todynamic(AdditionalFields).[&#39;Tcp Flags&#39;])</pre><h3>ConnectionSuccess + ConnectionFailed 💯</h3><blockquote>A network connection was successfully established from the device.<br>An attempt to establish a network connection from the device failed.</blockquote><p>These two bad boys are great. They are straightforward and record successful (and unsuccessful) connections <strong>from the MDE device,</strong> which means:</p><ul><li><strong>RemoteIP </strong>is always the server IP (from the perspective of TCP)</li><li><strong>LocalIP </strong>is always the MDE device’s IP address and it is the client.</li></ul><p>They also include information about the <strong>initiating process </strong>like:</p><ul><li>File Name</li><li>File Path</li><li>User account and domain</li><li>Process Commandline</li><li>File Size</li><li>Signers!</li><li>More!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R5ecVrGPzb9ShjpJ8XKGXw.png" /><figcaption>Sample process information for ConnectionSuccess events</figcaption></figure><h4>Caution ⚠️: TCP Only</h4><p>In my testing, these only monitor <strong>TCP </strong>connections (if you see otherwise, please say). This could be a problem if you need to monitor UDP-based protocols like <a href="https://en.wikipedia.org/wiki/QUIC">QUIC</a> (for web traffic), <a href="https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol">DHCP</a>, <a href="https://en.wikipedia.org/wiki/OpenVPN">OpenVPN</a>, <a href="https://en.wikipedia.org/wiki/WireGuard">Wireguard</a> or others in the environment.</p><p>The fact that they only monitor TCP is not clearly documented, but if you run this query, you’ll see it only returns TCP results.</p><pre>DeviceNetworkEvents<br>| where ActionType in (&quot;ConnectionSuccess&quot;, &quot;ConnectionFailed&quot;)<br>| summarize count() by Protocol</pre><p>Since they only monitor TCP connections, it also implies that a <strong>ConnectionFailed</strong> event means that no SYN/ACK was received from the server.</p><h4>Caution ⚠️: RemoteUrl values are Inconsistent</h4><p>The <strong>RemoteUrl </strong>column contains information about the domain or Url accessed. In the case of HTTP, it usually has the full URL. However, with HTTPS it is just the domain name. The problem is <em>sometimes </em>it contains the protocol “http” or “https” in the Url (e.g.: <a href="https://microsoft.com)/">https://microsoft.com)</a>. But sometimes it also just doesn’t...?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hcmS3HCHbhePeva8xamuUA.png" /><figcaption>Same connection, same time, same ports, different urls</figcaption></figure><p>Sometimes you get two events for the same connection and have both (like above), sometimes it is onlyone event with the domain, and sometimes only with “<strong>http</strong>”. I assume it is something to do with how the event was observed by the agent? It’d be nice if Microsoft aligned it.</p><p>This issue is important if you are doing <strong>exact </strong>matches (==) for a domain. If you do this…</p><pre>| where RemoteUrl == &quot;malware.com&quot;</pre><p>…you can get false negatives.</p><h3>ConnectionFound</h3><blockquote>An active network connection was found on the device.</blockquote><p>Honestly, I don’t know what causes a connection to be <strong>found</strong>. But it is very inconsistent and I cannot figure out <strong>why</strong> a connection gets found vs not found. My hypothesis is that MDE did not see the connection start, but sees it happening on the host???</p><p>It does provide the process information though!</p><h3>ConnectionRequest</h3><blockquote>The device initiated a network connection.</blockquote><h4>Caution ⚠️: <strong>Linux </strong>and <strong>Mac </strong>devices only???</h4><p>I have only seen this <strong>ActionType </strong>generated on Linux and Mac devices. If you’ve see something else, please let me know!</p><p>It also appears to capture successful <strong>outbound </strong>connections and also includes <strong>process </strong>information!</p><h4>Caution ⚠️: TCP only</h4><p>In my testing, this only captures TCP connections.</p><h3>Detection Ideas 🕵️‍♂️</h3><p>Looking at all the Connection* ActionTypes, <strong>ConnectionSuccess</strong> provides the most possibilities for detections because you get the combination of:</p><ul><li>Domain</li><li>Process + Parent Process</li><li>Device name</li></ul><p>This allows you to consider multiple interesting variables in a query.</p><h4>Domains seen on 2 or fewer devices over 30 days and accessed by PowerShell</h4><p>PowerShell may be used for C2 communications and would likely use a uncommon domain in your environment. This query combines the visibility MDE provides across your environment to create a baseline (of uncommon domains) with visibility on a specific endpoint (which process accessed that uncommon domain).</p><pre>let UncommonDomains=<br>DeviceNetworkEvents<br>| where Timestamp &gt; ago(30d)<br>| where ActionType == &quot;ConnectionSuccess&quot;<br>| extend Domain = extract(@&quot;^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)&quot;, 1, RemoteUrl)<br>| summarize dcount(DeviceId) by Domain<br>| where dcount_DeviceId &lt;= 2<br>| project Domain;<br>DeviceNetworkEvents<br>| where Timestamp &gt; ago(1d)<br>| where ActionType == &quot;ConnectionSuccess&quot;<br>| where InitiatingProcessVersionInfoOriginalFileName in~ (&quot;powershell.exe&quot;, &quot;pwsh.exe&quot;, &quot;powershell_ise.exe&quot;)<br>| extend Domain = extract(@&quot;^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)&quot;, 1, RemoteUrl)<br>| where Domain in (UncommonDomains)<br>| summarize make_set(Domain) by DeviceName, DeviceId</pre><h4>Devices, which normally don’t RDP, connecting to internal devices on an RDP port with a non-known RDP process</h4><p>Again, we can use the visibility across all devices to build a baseline and then use that to find ‘anomalies’.</p><p>Sysadmins and users likely use the built-in Windows RDP client (<strong>mstsc.exe</strong>). So to limit false positives, we’ll look for traffic on an RDP port (3389), which does not come from <strong>mstsc.exe</strong>. Attackers might use their own implant or other host processes to tunnel their RDP sessions.</p><pre>let RDPDevices =<br>DeviceNetworkEvents<br>| where Timestamp between (ago(30d) .. ago(1d)) <br>| where ActionType == &quot;ConnectionSuccess&quot;<br>| where RemotePort == 3389<br>| distinct DeviceId;<br>DeviceNetworkEvents<br>| where Timestamp &gt; ago(1d)<br>| where ActionType == &quot;ConnectionSuccess&quot;<br>| where RemotePort == &quot;3389&quot;<br>| where InitiatingProcessVersionInfoOriginalFileName != &quot;mstsc.exe&quot; //could add others<br>| where DeviceId !in (RDPDevices)<br>| where ipv4_is_in_range(RemoteIP, &quot;10.0.0.0/8&quot;)</pre><p>Possible tuning/improvements:</p><ul><li>Remove the exclusion for <strong>mstsc.exe </strong>to search a broader set of activity.</li><li>Add internal IP ranges in your environment or only addresses of high value assets</li></ul><h3>Next Blog</h3><p>That was a quick review of some of the interesting parts of the <strong>Connection</strong>* ActionTypes in DeviceNetworkEvents. The next blog will be on <strong>HttpConnectionInspected</strong>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c5ee20d2fc4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tracking a device’s IP assignments with MDE’s DeviceNetworkInfo table]]></title>
            <link>https://medium.com/@cybureauocracy/tracking-a-devices-ip-assignments-with-mde-s-devicenetworkinfo-table-430270ca539e?source=rss-adfb4d235fa6------2</link>
            <guid isPermaLink="false">https://medium.com/p/430270ca539e</guid>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[kql]]></category>
            <dc:creator><![CDATA[Ethan Bowen]]></dc:creator>
            <pubDate>Thu, 19 Jun 2025 07:43:00 GMT</pubDate>
            <atom:updated>2025-06-19T07:43:00.419Z</atom:updated>
            <content:encoded><![CDATA[<h3>Problem</h3><p>During incident investigations you often need to know what IP address a device was assigned at a specific time (or over a period of time). This is usually to track lateral movement in other devices/logs.</p><p>Unfortunately, tracking a device’s IP assignments over time is not easy. This is especially true if you don’t have DHCP logs showing when IPs were assigned, renewed, and released.</p><h3>Solution</h3><p>Luckily, MDE provides a table, <strong>DeviceNetworkInfo</strong>, that allows us to create ‘session-like’ IP assignment data.</p><p>I wrote a whole post about it on the company’s blog and you can read it here:</p><p><a href="https://blog.nviso.eu/2025/06/19/tracking-historical-ip-assignments-with-defender-for-endpoint-logs/">Tracking historical IP assignments with Defender for Endpoint logs</a></p><p>Let me know your thoughts over there!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=430270ca539e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Entra ID’s App/Service Principal User Experience is a Mess [Updated June 2025]]]></title>
            <link>https://medium.com/@cybureauocracy/entra-ids-app-service-principal-user-experience-is-a-mess-updated-june-2025-45d70b5ba38b?source=rss-adfb4d235fa6------2</link>
            <guid isPermaLink="false">https://medium.com/p/45d70b5ba38b</guid>
            <category><![CDATA[entra-id]]></category>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[blue-team]]></category>
            <dc:creator><![CDATA[Ethan Bowen]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 14:32:44 GMT</pubDate>
            <atom:updated>2025-06-09T14:32:44.908Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*JQ3np3HZY71zv6-soQI54g.jpeg" /><figcaption>DALLE 3 prompt: [a confused man surrounded by the words “service principal” and “app registration” and “enterprise application”. please use these exact words and spellings.] No notes!</figcaption></figure><h3>Update — June 2025</h3><p>This was originally published on my WordPress blog in September 2024, but I decided to stop paying for that so I moved it here. After I published it, some PMs at Microsoft contacted me to discuss the issues. They were really nice and mostly acknowledged them. They said some things would be changing in the future, so I decided to check what’s new in June 2025.</p><p>Microsoft’s Entra ID (formerly Azure Active Directory (AAD)) is probably the most important identity platform in the world. Any organization that uses Azure or Microsoft 365 products uses Entra ID as a core authentication/authorization platform.</p><p>The high importance of Entra ID is why I find the overall Application Registration/Service Principal experience so unacceptable. As you will see in this post, Microsoft has not engineered or exposed these objects in an easily comprehensible way, which leads people to misunderstand their purpose and scope.</p><p>The outcome is, of course, worse security for everyone.</p><h3>What are Application Registrations and Service Principals?</h3><p>This is not the intent of the post, so I will use a high level definition here.</p><ul><li><strong>Application Registration (App) — </strong>The <strong>globally </strong>🌍 unique object in Entra ID for an application.</li><li><strong>Service Principal (SP)</strong> — A specific <strong>instance of that application object</strong> in a single tenant. (Excellent doc <a href="https://learn.microsoft.com/en-us/entra/identity-platform/app-objects-and-service-principals?tabs=browser">here</a>)</li></ul><p>Apps are the <strong>foundational</strong> object here. You create an <strong>App </strong>in your tenant and that app is <strong>represented</strong> in other tenants (also in your own) by a corresponding <strong>Service Principal</strong>. Microsoft provides a good diagram <a href="https://learn.microsoft.com/en-us/entra/identity-platform/app-objects-and-service-principals?tabs=browser">here</a> (image copied below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*GP2aq9yZ17_KqBMVJFz1Ww.png" /></figure><p>Important things to know:</p><ul><li>Creating an application in the Portal automatically creates a SP in the <strong>same </strong>tenant.</li><li>SPs <strong>also </strong>have their <strong>own </strong>credentials and authorizations. The application object is <strong>only the template</strong>. Therefore, a SP can have an Entra ID Role or API permissions (Graph, etc).</li><li>Actions taken in a tenant (e.g. create a user) are done by the<strong> SP</strong>.</li></ul><h3>Why would you create apps/SPs?</h3><p>In my experience, most organizations have four use cases:</p><ol><li><strong>Service accounts/daemons</strong> — e.g. to manage Azure infrastructure or run scripts that must authenticate to AAD</li><li><strong>SAML/other authentication to internal apps</strong> — e.g. authenticate a user to a legacy Line-of-Business app</li><li><strong>Using 3rd party vendors that have authentication integrated with Entra ID</strong> — e.g. Dropbox, GitHub, etc</li><li><strong>Develop and publish applications to your customers</strong> — e.g. the opposite of #3</li></ol><p>The overall problem is that these objects are <strong>HARD</strong>. <strong>TO.</strong> <strong>UNDERSTAND</strong> and Microsoft’s User Experience/Design decisions make them even harder to learn. These objects also break traditional mental models of accounts.</p><p>For example, imagine if you created a user’s account and that action actually created <strong>two </strong>different object types with <strong>two </strong>different sets of permissions and credentials. The Entra ID admin portal, which is probably where most admins/devs are first exposed to these types of object, contributes to this confusion.</p><p>In the sections below, imagine you are a sysadmin new to Entra ID that is trying to figure this all out on the job.</p><h3>The names in Portal are confusing [06.2025 — Still an issue]</h3><p>First, in the Entra ID Portal, <strong>App Registrations</strong> appear as <strong>App Registrations</strong> as expected.</p><p>However, <strong>Service Principals</strong> are instead put under <strong>Enterprise applications</strong> and the name <strong>Service Principal</strong> appears almost nowhere. This is confusing, because Enterprise applications are actually a types of Service Principals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/0*Q1ZFvxrMNkyzu9RK.png" /></figure><p>In my experience, <strong>Service Principal </strong>is not a well understood term and I think this contributes to why that is.</p><p>In my opinion, the Portal experience for SPs is designed for the use case of 3rd party apps in your tenant, and most actions are around consenting to 3rd party apps. I think this explains some of the UX decisions below.</p><p><strong>Update 06.2025 </strong>— I don’t see any changes here. The UI is the same.</p><h3>Entra ID Portal search is inconsistent [06.2025 — Still an issue]</h3><p>Searching for an <strong>App/SP</strong> in the Portal is frustrating. You often will not be able to find the App/SP you want when using the Overview page’s “<strong>Search your tenant</strong>” feature.</p><p>This is because Microsoft <strong>uses a startswith() function for Apps/SPs</strong>, which is <strong>not </strong>how the other directory object searches function.</p><p>Here is an example. I have an App+SP named: <strong>myUniqueApp</strong> and also a group named: <strong>myUniqueGroup. </strong>I expect to find both of these with my search below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EmRpUsrvp9cKhO6v.png" /></figure><p>However, only my group is found and my App+SP are not. The reason for this is that the Graph API request for Apps+SPs uses a <strong>startswith(query)</strong> filter and the other objects use a <strong>substring </strong>filter on the display name (e.g. group name). You can see this below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/0*hmtGfIOxIamM4ybd.png" /></figure><p>I have no idea<strong> </strong>why this is done and it is <strong>extremely </strong>annoying; it also leads people to incorrect conclusions, because they get a false negative result. They assume a <strong>substring </strong>search was done against <strong>all objects</strong> because other objects with this string in a substring position are returned.</p><p><strong>Update 06.2025 </strong>— This is still an issue.</p><h3>Service Principal roles cannot be seen on Service Principal page [06.2025 — Still an issue]</h3><p>As mentioned above, SPs <strong>can have roles</strong> <strong>assigned </strong>to them (e.g. Helpdesk Administrator).</p><p>However, you <strong>cannot see roles assigned to a SP in the Portal</strong>. The reason why is…?? See an example below. My SP has <strong>Helpdesk Administrator</strong>, but you can only see that if you query an API<a href="https://cybureauocracy.substack.com/p/entra-ids-appservice-principal-user#footnote-2-156627615">2</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BdsWZ-PyXFlPP6G5.png" /></figure><p>You may say, “Wait! why does it say your SP has <strong>Cloud Application Administrator</strong> and <strong>Reports Reader</strong>??”.</p><p>That is a great question! First, it does <strong>not</strong> say that! It says those roles <strong>can be </strong>assigned to “manage this resource”. It is <strong>not </strong>saying those roles <strong>are assigned to</strong> this object.</p><p>That is, of course, the <strong>opposite</strong> of what you would expect if you compare it to say…the <strong>User</strong> page, which uses the same icon and a similar title but does mean “roles<strong> assigned to</strong> this object”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/0*ZsjbHMS6m1xbkRQq.png" /></figure><p>So unless you want to drop into a terminal session or enumerate through every Entra ID role in your tenant, you have no way to know what roles this SP is assigned!</p><p><strong>Update 06.2025 </strong>— This is still an issue.</p><h3>Service Principal credentials cannot be seen in admin portal [06.2025 —Still an issue, but mitigations exist]</h3><p>In the screenshot above, you can also see that there is no panel option for <strong>certificates or secrets</strong> on the Service Principal object. In fact, there is<strong> nowhere in the UI to even suggest that it is possible for a SP to have credentials.</strong></p><p>Even though SPs <strong>can have credentials</strong>, the only way to see them is via code (PowerShell, Graph API).</p><p>Most people do not know they can have their own credentials, because there is no way to see them in the most common admin interface: the Portal. When you combine that with the fact that Service Principals are, by default, excluded from Conditional Access Policies, it is a great persistence mechanism.</p><p><strong>Update 06.2025 </strong>—Overall, I’d say this is a smaller issue, but still exists. Microsoft has a feature called ‘<a href="https://learn.microsoft.com/en-us/entra/identity-platform/howto-configure-app-instance-property-locks">App Instance Lock</a>’ on the <strong>App Registration</strong>, which prevents anyone from adding credentials to the SP of an app. This was enabled by <a href="https://www.michev.info/blog/post/5884/protect-your-multi-tenant-applications-from-being-hijacked-by-admins-in-the-customer-tenant">default</a> in March 2024 (so even before I wrote the original article). I believe the goal is for <strong>only </strong>App Registrations to use credentials in the future and this is a step towards that.</p><h3>Microsoft does not publish a full list of First Party Apps [06.2025 — Worse]</h3><p>When you create a new Entra ID tenant, Microsoft automatically adds a lot (&gt;600 as of this writing) of its own applications to your tenant. This is things you expect like <strong>Office 365 Exchange Online</strong> or <strong>Microsoft Teams</strong>. But also odd things like <strong>CCM TAGS</strong> and <strong>policy enforcer</strong>. This is done so that you don’t need to consent to every Microsoft service.</p><p>These apps are referred to as <strong>First Party</strong> apps, because they’re owned and controlled by Microsoft. There are some ways you can validate an app is First Party as described on <a href="https://learn.microsoft.com/en-us/troubleshoot/azure/entra/entra-id/governance/verify-first-party-apps-sign-in">this</a> Microsoft page. However, there are two small, but important, disclaimers on that page: [emphasis mine]</p><blockquote><em>The following table lists some, </em><strong>but not all</strong><em>, first-party Microsoft applications.</em></blockquote><blockquote><em>First-party Microsoft applications don’t </em><strong>always</strong> <em>result in a service principal that’s created in your tenant. In this case, you’ll likely continue to see the applications in your sign-in reports.</em></blockquote><p>This means that you <strong>could</strong> (and likely will) find a <strong>First Party</strong> app in your Microsoft logs that is <strong>not </strong>in Microsoft documentation and also does <strong>not </strong>appear in your admin Portal.</p><p>The only way to know it was put there by Microsoft is open a support ticket and ask.</p><p><strong>Update 06.2025 </strong>— Microsoft removed the partial <a href="https://learn.microsoft.com/en-us/troubleshoot/entra/entra-id/governance/verify-first-party-apps-sign-in">list</a> in the docs and instead tells you to use Graph PowerShell to check the <strong>AppOwnerOrganizationId </strong>value or check the App page in the Portal. This is not workable for the reasons I discuss above. Hopefully a better solution is found.</p><h3>First Party Apps have hidden permissions [06.2025 — Still an issue]</h3><p>When you query Microsoft applications via Graph API or the Portal you see they do not have configured permissions or API scopes. That is obviously confusing, since they must have permissions to something in order to work.</p><p>Eric Woodruff did excellent research on this <a href="https://www.semperis.com/blog/unoauthorized-privilege-elevation-through-microsoft-applications/">here</a>.</p><p>To summarize: not only can you <strong>not see </strong>First Party app permissions, some First Party apps had permissions that were <strong>much higher</strong> than you’d expect. Eric shows an example where the <strong>Device Registration Service</strong> Service Principal could add a user to the <strong>Global Administrator</strong> role. That privilege escalation issue is now fixed.</p><p>However, he also found, [emphasis mine]</p><blockquote><em>Microsoft noted that it has </em>other authorization mechanisms<em> that exist behind the scenes for Microsoft applications. These mechanisms allowed us to perform the actions described in this article.</em></blockquote><blockquote><em>Microsoft rightfully highlighted that this capability is therefore not a material flaw within any of its authorization models. However, it acknowledged that externally, based on what we can view and have access to, the capabilities </em>might appear to be in error.<em> External to Microsoft, OAuth 2.0 scopes are absolute when interacting with Microsoft Graph, so without knowledge of other authorization systems, </em>we can only infer<em>.</em></blockquote><p>This note from Microsoft is <strong>fascinating</strong>. They acknowledge customers have <strong>no visibility</strong> into what permissions Microsoft apps actually have internally and therefore we may make incorrect assumptions about what is or is not expected!</p><p>Basically, if it’s a Microsoft app, just practice zero trust. And by that I mean have zero trust in your instincts and trust that it’s meant to be.</p><p>Side note: Remember the time the US Government <a href="https://www.cisa.gov/sites/default/files/2023-07/aa23-193a_joint_csa_enhanced_monitoring_to_detect_apt_activity_targeting_outlook_online_2.pdf">identified an intrusion</a> <strong>at Microsoft</strong> because the government <strong>asked </strong>why an unknown app was suddenly showing up in their <strong>MailItemsAccessed </strong>events?</p><p>Now imagine that analyst only saw that it was a Microsoft app and closed the incident as a false positive. Are we expected to ask Microsoft every time we see one of the &gt;600 apps doing something odd? I have personally seen many Microsoft apps access mail, that don’t seem like they should access mail based on their name.</p><p><strong>Update 06.2025</strong> — I have not seen any changes here. I think this one is the hardest to solve, so I am not surprised. If first party apps have secret access to many Microsoft products, it is hard to describe that access in a permission model that makes sense for the public.</p><h3>What should change?</h3><p>First, Microsoft should improve the UI/UX experience for Apps/Service Principals. Most admins interact with their tenant in the Portal. Most discover what is <strong>available and possible</strong> through the Portal. Most people do not start learning a concept with code or even in the documentation. The Portal provides a <strong>structured picture </strong>of your tenant and it is therefore important that it reflects your actual tenant.</p><ul><li>It must be <strong>clear</strong> that Service Principals are their own first rate identity object and not just links to an App Registration.</li><li>Expose SP roles and credentials in the Portal</li><li>Fix the weirdly bad search experience</li></ul><p>Second, they should provide a complete list of First Party apps, in one location, that customers may see in their tenants and a description of what the app is used for. I agree, it isn’t reasonable for us to understand all the internal auth, but when you see stuff like <strong>O365 Demeter</strong> you should have an idea what it is for. Sorry, but I don’t trust you. Also, set a better example for the kids.</p><p>Thanks for reading. Please send thoughts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45d70b5ba38b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MDE’s DeviceNetworkEvents table for SOC analysts [Part 1 — Overview]]]></title>
            <link>https://medium.com/@cybureauocracy/mdes-devicenetworkevents-table-for-soc-analysts-part-1-overview-094ca99b50c9?source=rss-adfb4d235fa6------2</link>
            <guid isPermaLink="false">https://medium.com/p/094ca99b50c9</guid>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Ethan Bowen]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 19:11:28 GMT</pubDate>
            <atom:updated>2025-12-14T19:26:44.613Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding MDE’s DeviceNetworkEvents table for SOC analysts [Part 1 — Overview]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*Kc0afQnNxPLT3BwPgV7D3A.jpeg" /><figcaption>Your reaction when you know how to use DeviceNetworkEvents for your investigation</figcaption></figure><h3>Series Intro</h3><p>The <strong>DeviceNetworkEvents</strong> table in Microsoft Defender for Endpoint (MDE) provides valuable logs about network activity occurring on an endpoint. It allows you to detect:</p><ul><li>Find the least common parent/child relationships with the most network activity</li><li>Find devices RDPing to devices in their local network, which haven’t RDPed anywhere in 30 days.</li><li>Find devices creating outbound connections on TCP/3389 not launched by a known RDP process.</li><li>Find Kerberos requests sent to non-domain controllers.</li><li>Many more!</li></ul><p>It does this by including not only traditional IP source/destination address information (like in netflow logs), but also higher level information about:</p><ul><li>Originating process (winword.exe, cmd.exe, etc)</li><li>Application protocol data (HTTP, SSH, SSL, Kerberos, etc)</li><li>Listening sockets</li></ul><p>And all of it from the perspective of the endpoint!</p><p>In this blog series, I plan to go through some event types <strong>(</strong>column is called <strong>ActionTypes) </strong>and describe how they work, how they can be used for investigations, and also detection ideas. This series is meant for analysts that will use the tables when reviewing alerts or creating detections.</p><p><strong>List of other posts in series:</strong></p><ul><li><a href="https://medium.com/@cybureauocracy/mdes-devicenetworkevents-table-part-2-connection-actiontypes-1c5ee20d2fc4">Part 2 — Connection* ActionTypes</a></li><li><a href="https://medium.com/@cybureauocracy/mdes-devicenetworkevents-table-part-3-http-and-sslconnectioninspected-actiontypes-31a4ab66fbf1">Part 3 — Http and SslConnectionInspected</a></li></ul><h4>Advanced Hunting Logs</h4><p>MDE logs a lot of activity occurring on hosts, including process, registry, DLL loads, and many more. This data goes to the cloud and ultimately goes to Defender XDR’s <a href="https://learn.microsoft.com/en-us/defender-xdr/advanced-hunting-overview"><strong>Advanced Hunting</strong></a> feature, which allows analysts to query the last 30 days of logs. (Many organizations also export the logs to Sentinel or another platform for longer retention).</p><p>The category of interest for this series is network events! These network logs are kind of unique compared to traditional network logs, because they’re captured directly on the endpoint.</p><h4>Network logs from a Host Sensor: A Unique Perspective</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8vMgCJv4FIH5W-7C_8lbAg.png" /><figcaption>Host-based monitoring provides endpoint information that may not be available in network-based</figcaption></figure><p>Traditional network logging occurs at a centralized network tap. For example: a border firewall as traffic leaves a corporate network, a web proxy, or a tap on a central router. As a result, the activity is usually correlated to hosts based on the <strong>IP address</strong> in the log.</p><p>This mapping can be difficult, time consuming, or impossible, depending on an organization’s network management, NATing, or asset inventory. Analysts may also simply lack logs that track IP assignments like DHCP or DNS or simply not know how to do it.</p><p>Because MDE observes the network activity directly on the host, there is no need to find out which host is responsible for the activity. It is already in the logs.</p><p>Another benefit: capturing on the host itself allows you to see <strong>internal &lt;-&gt; internal</strong> traffic. Generally, network sensors are deployed at network egress points. So this new visibility is valuable for tracking lateral movement between internal hosts.</p><p><strong>Important</strong>: MDE does not decrypt (break/inspect) TLS sessions. This means you do not see any application data (like HTTP method, URL, host, content, etc)!</p><p>Let’s look at what types of network activity MDE logs.</p><h4>Available Action Types</h4><p>The events in the table each have an <strong>ActionType</strong>, which describes the event type. For example: <strong>ConnectionFailed </strong>or <strong>HttpConnectionInspected</strong>.</p><p>For some weird unknown reason, Microsoft does <strong>not </strong>publish the list of monitored actions in the public table schema (<a href="https://learn.microsoft.com/en-us/defender-xdr/advanced-hunting-devicenetworkevents-table">here</a>). However, you can find them in the Advanced Hunting UI under the “<strong>View reference</strong>” link:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*F2QLKnvVT5IV_yAeUQmHNA.png" /><figcaption>Finding the annoyingly hidden ActionType values.</figcaption></figure><p>As of May 2025, these are:</p><ul><li>ConnectionAcknowledged</li><li>ConnectionAttempt</li><li>ConnectionFailed</li><li>ConnectionFound</li><li>ConnectionRequest</li><li>ConnectionSuccess</li><li>DnsConnectionInspected</li><li>FtpConnectionInspected</li><li>HttpConnectionInspected</li><li>IcmpConnectionInspected</li><li>InboundConnectionAccepted</li><li>InboundInternetScanInspected</li><li>KerberosConnectionInspected (*)</li><li>ListeningConnectionCreated</li><li>NetworkSignatureInspected</li><li>NtlmAuthenticationInspected</li><li>SmtpConnectionInpected</li><li>SshConnectionInspected</li><li>SslConnectionInspected</li></ul><p>*in a classic Microsoft move, this <strong>ActionType </strong>is currently not documented in the table. It will probably be added eventually…</p><h4>Paired Processes</h4><p>Many of the <strong>ActionTypes </strong>in <strong>DeviceNetworkEvents </strong>provide information about the process (and parent process) that started the activity. This feature <strong>greatly </strong>increases the value of the logs and increases the speed of your investigation.</p><p>Previously, your investigation may have started with a simple alert:</p><ul><li>Connection from <strong>10.56.43.20</strong> to <a href="https://malware.com/">malware.com</a></li></ul><p>and now it has:</p><ul><li>Connection from <strong>ceo-laptop.corp.com</strong> to <a href="https://malware.com/">malware.com</a> launched by <strong>powershell.exe</strong> with parent <strong>winword.exe</strong>.</li></ul><p>See the sample event from the table below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CuTxV4FQ3wVurJLkbmbgpg.png" /><figcaption>Successful outbound connections to Microsoft domains initiated by different processes</figcaption></figure><h4>ActionTypes with Process Information</h4><p>Unfortunately, only the following <strong>ActionTypes </strong>include process information:</p><ul><li>ConnectionFailed</li><li>ConnectionFound</li><li>ConnectionRequest</li><li>ConnectionSuccess</li><li>InboundConnectionAccepted</li><li>ListeningConnectionCreated</li></ul><p>This is probably because the other actions are generated by MDE’s <a href="https://techcommunity.microsoft.com/blog/microsoftdefenderatpblog/new-network-based-detections-and-improved-device-discovery-using-zeek/3682111">built-in Zeek network sensor</a>, which does not capture the process information. However, the Zeek-based events provide unique insights into the application layer activity.</p><h4>Most Relevant Columns</h4><ul><li><strong>DeviceId </strong>and <strong>DeviceName </strong>columns identify the device that generated the event.</li><li><strong>RemoteIP</strong>/<strong>RemotePort </strong>and <strong>LocalIP</strong>/<strong>LocalPort </strong>are classic IP pairs. These <em>can </em>be confusing, because Remote/Local may not always mean what you think (more on that in a later blog).</li><li><strong>InitiatingProcess*</strong> columns are about the process that generated or handled the event. Note this includes command line and file path. These are the same as in other Device* tables from MDE. You get the filename + path, hash, command line, and some more.</li><li><strong>InitiatingProcessParent*</strong> columns are about the parent of the handling process.</li><li><strong>AdditionalFields</strong> is a JSON object with different data for each event <strong>ActionType</strong>. For example: in <strong>HttpConnectionInspected </strong>events, this contains the URI and Host headers. It is important to review this for every ActionType.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*otQFb8EXmNkwTFeX14DeAg.png" /><figcaption>A nice sample of AdditionalFields from HttpConnectionInspected</figcaption></figure><h4>Next blog post: Connection ActionTypes</h4><p>In the next post of this series, we’ll look at the <strong>Connection*</strong> ActionTypes. Follow to get notified when it’s released (in a week or so).</p><h4>A Note on Event Sampling</h4><p>MDE does not log every network event on a host. For example, not every outbound connection from a process is recorded. This makes it difficult to use MDE logs for true forensic analysis. However, a lot of activity is recorded, so we work with what we have.</p><p>If you want to learn more about the sampling/filtering in MDE, I recommend reading Olaf Hartong’s <a href="https://medium.com/falconforce/microsoft-defender-for-endpoint-internals-0x03-mde-telemetry-unreliability-and-log-augmentation-ec6e7e5f406f">blogs</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=094ca99b50c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the ACH of cyber?]]></title>
            <link>https://medium.com/@cybureauocracy/what-is-the-ach-of-cyber-5b0c98525e9a?source=rss-adfb4d235fa6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b0c98525e9a</guid>
            <category><![CDATA[security-monitoring]]></category>
            <category><![CDATA[cybersecurity-policy]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Ethan Bowen]]></dc:creator>
            <pubDate>Thu, 29 May 2025 07:35:55 GMT</pubDate>
            <atom:updated>2025-05-29T07:35:55.003Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is the ACH of cyber? Thoughts on TD Bank’s very bad anti-money laundering program, cybersecurity, and fines</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rSO8FfghQv8IUV1wvBUSjA.jpeg" /></figure><p>In October 2024, U.S. regulators fined TD bank¹ around 3 billion dollars² for running a very bad anti-money laundering (AML) program over multiple years. That is about 30% of their FY23 net income³. The fine is also apparently “the largest ever assessed under the BSA.”⁴</p><p>FinCEN⁵, one of the U.S. financial regulators, found that the Bank “vastly underinvested in its AML compliance efforts” and its AML staffing “was not proportionate to its size, risk profile, and ongoing compliance concern”, among many other things (pg. 7).</p><p>In this post, I’ll review some interesting findings from the fine and draw parallels between what TD Bank failed at and how some organizations might be failing at the same things in cybersecurity.</p><h3>A bad monitoring program</h3><p>We start with the Bank’s inadequate program for monitoring potentially suspicious activity.</p><h3>1. Lack of visibility</h3><p>In cybersecurity, the key to a successful monitoring program is collecting logs of user/device/application/network activity, in order to search through it later to find bad stuff.</p><p>This is a <strong>huge </strong>topic area in cybersecurity. We ask ourselves things like:</p><ul><li>What logs do you save? Process creation events? Sign-in logs? Every single inbound HTTP request to your corporate website? Every single registry key change?</li><li>How long do you save them? 30 days? 1 year? 10 years?</li><li>Where do you save them? A SIEM? A Data lake? Dave’s laptop? A piece of paper?</li><li>How do you balance the cost of all those things? Paper is expensive!</li></ul><p>TD Bank took the easy way out and decided to just <strong>not</strong> monitor some things! Unfortunately one of those things was Automated Clearing House (ACH), an extremely common method to send money in the United States.</p><blockquote><em>TD Bank failed to monitor a number of transaction types, including ACH, certain funds transfers, and certain monetary instruments (including remote deposit capture (RDC)). This failure to monitor represented over 80% of the activity in these types of transactions and aggregated to </em><strong><em>trillions of dollars in value</em></strong><em>.</em></blockquote><blockquote><em>TD Bank’s monitoring system lacked transaction codes necessary to monitor 98% of domestic ACH transactions. (pg 22–23)</em></blockquote><p>If your job is to detect money laundering and you’re not looking at one of the most common payment methods, which represents <strong>trillions</strong> <strong>of</strong> <strong>dollars</strong> in transactions, that seems like an obvious issue! So fair play to the regulators.</p><p><strong>But, this makes me wonder: what is the cybersecurity version of ACH logs? 🤔</strong></p><p>By that I mean: what is a log type that feels so high value that you would be <strong>shocked</strong> to learn one of the largest banks in the world was <strong>not</strong> monitoring it?</p><p>I think the following 5 are at that level:</p><ol><li>Process creation events with command line</li><li>VPN/remote access sign-ins</li><li>User logon/logoff from devices (think Windows 4624)</li><li>Entra ID/Active Directory user logins + password changes</li><li>SMTP inbound/outbound logs with headers</li></ol><p>I’m interesting in what people think, so make a comment or message me and tell me!</p><h3>2. No new detections</h3><p>In addition to not monitoring ACH, the bank also paused changes to “monitoring scenarios” for ~4 years while they upgraded the AML software (from a vendor) (pg. 21–22). The project was supposed to take 1 year, but was delayed multiple times due to budget/resources/expertise.</p><p>Now…I don’t work in AML, but that seems…insane? I assume a <strong>core</strong> job function of an AML analyst is to come up with scenarios for how to detect money laundering, test them, and implement them. Therefore, it cannot be normal to<strong> </strong>simply <strong>not</strong> do that for 4 years?</p><p>In cybersecurity, detections are updated and reviewed constantly. If you buy security tools, the vendor usually creates the detections for you. For example, look at the definition <a href="https://www.microsoft.com/en-us/wdsi/definitions/antimalware-definition-release-notes">release notes</a> for Microsoft’s Defender Anti-virus. There are probably 50+ changes every release, with multiple releases a day.</p><p>Imagine you did not update your AV definitions for…4 years. I think everyone would agree that is too long.</p><p>But, on the other hand, what is the line? Microsoft <strong>recommends</strong> you take signature updates within hours of release. Is 1 day too long? 2 days? 2 weeks?</p><h3>3. Detections had inappropriate thresholds</h3><p>In addition to not updating the detection scenarios, the Bank created some questionable detection logic.</p><blockquote><em>However, these scenarios were designed to be used for wire activity and were not fit for the purpose of monitoring Zelle activity: they generated alerts only when a personal account received at least two wires or transfers with an aggregate greater than or equal to $10,000 over five business days or sent at least two cash deposits with an aggregate greater than or equal to $9,000 over five business days. Yet, Zelle has a daily transaction limit of $2,500 and a rolling 30-day limit of $10,000.</em></blockquote><blockquote><em>TD Bank repeatedly cited these scenarios (without describing the scenarios’ parameters), along with even less applicable scenarios geared towards commercial customers with a $100,000 threshold, as examples of current Zelle monitoring to at least one of its regulators, even though the thresholds were not suitable to the product and TD Bank anticipated monthly alert volume for these scenarios in the single digits. (pg. 28)</em></blockquote><p>So the problem is they created a detection that makes sense, but when you consider the <strong>full</strong> context (Zelle’s transaction limits), it is actually very unlikely to occur. That’s a great example of technically correct, but effectively not.</p><p>I also find it fascinating that the regulator cites the low number of alerts as a <strong>clear negative</strong> and evidence that the detection logic was bad!</p><p>In cybersecurity, there are big debates about how to limit false positives while still detecting malicious activity. For example, take the following scenario:</p><ul><li>You want to detect bruteforce attacks in Entra ID.</li><li>While developing the detection logic, you set the threshold to 10 incorrect passwords events (ResultType == 50126) per user per hour. But you have too many false positive alerts. User constantly forget their password.</li><li>So you increase the threshold to 100 incorrect passwords. Your logic is that offline bruteforce attacks use thousands+ of guesses per second, so 100 against Entra ID should be low enough to detect this, right?</li><li>You receive no alerts with your new logic. Job well done! You created a detection for MITRE Technique T1110. Box checked.</li></ul><p>The problem is you did not understand the entire context. Entra ID has a <a href="https://learn.microsoft.com/en-us/entra/identity/authentication/howto-password-smart-lockout#how-smart-lockout-works">smart lockout policy</a>. This feature locks the account for 1 minute after 10 failed passwords within a short timeframe (exact time is undefined by MS; secret sauce). If the next password attempted after the lockout is <strong>also wrong</strong>, it locks it for even longer.</p><p>This means it is effectively impossible for 1 user to reach your threshold⁶ and this is bad logic. Considering the preventative controls in Entra ID, it may not make sense to even create a <strong>bruteforce</strong> detection with this data source (password spray, sure).</p><p>These errors are not always easy to anticipate. Detection engineering is not easy and requires deep knowledge of many different IT systems.</p><p>If you create and manage your own detections internally, do you feel <strong>responsible</strong> for them? Do you have the expertise to develop them? Do you have a process to review and QA them? Do you measure how long it takes you to develop, test, and deploy a new detection?</p><p>I ask because FinCEN did not care that creating a detection is hard and found it negligent enough to include in their fine.</p><h3>4. Failure to review and respond to alerts</h3><p>When a detection finds something, it creates an alert. And TD Bank had a lot of alerts.</p><blockquote><em>In 2018, the AML program registered over 70,000 backlogged detection alerts and roughly 3,000 aged subpoena responses and further investigation cases, with less than 60% of alerts falling within benchmarks for timely detection. (pg. 12)</em></blockquote><p>I couldn’t find what the benchmark for a timely detection in AML is, but I assume it’s weeks? AML does not move at the speed of cyber™, but that seems reasonable.</p><p>Even when the bank <strong>knew</strong> accounts were high risk or non-compliant, it failed to take timely action.</p><blockquote><em>In 2018, nearly 1,000 demarketing requests aged beyond the 35 days TD Bank’s AML policy allowed for the review and processing of such requests. Prior to approximately the summer of 2019, only one member of the relevant team was responsible for reviewing requests to close retail accounts, leading to delays in decisioning requests that frequently exceeded two weeks, and TD Bank generally taking more than two months to notify an account closure to the associated retail branch. (pg. 14)</em></blockquote><p>God speed to the single account closure person. 🫡</p><p>In cybersecurity, we also deal with the issue of timely alert investigation and response. There is a Mean-Time-To (MTT*) metric for everything. The parallel here would be Mean-Time-To-Investigate (MTTI) or Conclusion (MTTC) or Respond (MTTR). See below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vKAuR0onnW-koBvf.png" /><figcaption><a href="https://thecyberwire.com/stories/b75a2fb92af14ed799f4a3b020af6bd1/how-mttc-enhances-soc-efficiency-and-alert-triage-performance">Source</a></figcaption></figure><p>In these metrics, a low number is a better number. However, I don’t often see suggested goals for the metrics. For AML, it sounds like over a month for MTTR is too long.</p><p>I’d say most should be in minutes. Mean-Time-To-Conclusion, especially, should be under 15 minutes. But it really depends on your threat model. Banks? Minutes. A small accounting firm with an MSSP? Maybe an hour or more.</p><p>I’m still interested in what people think, so send me a message or make a comment!</p><h3>So where are the cyber fines?</h3><p>I pose all these questions, because in cybersecurity things are not well defined. What is an acceptable MTTC? What is the maximum acceptable time to suspend updates for a security tool? What is the most important log source to monitor? What is an acceptable XYZ? For most things, there isn’t a law or industry accepted rule. It’s all very informal and anecdotal.</p><p>But the crazy thing is…these things also don’t seem well defined in AML! Yet regulators give these huge fines! Matt Levine at Bloomberg <a href="https://www.bloomberg.com/opinion/articles/2024-10-14/td-was-convenient-for-criminals">writes</a>,</p><blockquote><em>Banks do not know exactly the source of funds for every $40 ATM deposit; they don’t know exactly what their customers get up to when they’re not at the bank. A law like “don’t sell cocaine” is relatively straightforward to enforce: If you sell cocaine, you are guilty; if not, not. A law like “don’t provide banking services to cocaine dealers” is harder: If you are a big bank with millions of customers, and you do your best to check to make sure none of them are cocaine dealers, but one customer works a legitimate job but also sells a little cocaine on the side, are </em>you <em>guilty of a crime?</em></blockquote><blockquote><em>And the basic answer — not legal advice! — is that you have to try your best. The rules require banks to have robust anti-money-laundering programs, and to report suspicious activities above certain dollar thresholds, but there is no real expectation that banks will catch </em>every <em>criminal. (There is no real expectation that the </em>police <em>will catch every criminal.) The goal of anti-money-laundering (AML) rules, writes Patrick McKenzie, “is not to achieve banks having good knowledge of their customers or to prevent money laundering. It is to </em>stochastically manage crime and terrorism<em> at the margins.” The emphasis is on “stochastically”: A bank needs to make it </em>hard <em>for criminals to get banking services, but not </em>literally impossible<em>.</em></blockquote><p>It is understood that you cannot stop every criminal. You just need to be trying <strong><em>hard enough</em></strong>. For cybersecurity: You need to show you are making it <em>hard</em> for attackers to compromise your CIA triangle, but not <em>literally impossible</em>.</p><p>One of the ways we find out if we’re trying hard enough is fines. Regulators use fines to encourage behavior. Matt writes,</p><blockquote><em>The Justice Department can’t </em>directly <em>set banks’ AML budgets, but it can do it indirectly, and it just did. If you are a bank compliance officer and you want to hire 2,000 people and get some shiny new computers, you can go to your regulators and say “do we need to spend this money on AML,” and they will say “that would be better,” and you will go to your chief executive officer with a transcript of the TD Bank press conference, and you will get whatever you want.</em></blockquote><p>It is the same in cybersecurity. Regulators don’t say “Citi you need to spend $10 billion on cybersecurity programs”. They say, “you need to do some cybersecurity and make it <em>hard</em> for attackers”.</p><p>In the end, regulators believe TD Bank was not making it <em>hard enough</em> for criminals.</p><p><strong>But</strong> I’m sure a lot of organizations have similar problems to TD Bank in their cybersecurity programs. So….where are the $3 billion, 30% of yearly profit, “you ran a <em>really</em> bad cybersecurity program” fines?</p><p>To start, I think one major factor in TD Bank’s fine was that management was aware of many issues and repeatedly refused to fix them. Nothing/little was done. That is a big indicator of <strong><em>not trying hard enough</em></strong> to regulators.</p><p>But I think the biggest problem is that regulators are not confident enough to draw the line between trying hard enough and <strong><em>not </em></strong>trying hard enough. I think there’s many reasons for that, including:</p><ul><li>Cybersecurity is a relatively immature field</li><li>Cybersecurity/tech is fast moving, so it is hard to constantly define the line (also makes the field <em>feel</em> perpetually immature).</li><li>Cybersecurity in media is seen as a mystical intractable problem that no one really comprehends, which perpetuates the idea it is impossible to do right and creates too much goodwill (“it’s not if, but when” sort of shit)</li><li>Governments generally lack technical experts who might be more comfortable making the determination</li></ul><p>That’s why I pose these questions. We should know, as a field, what behavior is <strong><em>not</em> <em>trying hard enough</em></strong> across alerting, response, detections, monitoring, etc.</p><p>But we really don’t.</p><p>[1] The world’s 28th largest bank by assets in 2023 (https://en.wikipedia.org/wiki/List_of_largest_banks)</p><p>[2] <a href="https://edition.cnn.com/2024/10/10/investing/td-bank-settlement-money-laundering/index.html">https://edition.cnn.com/2024/10/10/investing/td-bank-settlement-money-laundering/index.html</a></p><p>[3] https://stories.td.com/ca/en/news/2023-11-30-td-bank-group-reports-fourth-quarter-and-fiscal-2023-results</p><p>[4] https://www.lowenstein.com/news-insights/publications/client-alerts/td-bank-to-pay-historic-3-billion-over-aml-compliance-violations-aml</p><p>[5] <a href="https://www.fincen.gov/sites/default/files/enforcement_action/2024-10-10/FinCEN-TD-Bank-Consent-Order-508FINAL.pdf">https://www.fincen.gov/sites/default/files/enforcement_action/2024-10-10/FinCEN-TD-Bank-Consent-Order-508FINAL.pdf</a></p><p>[6] 10 in 1 minute + (1 attempt/minute * 59 minutes) = 59 attempts. This assumes the timeout doesn’t increase, which we know it does.</p><p>[7] I would love to see a poll across the industry asking if the respondent agrees behavior XYZ is <strong><em>not trying hard enough</em></strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b0c98525e9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remediating Users in Hybrid AAD/Entra ID Environments]]></title>
            <link>https://medium.com/@cybureauocracy/remediating-users-in-hybrid-aad-entra-id-environments-0a07990b3610?source=rss-adfb4d235fa6------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a07990b3610</guid>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[identity-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[azure-active-directory]]></category>
            <dc:creator><![CDATA[Ethan Bowen]]></dc:creator>
            <pubDate>Wed, 01 May 2024 18:14:57 GMT</pubDate>
            <atom:updated>2024-05-01T18:14:57.081Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2W-uPcZvO2TdsCSU" /><figcaption>Photo by <a href="https://unsplash.com/@ratushny?utm_source=medium&amp;utm_medium=referral">Dmitry Ratushny</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Did you know:</p><ul><li>Active Directory [AD] Password Resets may <strong>not </strong>sync to Entra ID?</li><li>Kerberos tickets can still be used <strong>after </strong>a password change?</li><li>Password changes/resets in Entra ID may <strong>not </strong>revoke all a user’s sessions?</li></ul><p>Me neither! That is why I wrote this post. I recently spent time investigating how Entra ID and AD can be used for user remediation.</p><p>Some of what I found is not what I assumed :)</p><h3>What is Entra ID?</h3><p>Entra ID is Microsoft’s cloud identity provider. Both Azure and Microsoft 365 [Exchange, Teams, SharePoint, etc.] use it for identity. When you login to SharePoint, you first authenticate to Entra ID, which in turn gives you tokens to access SharePoint. (Entra ID used to be called Azure Active Directory [AAD].)</p><p>Since most organizations use Azure/M365, they also must adopt Entra ID. However, this quickly leads to a problem: most organizations already have a primary identity provider in the form of on-premises Active Directory (AD).</p><h3>What is Entra ID Connect?</h3><p>In order to solve this problem (and increase adoption of MS cloud services), Microsoft created Entra ID Connect which provides identity synchronization between AD and Entra ID. The identities that exist in both places are usually called <strong>hybrid identities</strong>.</p><p>Entra ID Connect also provides different methods to handle authentication for these hybrid users. Some of these include:</p><ul><li><a href="https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-password-hash-synchronization/">Password Hash Synchronization</a> [relevant for some things today]</li><li><a href="https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-pta">Pass-through Authentication</a></li><li><a href="https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/whatis-fed">Federation</a></li></ul><p>While this sync is very nice for users, who enjoy a better sign-in experience, it creates more complexity for security teams. Tracking user investigations and remediation are now much more complex.</p><p>Let’s discuss in more detail.</p><h3>How does the identity syncing work?</h3><p>By default, AD is treated as the ‘golden source’. The identity is first created in AD. Then it is created in Entra ID and kept in sync by the <strong>Entra ID Connect agent</strong>. This agent is installed in your AD environment. Essentially, the agent does the following:</p><ol><li><strong>Reads directory information using an</strong> <strong>AD account [e.g. MSOL_xxxxx].</strong></li><li><strong>Writes it to Entra ID using a special Entra ID account [e.g. Sync_xxxxxx@&lt;tenantdomain&gt;.onmicrosoft.com].</strong></li></ol><p>By default, this sync process runs every <a href="https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-sync-feature-scheduler">30 minutes</a>. (Passwords are synced ~every <a href="https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-password-hash-synchronization#:~:text=The%20password%20hash%20synchronization%20process%20runs%20every%202%20minutes.">2 minutes</a>.)</p><p>Below we’ll look at what happens after a user is created in AD.</p><p>First, my AD sync agent signs into Entra ID using its Entra ID account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*5AIZnZ2Xahi3hjO71ZgPqQ.png" /><figcaption>My AAD Connect Sync account signing into AAD.</figcaption></figure><p>Next, the agent adds my user to the Entra ID directory and syncs certain properties (Name, MailNickname, UPN, etc.). These properties can be configured by your organization.</p><p>The picture below is from the Entra ID Audit logs and shows the properties and values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IAxa6-idI-CvihK26ziEaw.png" /><figcaption>AAD Connect account adding a new AD user to AAD</figcaption></figure><p>Now Bilbo can login to Entra ID and start talking to Frodo on Teams.</p><p>We now know the basics of how this identity sync works. Let’s discuss the different options for <strong>how</strong> users can authenticate to Entra ID with these new hybrid identities.</p><h3>Password Hash Synchronization (PHS)</h3><p>PHS synchronizes the user’s password¹ to Entra ID . This means Entra ID can authenticate the user on its own. Therefore, AD is not involved in this method. I assume this is the most common method, because it is simplest.</p><p>With PHS, your AD event logs have<strong> no sign-in records related to Entra ID². </strong>Instead, the Entra ID sign-in logs must be reviewed.</p><h4>Password Write Back (PWB)</h4><p>Imagine a user is traveling for work and needs to change their Entra ID password. They are off the corporate network and therefore cannot see the Domain Controller. Since AD is the authoritative source, they cannot change their password.</p><p>Enter Password Write Back. This Entra ID Connect feature allows password changes in Entra ID to be written <strong>back </strong>to AD. It is required for features like <a href="https://learn.microsoft.com/en-us/entra/identity/authentication/concept-sspr-howitworks">Self-Service Password Reset</a> (SSPR), which allows users to change their password in Entra ID if they have pass certain authentication checks.</p><p>This feature is <strong>not </strong>enabled by default, but is commonly used.</p><h3>Pass-Through-Authentication (PTA)</h3><p>PTA leverages Entra ID Connect and additional authentication agents to validate the password in AD when an Entra ID sign-in occurs. Microsoft has a good diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ekQPle22N9T2EyEU.png" /><figcaption>From: <a href="https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-pta">Microsoft Entra Connect: Pass-through Authentication — Microsoft Entra ID | Microsoft Learn</a></figcaption></figure><h3>Considerations for Containment/Remediation</h3><p>Microsoft has a good page on the basics of containing a user in AD/Entra ID: <a href="https://learn.microsoft.com/en-us/entra/identity/users/users-revoke-access">Revoke user access in an emergency in Microsoft Entra ID — Microsoft Entra ID | Microsoft Learn</a></p><p>However, I think it is more nuanced than described and the article does not explain enough about <strong>why </strong>some actions are required. I will add some more details and explanation.</p><h4>Scenario</h4><p>Let’s assume someone in Finance ran malware on their laptop. Of course, they’re a local admin, so who knows what happened. Let’s assume we use PHS and therefore their AD credentials (+Entra ID) are compromised. What should we do?</p><h3>Disable the user in AD!</h3><p>We usually think about is disabling their AD account, while the investigation kicks off. This limits lateral movement by stopping AD from issuing <strong>new³ </strong>Kerberos tickets or validating new NTLM requests.</p><p>Below, you can see the user <strong>legolas </strong>is disabled and the Domain Controller (DC) will not issue a <strong>new </strong>Service Ticket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wy-w--nX86Edba9Z56B9xw.gif" /><figcaption>Disabled AD user cannot get new Kerberos tickets</figcaption></figure><p>Additionally, if I try to use NTLM authentication the DC rejects it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*RpXXi_ZebnbwpsNFDU-EVg.png" /><figcaption>NTLM credential validation fails due to “<a href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4776">Account logon to account disabled</a>”</figcaption></figure><p>Great!⁴</p><h4>But what happens in Entra ID…?</h4><p>It can take <strong>up to 30 minutes</strong> for the user’s account to be disabled in Entra ID. This is due to the default Entra ID Connect synchronization interval! So while the attacker cannot get new accesses in AD, they <strong>can </strong>still login to Exchange, SharePoint, etc.</p><p>If you are sure an account is compromised, <strong>this delay is unacceptable</strong>. Therefore, you also must disable the account <strong>directly </strong>in Entra ID. This may require new permissions and updated workflows for your team.</p><h3>Reset the password!</h3><p>What if the user needs to continue working and disabling their account is not acceptable? Another option is an <strong>AD Password Reset.</strong></p><p>This <strong>changes </strong>the user’s password + by default sets the “User must change password at next logon” flag in AD. (The last part is important later on.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*P5oty3r4HEqoQ1EOijc-_A.png" /><figcaption>AD Password Reset dialog.</figcaption></figure><h4><strong>Kerberos Tickets remain valid</strong></h4><p>Even after a password change, the user’s existing Kerberos tickets (TGT/ST) <strong>are still </strong>valid. If an attacker stole your <strong>TGT + session key</strong>, they can use it to acquire new access until the TGT’s renewal period expires (<strong>1 week</strong> by default). See <a href="https://stackoverflow.com/questions/14682153/lifetime-of-kerberos-tickets">this excellent</a> StackOverflow answer that explains Kerberos ticket and renewal lifetimes.</p><p>In the image below, the user’s password was reset on <strong>3/30 @ 15:47:44</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*cGdfdGAZ1V2a8LJkKuIlXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*K8Ct6lUWaItvyuStud7Zww.png" /><figcaption>Still able to use a TGT issued BEFORE the reset</figcaption></figure><p>After the reset, and without a new Windows sign-in session, I requested a new TGT using <strong>klist</strong>. The renewal period is 1 week. So by subtracting 1 week from the Renew Time, we calculate the <strong>original</strong> TGT was issued on <strong>3/30 @ 15:40:10. </strong>(That’s 7 minutes <strong>before </strong>the password reset.) The start time for the <strong>new </strong>TGT is <strong>3/30/2024 16:14:51</strong>, or over 30 minutes after the password reset.</p><p>So...a TGT issued <strong>before</strong> a password reset can be renewed and used until the end of the <strong>renewal period</strong>. Microsoft discusses this issue in their PtH whitepaper. [<a href="https://download.microsoft.com/download/7/7/A/77ABC5BD-8320-41AF-863C-6ECFB10CB4B9/Mitigating%20Pass-the-Hash%20(PtH)%20Attacks%20and%20Other%20Credential%20Theft%20Techniques_English.pdf">PDF link</a>]</p><blockquote>“A Kerberos TGT and the associated session key together comprise a reusable credential for the Kerberos protocol. TGTs have a default lifespan of about 10 hours, and a default total lifetime of 7 days, if that TGT is repeatedly renewed before it expires. Attackers can steal TGTs and associated session keys and request a new session ticket at will until the renewal lifetime is reached.” ~Pg. 29</blockquote><p>If you cannot disable a user, you should monitor where their TGT/ST requests originate from until the renewal period expires. You can use EventIDs 4768 [TGT]/4769 [ST]/4770 [renewal] for this.</p><h4>What happens in Entra ID…?</h4><p>Now back to Entra ID.</p><p>By <strong>default</strong>, Entra ID Connect will <strong>not</strong> sync the AD Password Reset action to Entra ID! The user’s Entra ID password will <strong>not be changed</strong> and they remain compromised until the user changes their password.</p><p>Read this rather confusing documentation quote:</p><blockquote>Forcing a user to change their password on next logon requires a password change at the same time. Microsoft Entra Connect will not pick up the force password change flag by itself; it is supplemental to the detected password change that occurs during password hash sync. ~ <a href="https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-password-hash-synchronization#synchronizing-temporary-passwords-and-force-password-change-on-next-logon">Implement password hash synchronization with Microsoft Entra Connect Sync — Microsoft Entra ID | Microsoft Learn</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*kGz0GruZ069F4XWezJs0GA.gif" /><figcaption>My reaction when I learned this</figcaption></figure><p>My theory is the Entra ID Connect agent looks at the AD <strong>Password Last Set</strong> value to determine when it needs to sync a new password. An AD <strong>Password Reset</strong> changes this value twice in quick succession: once for the change done by the admin, and then immediately to 0 to indicate it needs to be changed again.</p><p>What does that mean for remediation? Imagine you:</p><ul><li>Disable the user’s account and investigate the host.</li><li>Do an AD Password Reset to be safe.</li><li>Re-enable the user’s account, because their credential was changed and the investigation was inconclusive.</li><li>Tell the user to call the Helpdesk to get their new temp password and change it.</li><li>However, it’s late on Friday, and the user waits until Monday.</li></ul><p>As soon as you re-enable their account, the attacker can login to Entra ID with the user’s <strong>old </strong>credentials! Wild stuff!</p><p><strong>Mitigation</strong>s:</p><p>You can mitigate this risk in a few ways:</p><ol><li>During the AD Password Reset, do <strong>not </strong>set the “User must change password at next logon” flag. This means the PasswordLastSet value will be the date of the change (since it is essentially a password change) and it will be synced to Entra ID.</li><li>Leave the user account <strong>disabled</strong> until the user is available to do a password change.</li><li>If you use PWB, you likely use the<strong> ForcePasswordChangeOnLogon </strong>feature. This feature syncs the AD “Force Password Change on Next Logon” flag to Entra ID. In this case, Entra ID will update the user’s password, after the AD reset, as is expected.</li></ol><h4>But wait, there’s more!</h4><p>If you decided to do #3, your password resets are synced to Entra ID, so problem solved!?</p><p>Wrong! What about the user’s old Entra ID tokens?</p><h4>Revoke Entra ID Sessions!</h4><p>Entra ID issues different kinds of authentication tokens. These tokens include:</p><ul><li>Access tokens — tokens presented to a resource for access. <a href="https://learn.microsoft.com/en-us/entra/identity-platform/access-tokens"><strong>Last 60–90 minutes (avg 75)</strong></a>.</li><li>Refresh tokens — tokens presented to Entra ID to get new access tokens. <strong>Last up to 90 days</strong>.</li><li>Session tokens</li></ul><p>The <a href="https://learn.microsoft.com/en-us/entra/identity/users/users-revoke-access">Microsoft ‘revoke access in an emergency’ article</a> goes into more detail and I highly encourage you to read it.</p><p>The important thing for us is that <strong>when a password is changed in Entra ID</strong>, the value of <strong>StsRefreshTokenValidFrom </strong>(aka ‘sign in sessions valid from’ in Entra ID Portal) is set to the date of the <strong>Password Change </strong>event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*AOxBCsZ5wbW0rC9UXFAbdQ.png" /><figcaption>Sign-in sessions are valid from March 29, 2024 @ 7:04PM same as the Password Set date</figcaption></figure><p>This means Entra ID refresh⁵ and session tokens issued <strong>before </strong>this date are <strong>invalid </strong>and the user must re-authenticate.</p><p>However, there are still two problems for us.</p><ol><li><strong>AD Password Resets</strong> that set the “User must change password at next logon” flag change the valid from date to <strong>Jan 1, 1601, 12:53 AM</strong> which means the user’s previous tokens <strong>are still valid</strong>.</li><li>Regardless of password change or reset methods, all <strong>non-password-based tokens</strong> are <strong>still valid</strong> (e.g. passwordless in Authenticator app, FIDO, etc).</li></ol><h4>Problem 1: AD Password Resets with the change on logon flag do not invalidate refresh tokens</h4><p>Microsoft describes the impact of different response actions on refresh tokens in <a href="https://learn.microsoft.com/en-us/entra/identity-platform/refresh-tokens#token-revocation">this article</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*EWafJzx5AdLTaP2B1h0QNA.png" /><figcaption>Admin password resets should revoke password-based tokens</figcaption></figure><p>This chart states an ‘Admin resets password’ action revokes password-based tokens. But in my testing, this is not the case for AD Password Resets that<strong> include</strong> the ‘User must change password at next logon’ flag, which is likely the <strong>most </strong>common method!</p><p>In the GIF below, I have Access + Refresh Tokens from <strong>before </strong>the AD Password Reset with the force change flag set. <strong>After</strong> the AD Password Reset, I am still able to use my Entra ID Refresh Token to get new Access Tokens. This is because the StsRefreshTokenValidFrom is set to Jan 1, 1601 (so from forever).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JVQbD9t0tgDa2m1Nf6GG1Q.gif" /><figcaption>Refresh Tokens can still be used after AD Password Reset</figcaption></figure><p><strong>Overall, this behavior is not expected, based on the Microsoft documentation.</strong></p><p><em>Technically </em>an AD Password Reset (without the change on next logon flag set) <strong>does </strong>revoke the password-based tokens. It changes the user’s password in Entra ID and sets the StsRefreshTokenValidFrom to the time of the change.</p><p><em>However</em>, <strong>the default and most common method of doing an AD Password Reset (with the flag), does not work</strong>!</p><ol><li>If you do not have the Entra ID Connect ForcePasswordChangeOnLogOn feature enabled, nothing works as expected. Neither the password change or the flag are synced. The user stays compromised.</li><li>If you do enable it, the password is changed and the flag is synced, but the user’s sign-in sessions are not revoked ! Any compromised tokens remain compromised until they actually login again and change their password.</li></ol><p>That is a bad sysadmin experience and a good example of the absurd level of detail necessary to be ‘secure’.</p><h4>Problem 2: Passwordless Tokens are still valid</h4><p>In the refresh token chart above, Microsoft separates <strong>password-based</strong> and <strong>non-password-based </strong>tokens. I only learned about this while researching this post. For example: If a user signed in with the <a href="https://learn.microsoft.com/en-us/entra/identity/authentication/howto-authentication-passwordless-deployment">Authenticator app’s Passwordless</a> feature, that token is considered non-password-based.</p><p>The important part of the chart is that Password Changes and Reset<strong>s do not</strong> impact non-password-based tokens! Those tokens <strong>remain valid. </strong>This is important if a user’s device was compromised and non-password-based tokens may have been stolen.</p><p>The GIF below shows me requesting new Access Tokens after an <strong>Entra ID Password Reset</strong>.</p><p>The left terminal is a password-based token and <strong>fails</strong>.</p><p>The right is Authenticator Passwordless-based and <strong>succeeds</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8u5vD9f9goI-OP3SpTf4Ow.gif" /><figcaption>Left: A password-based sign-in, Right: A passwordless (Authenticator app) sign-in</figcaption></figure><p>Regardless of how you do AD password resets, you <strong>need </strong>to revoke all user sessions (see: <a href="https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.users.actions/revoke-mgusersigninsession?view=graph-powershell-1.0">Revoke-MgUserSignInSession</a>) in Entra ID to ensure remediation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*OHI0tZ7ZxN0RelNRq6uiDw.gif" /></figure><h4><strong>S</strong>ession Cookies</h4><p>The final issue is session cookies. Microsoft says,</p><blockquote>Once an application issues its own session token, access to the application is governed by the application’s session. At this point, the user is <strong>affected by only the authorization policies</strong> that the application is aware of. ~<a href="https://learn.microsoft.com/en-us/entra/identity/users/users-revoke-access#session-tokens-cookies">Revoke user access in an emergency in Microsoft Entra ID — Microsoft Entra ID | Microsoft Learn</a></blockquote><p>It is very likely that your Entra ID-authenticated apps drop their own session cookies that control the session lifetime. So, <strong>even if you revoke Entra ID</strong> <strong>sessions, the user’s access to those apps will remain until the app session expires.</strong></p><h3>Summary</h3><p>I hope this helped you understand some of the ‘gotchas’ with hybrid user remediation. I summarize the important points below.</p><h4>AD</h4><ul><li>Attackers can still use Kerberos TGTs after a password reset/change, until the renewal period expires. Consider shortening their lifetimes. (Or disable the user or monitor where all TGT/ST requests come from.)</li><li>Do not limit your user investigations to AD. Entra ID logs are always needed to develop a complete picture of user activity.</li></ul><h4>Entra ID</h4><ul><li>You should disable users directly in Entra ID too. 30 minutes is too long to wait.</li><li>Even after a password change or account disable, an attacker’s access to Entra ID-authenticated resources could last an hour or longer, depending on the app configuration.</li><li>Always revoke compromised user’s Entra ID sign-in sessions. There are too many scenarios where existing sessions could persist (AD Password Reset, non-password-based tokens).</li><li>Be aware of session lifetimes/policies in your Entra ID-authenticated apps, especially for high value apps like VPNs.</li></ul><h3>Thanks</h3><ul><li><a href="https://twitter.com/DrAzureAD">Dr. Nestori Syynimaa (@DrAzureAD) / X (twitter.com)</a> for excellent threads/presentations on AAD and creating AADInternals.</li><li>Anna for proofreading</li></ul><h3>Footnotes</h3><p>[1] It’s actually the hash of the hash or some complicated crypto shit, but the outcome is that the user uses the same password in both locations.</p><p>[2] If you use Seamless SSO, this is more complicated, because the users may be requesting Kerberos Service Tickets (ST) for the Seamless SSO account. However, this will not record every sign-in event in Entra ID, because the same ST can be presented multiple times and you do not re-auth to Entra ID every time you access a new app.</p><p>[3] Existing tickets are also still valid. For example, Kerberos Service Tickets presented to applications.</p><p>[4] You should also consider the impact of NTLM caching on target devices. For example, the user’s laptop or servers they access.</p><p>[5] Access tokens cannot be revoked. Microsoft is working on a way for applications to receive signals from Entra ID that an access token was revoked [Continuous Access Evaluation], but it’s early days.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a07990b3610" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Export AAD Identities for Detections/Incident Response]]></title>
            <link>https://medium.com/@cybureauocracy/export-aad-identities-for-detections-incident-response-d3a147b06a8d?source=rss-adfb4d235fa6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3a147b06a8d</guid>
            <category><![CDATA[azure-active-directory]]></category>
            <category><![CDATA[sentinel]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Ethan Bowen]]></dc:creator>
            <pubDate>Thu, 15 Feb 2024 21:13:18 GMT</pubDate>
            <atom:updated>2024-02-15T21:13:18.267Z</atom:updated>
            <content:encoded><![CDATA[<h3>What are AAD Identities?</h3><p>Azure Active Directory (AAD) is the identity provider for Microsoft cloud services (M365/Azure). Examples of these identities include:</p><ul><li><strong>Users </strong>— simple enough. Often synced from on-prem Active Directory.</li><li><strong>Groups </strong>— simple enough. Often synced from on-prem Active Directory.</li><li><strong>Devices </strong>— devices that are <strong>registered </strong>or <strong>joined </strong>to AAD. From a corporate laptop to an employee’s BYOD phone.</li><li><strong>Application Registrations</strong> — a custom application created in the tenant (e.g. an app the company sells to customers). Also often used for service accounts (e.g. unattended scripts that need to access protected resources)</li><li><strong>Service Principals </strong>— an <strong>instance</strong> of an application registration in a tenant. These are created automatically when an application registration is created. Very confusing!</li><li><strong>Managed Identities</strong> — a form of Service Principal that is managed by Microsoft and associated with an Azure resource (e.g. Logic App or a Data Factory)</li></ul><p>All of these identities access resources, have authentication methods, and are used to link activity across the Microsoft tools. But what is their value in detection/IR?</p><h3>Why export identities?</h3><p>Physical asset information is extremely important for cybersecurity. Most enterprises have an asset tracking systems and leverage that asset data in their SIEMs.</p><p>It is, however, less common to have the same level of asset information for enterprise identities. This is unfortunate, because identities are now the key to resource access (#ZeroTrust 🤮), so accurate identity information at your fingertips is extremely important. Imagine the below detection:</p><h4>Alert on sign-ins from AAD Global Administrators when they are from another country.</h4><p>AAD <a href="https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/signinlogs">Sign-in logs</a> do not include role information for the user. Therefore, this detection is not possible with one data source. So, what options do we have? I’ll use Sentinel terms here, but the options are the same for most modern SIEMs.</p><p><strong>Logic App<br></strong>You could generate an alert for any foreign AAD sign-ins and then have a Logic App query MS Graph to determine if the user is a Global Admin. However, this will not scale if you have many foreign users or don’t like cluttering your incident panels.</p><p><strong>Watchlist<br></strong>You could generate a Sentinel <a href="https://learn.microsoft.com/en-us/azure/sentinel/watchlists">watchlist</a> for Global Admin users. However, that will be static. To update it automatically you could create a Logic App to pull the information from MS Graph. However, this will also not scale to <strong>other </strong>roles or identity attributes.</p><p>What if we could just save all our identity information in a table? 🤔</p><h3>Options to Export Identities</h3><p>Let’s review the options I’m aware of:</p><ul><li>Microsoft <a href="https://learn.microsoft.com/en-us/graph/data-connect-datasets">Graph Data Connect</a> — this is focused on M365 data and is meant for business applications, not security. It does not support all fields (authMethods) or identity types (Application Registrations, SPs, Roles)…It is a good option for general bulk export, though.</li><li><a href="https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/deviceinfo">DeviceInfo </a>— a good start! But it only includes devices seen by Defender! So it is not a source of AAD devices. Confusing!</li><li><a href="https://learn.microsoft.com/en-us/microsoft-365/security/defender/advanced-hunting-identityinfo-table?view=o365-worldwide#mdi-only">IdentityInfo </a>— a good table in Defender, but in Sentinel it requires UEBA. Confusing!</li><li><a href="https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/auditlogs">AuditLogs </a>— these are events that are happening to identities; they are not the current state of identities. If a Global Admin wasn’t added in the last 90 days, that doesn’t help us.</li></ul><p>So none of these options work! That’s why I made one.</p><h3>Export-AAD.ps1</h3><p>This PowerShell script (<a href="https://github.com/25004/Export-AAD">GitHub</a>) can export all: Users, Devices, Groups, Application Registrations, and Service Principals (Enterprise Applications) from your AAD tenant. The files are saved in JSON files ready for you to send to a SIEM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*RtXYEykS1VZX40fKyaS7Wg.png" /><figcaption>JSON files</figcaption></figure><p>It is meant to be run on a schedule and the <strong>TimeGenerated</strong> column reflects the time of the run. This helps you find the latest date in your SIEM (see query below).</p><p>You can configure whatever properties you want added, as long as <a href="https://learn.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0">Graph supports them</a>. See the <a href="https://github.com/25004/Export-AAD?tab=readme-ov-file#default-identity-object-properties">README</a> for a list of the defaults.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*asM-5hI_gvkaT9Jop1eKmQ.png" /><figcaption>Default User Output</figcaption></figure><p>It supports <a href="https://learn.microsoft.com/en-us/graph/json-batching">batch queries</a> (where 20 requests are in 1 HTTP request) and some parallelism.</p><p>The execution speed is limited by Graph API throttling and the script will sleep for a few seconds to be nice.</p><h4>Our query</h4><p>Now we can create our query. This will show all sign-ins from all Global Administrators (as of the last inventory table update).</p><pre>let MostRecentRun = toscalar(AADUsers_CL | summarize max(TimeGenerated));<br>AADUsers_CL<br>| where TimeGenerated == MostRecentRun<br>| where MemberOf has &quot;graph.directoryRole&quot;<br>| mv-expand MemberOf<br>| extend Role = MemberOf.displayName<br>| where Role == &quot;Global Administrator&quot;<br>| join SigninLogs on $left.ObjectId == $right.UserId</pre><p>Please let me know if you try it and like it or run into problems with a GitHub issue!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3a147b06a8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[M-21–31: Ye Shall Log, No Matter the Log]]></title>
            <link>https://medium.com/@cybureauocracy/m-21-31-ye-shall-log-no-matter-the-log-3fe69321639c?source=rss-adfb4d235fa6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fe69321639c</guid>
            <category><![CDATA[federal-government]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[event-logging]]></category>
            <dc:creator><![CDATA[Ethan Bowen]]></dc:creator>
            <pubDate>Sun, 10 Dec 2023 17:07:14 GMT</pubDate>
            <atom:updated>2023-12-12T17:21:07.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*Ym6u_JrRxAn4jE5-" /></figure><p>There were a lot of news stories this week¹² about federal agencies’ inability to achieve the cyber logging requirements in <a href="https://www.whitehouse.gov/wp-content/uploads/2021/08/M-21-31-Improving-the-Federal-Governments-Investigative-and-Remediation-Capabilities-Related-to-Cybersecurity-Incidents.pdf">M-21–31</a>. I also saw some discussions on Twitter that raised the normal questions about the U.S. government’s poor cybersecurity posture, etc. I think, in this case, we should probably be nicer to the agencies.</p><p><strong>Quick background</strong>: M-21–31 was issued as a result of <a href="https://www.whitehouse.gov/briefing-room/presidential-actions/2021/05/12/executive-order-on-improving-the-nations-cybersecurity/">Executive Order 14028</a> (the ‘Cyber EO’). The EO directed DHS/DOC/OMB to issue logging requirements for the federal government within ~104 days of issuance.³ The memo creates 4 tiers of Logging Maturity with required compliance dates for each tier. More event types are required as the tiers increase. There are also additional non-logging requirements at each tier (agency SOC access, SOAR, etc.), but that is not my concern.</p><p>To see more details on the tiers and requirements, go to <strong>Analyzing the Tiers.</strong></p><h4>GAO Audit</h4><p>The news stories are based on a newly released <a href="https://www.gao.gov/products/gao-24-105658">GAO audit</a>, which actually focused on EO14028 outcomes as a whole. Some highlights from the logging parts of the audit:</p><blockquote>“Three agencies had met tier 3. These agencies were the Department of Agriculture (Agriculture), the National Science Foundation (NSF), and the Small Business Administration (SBA)” (pg. 26)</blockquote><blockquote>“…officials stated their agencies were not expected to meet the tiers soon.” (pg. 26)</blockquote><blockquote>One agency official stated that its agency estimated that it would require more than 9 years or sufficient additional funding for contractors to account for the new workload needed to meet the event logging tiers. (pg. 27)</blockquote><blockquote>“agency officials cited the “all or nothing” nature of the requirements, meaning even if a majority of systems had reached the tier 1 requirements, if all systems had not reached tier 1, the agency overall would be at tier 0.” (pg. 26–27)</blockquote><p>The GAO audit, and the OIG reports it references, do not evaluate the memo. They simply state agencies must comply and ask agencies why they haven’t. I think it’s important for organizations to be deeply self-critical, especially regulatory ones, because their work has large impact. In a world of limited government resources, the resources spent on poorly crafted cybersecurity regulation have a high opportunity cost.</p><p>It is clear agencies are struggling with compliance. The agencies cite lack of funding, staffing, and technology as reasons for their failure. But are these reasons justifiable? Let’s try to understand.</p><p><strong><em>Small note</em></strong><em>: In February 2023, CISA published a </em><a href="https://www.cisa.gov/sites/default/files/2023-02/TLP%20CLEAR%20-%20Guidance%20for%20Implementing%20M-21-31_Improving%20the%20Federal%20Governments%20Investigative%20and%20Remediation%20Capabilities_.pdf"><em>short guidance document</em></a><em> on M-21–31 that provides a second layer of prioritization for the logs within the existing Tier system (in Tier 0 logs, prioritize XYZ first). However, the CISA guidance does not change the M-21–31 requirements. It states,</em></p><blockquote>This guidance intends to complement and clarify the requirements within M-21–31 and does not supersede or conflict with the policy.</blockquote><h3>Analyzing the Tiers</h3><h4>What must be logged?</h4><p>First, the exact logging requirements are <strong>not </strong>easy to understand. The memo separates the requirements by “Logging Category” and then by “Required Data”. Below is the very first entry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8Dqz2ppRKE0--BhsyQcyg.png" /></figure><p>Question for the reader: Which line here represents a discrete event type? <strong>Account Creation</strong> is straightforward, but what is <strong>Manage Credential Type</strong>? What is <strong>Track Usage of Credentials</strong>? Is that referring to a sign-in log? It’s really not clear what the event type is. This issue occurs throughout the memo.</p><p>In addition to the unclear phrasing, there are other problems.</p><p>Some ‘atomic’ event types are grouped:</p><blockquote>OS: — <strong>Start-Up</strong> and <strong>Shutdown</strong> of the System (pg. 18)</blockquote><p>and others are not:</p><blockquote>- Account Creation<br>- Account Deletion</blockquote><p>Some mention an action you should take, instead of an event:</p><blockquote><strong>Monitor, Alert and</strong> <strong>Respond</strong> to Anomalous Behaviors/Activities (pg. 14)</blockquote><p>Some are possibly duplicates⁴:</p><blockquote>Network Device Infrastructure (General Logging) — DNS Query/Response Logs (pg. 16)</blockquote><p>and</p><blockquote>Network Device Infrastructure — DNS…content of query (pg. 14)</blockquote><p>Some are supersets of others (note the *):</p><blockquote>System Log Folder: /Var/Log/<strong>*</strong> (pg. 23)</blockquote><p>and</p><blockquote>System Log: /Var/Log/System.Log (pg. 23)</blockquote><p>Some are closer to inventory data and not events:</p><blockquote>Device Data <br>• Device Name <br>• Device Manufacturer and Model <br>• Serial # <br>• Phone # <br>• IMEI, IMSI, OS Version, OS Build <br>• Firmware Version</blockquote><p>Some are so broad they are almost immeasurable:</p><blockquote>OS — System Events (pg. 20)</blockquote><p>All of these inconsistencies make it impossible to calculate the true number of required event types (and therefore impossible to consistently measure). But let’s try anyway. Below is my <strong>very</strong> rough calculation:</p><ul><li>Event Logging Tier 1 | at least <strong>215</strong> log types (~60%)</li><li>Event Logging Tier 2 | at least <strong>130</strong> log types (~36%)</li><li>Event Logging Tier 3 | at least <strong>12</strong> log types (~.03%)</li></ul><p>That’s at least <strong>357 </strong>different events. There are probably more, because I did some generous groupings. Some are also double counted, because the memo separates by device type (e.g. Linux logon events and Windows logon events are separate).</p><p>Finally, there is also no discussion in the memo regarding which systems the logs must be collected from. Is it only production systems? Development? Every system in the agency? I doubt every agency is using the same criteria.</p><h4>Retention</h4><p>Log retention discussions usually focus on what to store and for how long, based on your threat model. These discussions are necessary because most SIEM/data lake costs come from the amount of data ingest (e.g. pay per GB of ingested data or pay per GB of data scanned in a query).</p><p>Unfortunately, M-21–31 is not a fan of this discussion.</p><p>Every event type, except two⁵, must be stored for:</p><ul><li>12 months Active Storage</li><li>18 months Cold Storage</li></ul><p>This includes extremely high volume events like:</p><ul><li>OS — Registry Access (pg. 21)</li><li>OS — File and Object Access (pg. 20)</li><li>Web Applications — HTTP Request and <strong>Response with Body of Data </strong>(pg. 33)</li></ul><p>There is no consideration for the value, or ROI, of a log type based on its volume and provided insight.</p><h4>Filtering</h4><p>The memo also does not mention <strong>filtering</strong> of any kind, another very common cost management approach in logging discussions. See <a href="https://github.com/SwiftOnSecurity/sysmon-config/tree/master">SwiftonSecurity’s Sysmon</a> config for popular attempts or Olaf Hartong’s <a href="https://www.youtube.com/watch?v=8HOmn7F-RWw">presentation</a> on how Microsoft Defender for Endpoint implements event filtering.</p><p>In the industry, the question is not “should we filter out events?”, it is “what should we filter out?” and “how should we balance visibility requirements with cost?” However, M-21–31 does not discuss this and therefore implies agencies must log <strong>every single event</strong> in these categories, which will dramatically increase the cost.</p><h4>Costs</h4><p>When agencies say they have funding issues, I think they’re right. But let’s try to calculate some numbers. For simplicity, I’ll focus on just one category: Windows event logs.</p><p>To calculate an estimate, I’ll use a small agency like <a href="https://en.wikipedia.org/wiki/Federal_Retirement_Thrift_Investment_Board">FRTIB</a>, which manages the federal government’s 401(k) and has ~300 employees.</p><h4>Scenario: Windows Events</h4><p>To calculate the number of Windows devices:</p><p>I estimate ~1 employee = 1 device, so <strong>~300</strong> employee devices.</p><p>To calculate the size per Windows device:</p><p>I ran Procmon with no filters for 10 minutes on my laptop⁶. The result file in .PML format is ~<strong>500MB.</strong></p><p>500MB/10min = 50MB/min * 60min/hour * 8 hour/workday = <strong>24GB/day/device</strong>.</p><p>24GB/day/device * 300 devices = <strong>7,200GB/day (or 7.2TB)</strong></p><p>That is <strong>a lot</strong> of data. Even if you can find some good compression savings, it is still a lot of data.</p><p>If FRTIB ingested this into Microsoft Sentinel, it would cost at least ~$16,600/day or ~<strong>$6mil/year</strong>.⁷ FRTIB’s <a href="https://www.frtib.gov/pdf/minutes/2023/Aug/Att10-FY-2024-Budget-Proposal.pdf">FY2023 budget</a> was ~$400 million.</p><p><strong><em>Edit 12.12.2023</em></strong>: The <em>Sentinel cost only includes </em><strong><em>90 days</em></strong><em> of Active storage and the memo requires 180 days. So you’re not even at the minimum retention yet!</em></p><p>That’s 1.5% of the Agency budget dedicated to Windows event logs.</p><p><strong>And there’s still the remaining 350 event types!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*Wf3dFFXahVvMd0xO" /></figure><h3>Recommendations</h3><p>If you were a federal CISO, could you truly attest that your agency is meeting the requirements?</p><p>Considering the unclear event log requirements, unclear system scope, inability to filter events, and resulting costs, the memo needs to change. Especially if GAO or OMB expect agencies to report compliance.</p><ol><li><strong>Reissue the memo</strong> — this seems necessary. It just has too many problems.</li><li><strong>Move the requirements to CISA’s authorities</strong> — the requirements seem too low-level to be managed by OMB.</li><li><strong>Move the requirements to an updatable format </strong>— this enables OMB (or CISA) to update the exact event type requirements at their discretion. This allows for new event types to be added and times adjusted if necessary.</li><li><strong>Standardize how event types are described</strong> — the current requirements are inconsistently structured, such as when they decide to include required fields (e.g. Source Port) or how they group events. Pick a lane. Preferably the more explicit one.</li><li><strong>Fix the presentation of the event type requirements</strong>— the current table is difficult to follow and creates confusion.</li><li><strong>Create ROI-informed retention times</strong> — compare the volume and usefulness of events and build ROI-aligned retention times. This is not an easy task, but the alternative is worse.</li><li><strong>Decide a position on filtering </strong>— the new memo should provide agencies the flexibility to filter events. Or don’t allow it and find a way to defend that position.</li><li><strong>Make the requirements more accessible and known outside of federal government</strong>— everyone cares about logging. If you’re doing the work to decide what is important to the government, why not tell the world about it?</li></ol><h3>Footnotes</h3><p>[1] <a href="https://www.nextgov.com/cybersecurity/2023/12/20-federal-agencies-miss-deadline-implementing-cyber-incident-tracking-requirements-watchdog-says/392541/">20 federal agencies miss deadline for implementing cyber incident tracking requirements, watchdog says — Nextgov/FCW</a><br>[2] <a href="https://fedscoop.com/only-3-agencies-have-hit-deadline-for-cyber-event-logging-standards-gao-finds/">Only 3 agencies have hit deadline for cyber event logging standards, GAO finds | FedScoop</a></p><p>[3] Section 8, subsections (a)-(c)</p><p>[4] There are many more duplicates. Look at Linux event logs and PowerShell too.</p><p>[5] PCAP [72 hours], Cloud GCP logs [6 months + 18 months]</p><p>[6] You might wonder why and I direct you back to the requirement for File/Object/Registry access. 👀 Procmon also doesn’t capture every event required for Windows, so even this number represents a subset.</p><p>[7] East US region, 5TB commitment tier, 7,200GB/day * $2.31/GB * 365 days</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fe69321639c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>