Skip to content

Commit f736de9

Browse files
author
Ken Lawson
committed
Updated module with revised steps to use Azure ML.
1 parent d2772cc commit f736de9

File tree

7 files changed

+74
-35
lines changed

7 files changed

+74
-35
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: 53 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,69 @@ 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] It takes a few minutes to deploy the Machine Learning workspace.
2424
25-
1. Select the **Templates** tab.
25+
1. After *Your deployment is complete* message appears, return to Microsoft Sentinel.
2626

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

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

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

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

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

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

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

41-
1. Wait for the compute instance to finish creating.
41+
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 **(...)**.
4242

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

47+
1. Scroll down and select the first option available.
48+
49+
> [!TIP] Workload type: Development on Notebooks (or other IDE) and light weight testing.
50+
51+
1. Select the **Review + Create** button at the bottom of the screen, then scroll down and select **Create**. Close any feedback window that may appear. This takes a few minutes. You see a notification (bell icon) when it's done and the *Compute instance* left icon turns from blue to green.
52+
53+
1. Once the Compute has been created and running, verify that the kernel to use is *Python 3.10 - Pytorch and Tensorflow*.
54+
55+
> [!TIP] 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 may need to select the **Refresh** icon on the far right to see the kernel options.
56+
57+
1. Select the **Authenticate** button and wait for the authentication to complete.
58+
59+
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.
60+
61+
> [!TIP] This can be found by selecting the ellipsis (...) from the menu bar.
62+
63+
1. Review section *1 Introdution* in the notebook and proceed to section *2 Initializing the notebook and MSTICPy*.
64+
65+
> [!TIP]
66+
> Section 1.2 *Running code in notebooks* lets you practice running small lines of Python code.
67+
68+
1. In section *2 Initializing the notebook and MSTICPy*, review the content on initalizing the notebook and installing the MSTICPy package.
69+
70+
1. Run the *Python code* to initialize the cell by selecting the **Run cell** button (Play icon) to the left of the code.
71+
72+
1. It should take >30 seconds to run. Once it's done, review the output messages and *disregard any warnings about the Python kernel version* or other error messages.
73+
74+
1. The code ran successfully if *msticpyconfig.yaml* was created in the *utils* folder in the *file explorer* pane on the left. It may take another 30 seconds for the file to appear. If it doesn't appear, select the **Refresh** icon in the *file explorer* pane.
75+
76+
> [!TIP] 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.
77+
78+
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.
79+
80+
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.
81+
82+
>**Note:** If you cannot complete the steps above to access the Notebook, you can follow it on its GitHub viewwer 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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ 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
@@ -17,7 +17,8 @@ abstract: |
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)