Skip to content

Commit e73bbe8

Browse files
authored
Merge pull request #50598 from KenMAG/main
Updated module with revised steps to use Azure ML.
2 parents d6c3b88 + 42a1eba commit e73bbe8

File tree

7 files changed

+82
-36
lines changed

7 files changed

+82
-36
lines changed

learn-pr/wwl-sci/perform-threat-hunting-sentinel-with-notebooks/1-introduction.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: Introduction
44
metadata:
55
title: Introduction
66
description: "Introduction"
7-
ms.date: 10/12/2022
8-
author: wwlpublish
7+
ms.date: 5/22/2025
8+
author: KenMAG
99
ms.author: kelawson
1010
ms.topic: unit
1111
azureSandbox: false

learn-pr/wwl-sci/perform-threat-hunting-sentinel-with-notebooks/4-create-notebook.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: Create a notebook
44
metadata:
55
title: Create a notebook
66
description: "Create a notebook"
7-
ms.date: 10/12/2022
8-
author: wwlpublish
7+
ms.date: 5/22/2025
8+
author: KenMAG
99
ms.author: kelawson
1010
ms.topic: unit
1111
azureSandbox: false

learn-pr/wwl-sci/perform-threat-hunting-sentinel-with-notebooks/5-explore-notebook-code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: Explore notebook code
44
metadata:
55
title: Explore notebook code
66
description: "Explore notebook code"
7-
ms.date: 10/12/2022
8-
author: wwlpublish
7+
ms.date: 5/22/2025
8+
author: KenMAG
99
ms.author: kelawson
1010
ms.topic: unit
1111
azureSandbox: false

learn-pr/wwl-sci/perform-threat-hunting-sentinel-with-notebooks/includes/1-introduction.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
You can use notebooks in Microsoft Sentinel for advanced hunting.
22

3-
You're a Security Operations Analyst working at a company that implemented Microsoft Sentinel. You want to mature your Security Operations team to proactively hunt for malicious activity in your environment with advanced machine learning capabilities.
3+
You're a Security Operations Analyst working at a company that implemented Microsoft Sentinel. You want to mature your Security Operations team to proactively hunt for malicious activity in your environment with advanced machine learning capabilities.
44

55
After developing your hunting hypothesis, you utilize a Jupyter notebook to integrate machine learning libraries, advanced visualizations, and external data to detect malicious activity patterns.
66

@@ -12,4 +12,6 @@ After completing this module, you'll be able to:
1212

1313
## Prerequisites
1414

15-
Basic knowledge of operational concepts such as monitoring, logging, and alerting
15+
- Basic knowledge of operational concepts such as monitoring, logging, and alerting
16+
- Familiarity deploying Azure services
17+
- Familiarity with scripting and Python coding
Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
To start with Notebooks, use the "Getting Started Guide For Microsoft Sentinel ML Notebooks" notebook.
1+
To get started with Notebooks, use the *Getting Started Guide For Microsoft Sentinel ML Notebooks* notebook.
22

3-
1. In the Microsoft Sentinel Workspace, select **Notebooks**
3+
1. In the Microsoft Sentinel navigation menu, expand the *Threat Management* section, and select **Notebooks**
44

5-
1. You need to create an AzureML Workspace. Select **Configure Azure Machine Learning** then **Create new Azure ML workspace**.
5+
1. You need to create an Azure Machine Learning (ML) Workspace. From the menu, select **Configure Azure Machine Learning**, then **Create new Azure ML workspace**.
66

77
1. In the Subscription box, select your subscription.
88

@@ -14,33 +14,76 @@ To start with Notebooks, use the "Getting Started Guide For Microsoft Sentinel M
1414

1515
- Choose your Region
1616

17-
- Save your Storage account, Key vault, and Application insights information.
17+
- Keep the default Storage account, Key vault, and Application insights information.
1818

1919
- The Container registry option can remain as None.
2020

21-
1. At the bottom of the page, select **Review + create**. Then on the next page, select **create**. It will take a moment to deploy the workspace.
21+
1. At the bottom of the page, select **Review + create**. Then on the next page, select **create**. It takes a moment to deploy the workspace.
2222

23-
1. Navigate to the Microsoft Sentinel workspace, select **Notebooks**.
23+
> [!NOTE]
24+
> It takes a few minutes to deploy the Machine Learning workspace.
2425
25-
1. Select the **Templates** tab.
26+
1. After *Your deployment is complete* message appears, return to Microsoft Sentinel.
2627

27-
1. Select the **A Getting Started Guide For Microsoft Sentinel ML Notebooks** from the list.
28+
1. Navigate to the Threat Management section, and select **Notebooks**.
2829

