Microsoft Sentinel
Cloud and workloads

Customer intent: As a security engineer or data scientist, I want to see examples of how to query the Microsoft Sentinel data lake using Jupyter note…

In brief

The article now uses clearer descriptions for querying Entra ID sign-in, group, and device event tables. It also updates guidance for identifying lateral movement and credential-dumping activity, including connection-count thresholds and port filters.

What Defender admins need to know

No administrator action is required. Review the revised examples when using these notebooks.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Microsoft Sentinel Jupyter notebook code examples

This article presents some sampleprovides code snippets that demonstrateshow how to interact with Microsoft Sentinel lake data using Jupyter notebooks to analyze security data inquery the Microsoft Sentinel data lake. Theselake using Jupyter notebooks. The examples illustrate how to access and analyzecover data from various tables,tables such as Microsoft Entra ID sign-in logs, group information,details, and device network events. The code snippets areEach snippet is designed to run in a Jupyter notebooks withinnotebook in Visual Studio Code usingwith the Microsoft Sentinel extension.

To run these examples, you must have the required permissions and Visual Studio Code installed with the Microsoft Sentinel extension. For more information, see Microsoft Sentinel data lake permissions and Use Jupyter notebooks with Microsoft Sentinel data lake.

Failed sign-in attempts analysis

This example identifies users with failed sign-in attempts. To do so, thisfind these users, the notebook example processes sign-in data from two tables:

  • SigninLogs
  • AADNonInteractiveUserSignInLogs

Query the EntraGroups table

This code sample reads the EntraGroups table from the data lake.table. It returns fields like displayName, groupTypes, mail, mailNickname, description,group details such as name, type, mail, and tenantId. tenant ID.

from sentinel_lake.providers import MicrosoftSentinelProvider

## Access Microsoft Entra ID sign-in logs for a specific user

The following codeThis sample demonstrates how to accessqueries the Microsoft Entra ID `SigninLogs` table and filter thefilters results for a specific user. It retrieves variousreturns fields such aslike UserDisplayName, UserPrincipalName, UserId, and more.UserId.

```python
from sentinel_lake.providers import MicrosoftSentinelProvider

## Detect lateral movement attempts

Use DeviceNetworkEvents to identify suspicious find internal-to-internal IP connections thatwith high connection counts, which may signal lateral movement, for example, abnormal Server Message Block (SMB)movement. You can adjust the connection-count threshold or Remote Desktop Protocol (RDP) traffic between endpoints.add port filters to narrow results to specific protocols.

```python
from sentinel_lake.providers import MicrosoftSentinelProvider

## Uncover credential dumping tools

Query DeviceProcessEvents to find known credential-dumping tools or suspicious processes like mimikatz.exe or unexpected execution ofthat interact with lsass.exe access,exe, which could indicate credential harvesting.

```python
from sentinel_lake.providers import MicrosoftSentinelProvider