Classifying HTTP Status Code and detecting possible Threats

While exploring the DeviceNetworkEvents table in Defender XDR, I wanted to dig deeper into the different actions behind various HTTP status codes. I started with a few queries to identify cases where specific status codes were appearing repeatedly, and I uncovered some interesting insights, such as:

– Users consistently accessing non-business-related sites.
– Users frequently visiting websites hosted in high-risk countries.
– Continuous errors while attempting to connect to multiple destinations.
– Malicious sites not blocked by default where luckily the connection failed sometimes but unfortunately not always.

Based on these findings, I decided to create a table with extended information about the potential threats associated with each status code. This allows me to quickly work with other KQL queries to identify potential threats. Consider this KQL query as a «Pivot Table» for multiple queries that can be triggered based on your criteria!

💡 Tip : I use to work with ‘join’ operator every time that I add a secondary table into my KQL queries. However, is recommended to use ‘lookup’ instead of ‘join’ when right side is small and left side is large.