29-
1. Select **Create from template** on the bottom of the right page.
30+
1. Select the **Templates** tab.
3031

31-
1. Select the **Save**.
32+
1. Select the **A Getting Started Guide For Microsoft Sentinel ML Notebooks** from the list.
3233

33-
1. Select the **Launch notebook**.
34+
1. Select **Create from template** button on the bottom of the detail pane.
3435

35-
1. Next to the Compute instance selector at the top of the screen, select the **+**.
36+
1. Review the default options and then select **Save**.
3637

37-
1. Choose your compute settings.
38+
1. Select the **Launch notebook** button.
3839

39-
1. Name your Compute instance and select the **Create** button at the bottom of the screen.
40+
1. Select **Close** if an informational window appears in the Microsoft Azure Machine Learning studio.
4041

41-
1. Wait for the compute instance to finish creating.
42+
1. 1. In the command bar, to the right of the **Compute:** selector, select the **+** symbol to *Create Azure ML compute* instance. **Hint:** It might be hidden inside the ellipsis icon **(...)**.
4243

43-
1. In the top right of the notebook, select a Kernel to use if not selected.
44+
> [!NOTE]
45+
> You can have more screen space by hiding the Azure ML Studio left menu selections. Select the *Hamburger menu* (3 horizontal lines on the top left), and by collapsing the Notebooks Files by selecting the **<<** icon.
4446
45-
1. Follow the instructions in the Notebook.
47+
1. Type a unique name in the *Compute name* field. This identifies your compute instance.
4648

49+
1. Scroll down and select the first option available.
50+
51+
> [!TIP]
52+
> Workload type: Development on Notebooks (or other IDE) and lightweight testing.
53+
54+
1. Select the **Review + Create** button at the bottom of the screen, then scroll down and select **Create**. Close any feedback window that appears. This takes a few minutes. You see a notification (bell icon) when it completes and the *Compute instance* left icon turns from blue to green.
55+
56+
1. Once the Compute is created and running, verify that the kernel to use is *Python 3.10 - Pytorch and Tensorflow*.
57+
58+
> [!TIP]
59+
> This is shown in the right of the menu bar. If that kernel isn't selected, select the *Python 3.10 - Pytorch and Tensorflow* option from the drop-down list. You can select the **Refresh** icon on the far right to see the kernel options.
60+
61+
1. Select the **Authenticate** button and wait for the authentication to complete.
62+
63+
1. Clear all the results from the notebook by selecting the **Clear all outputs** (Eraser icon) from the menu bar and follow the *Getting Started* tutorial.
64+
65+
> [!TIP]
66+
> This can be found by selecting the ellipsis (...) from the menu bar.
67+
68+
1. Review section *1 Introduction* in the notebook and proceed to section *2 Initializing the notebook and MSTICPy*.
69+
70+
> [!TIP]
71+
> Section 1.2 *Running code in notebooks* lets you practice running small lines of Python code.
72+
73+
1. In section *2 Initializing the notebook and MSTICPy*, review the content on Initializing the notebook and installing the MSTICPy package.
74+
75+
1. Run the *Python code* to initialize the cell by selecting the **Run cell** button (Play icon) to the left of the code.
76+
77+
1. It should take >30 seconds to run. Once it completes, review the output messages and *disregard any warnings about the Python kernel version* or other error messages.
78+
79+
1. The code ran successfully if *msticpyconfig.yaml* was created in the *utils* folder in the *file explorer* pane on the left. It can take another 30 seconds for the file to appear. If it doesn't appear, select the **Refresh** icon in the *file explorer* pane.
80+
81+
> [!TIP]
82+
> You can clear the output messages by selecting the ellipsis (...) on the left of the code window for the *Output menu* and selecting the *Clear output* (square with an x*) icon.
83+
84+
1. Select the **msticpyconfig.yaml** file in the *file explorer* pane on the left to review the contents of the file and then close it.
85+
86+
1. Proceed to section *3 Querying data with MSTICPy* and review the contents. Don't run the *Multiple Microsoft Sentinel workspaces* code cell as it fails, but the other code cells can be run successfully.
87+
88+
> [!NOTE]
89+
> If you can't complete the steps above to access the Notebook, you can follow it on its GitHub viewer page instead. [Getting Started with Azure ML Notebooks and Microsoft Sentinel](https://nbviewer.org/github/Azure/Azure-Sentinel-Notebooks/blob/master/A%20Getting%20Started%20Guide%20For%20Azure%20Sentinel%20ML%20Notebooks.ipynb)

learn-pr/wwl-sci/perform-threat-hunting-sentinel-with-notebooks/includes/5-explore-notebook-code.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
The following code blocks of the "Getting Started Guide For Microsoft Sentinel ML Notebooks" notebook provide a representative example of working with Microsoft Sentinel data.
1+
The following code blocks provide a representative example of using notebooks to work with Microsoft Sentinel data.
22

33
**Code Block**
44

55
In this snippet of code:
66

77
- Create a new variable [test_query] that contains the KQL query.
88

9-
- Next, you run the query [qry_prov.exec_query()]. This utilizes the msticpy library to execute the KQL query in the Microsoft Sentinel Log Analytics related workspace. The results are stored in the [test_df] variable.
9+
- Next, you run the query [qry_prov.exec_query()]. This utilizes the msticpy library to execute the KQL query in the Microsoft Sentinel Log Analytics related workspace. The results are stored in the [test_df] variable.
1010

1111
- Next, display the first five rows with the xxx_xxxx.head() function.
1212

13-
:::image type="content" source="../media/threat-hunt-1.png" alt-text="Screenshot of a Sentinel Notebook Sample 1 Query.":::
13+
:::image type="content" source="../media/threat-hunt-1.png" alt-text="Screenshot of a Microsoft Sentinel Notebook Sample 1 Query.":::
1414

1515
**Code Block**
1616

@@ -26,16 +26,16 @@ In this snippet of code:
2626

2727
- The new function returns the Severity of the IP address.
2828

29-
:::image type="content" source="../media/threat-hunt-3.png" alt-text="Screenshot of a Sentinel Notebook Sample 2 Query.":::
29+
:::image type="content" source="../media/threat-hunt-3.png" alt-text="Screenshot of a Microsoft Sentinel Notebook Sample 2 Query.":::
3030

3131
**Code Block**
3232

3333
In this snippet of code:
3434

3535
- Create a new variable [vis_q] that contains the KQL query.
3636

37-
- Next, you run the query [qry_prov.exec_query()]. This utilizes the msticpy library to execute the KQL query in the Microsoft Sentinel Log Analytics related workspace. The results are stored in the [vis_data] variable.
37+
- Next, you run the query [qry_prov.exec_query()]. This utilizes the msticpy library to execute the KQL query in the Microsoft Sentinel Log Analytics related workspace. The results are stored in the [vis_data] variable.
3838

39-
- Then, [qry_prov.exec_query()] returns a pandas DataFrame that provides visualization features. You then plot a bar graph with the unique IP addresses and how many times they were used in the first five entries of the Dataframe.
39+
- Then, [qry_prov.exec_query()] returns a pandas DataFrame that provides visualization features. You then plot a bar graph with the unique IP addresses and how many times they were used in the first five entries of the Dataframe.
4040

41-
:::image type="content" source="../media/threat-hunt-2.png" alt-text="Screenshot of a Sentinel Notebook Sample 3 Query.":::
41+
:::image type="content" source="../media/threat-hunt-2.png" alt-text="Screenshot of a Microsoft Sentinel Notebook Sample 3 Query.":::

learn-pr/wwl-sci/perform-threat-hunting-sentinel-with-notebooks/index.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ uid: learn.wwl.perform-threat-hunting-sentinel-with-notebooks
33
metadata:
44
title: Hunt for threats using notebooks in Microsoft Sentinel
55
description: "Hunt for threats using notebooks in Microsoft Sentinel"
6-
ms.date: 10/12/2022
7-
author: wwlpublish
6+
ms.date: 5/22/2025
7+
author: KenMAG
88
ms.author: kelawson
99
ms.topic: module
1010
ms.service: microsoft-sentinel
1111
title: Hunt for threats using notebooks in Microsoft Sentinel
1212
summary: Learn how to use notebooks in Microsoft Sentinel for advanced hunting.
1313
abstract: |
14-
Upon completion of this module, the learner will be able to:
14+
Upon completion of this module, the learner is able to:
1515
- Explore API libraries for advanced threat hunting in Microsoft Sentinel
1616
- Describe notebooks in Microsoft Sentinel
1717
- Create and use notebooks in Microsoft Sentinel
1818
prerequisites: |
1919
- Basic knowledge of operational concepts such as monitoring, logging, and alerting
20-
- Basic experience with Azure services
20+
- Familiarity deploying Azure services
21+
- Familiarity with scripting and Python coding
2122
iconUrl: /training/achievements/azure-sentinel-notebooks.svg
2223
levels:
2324
- intermediate

0 commit comments

Comments
 (0)