Skip to content

Commit cc68292

Browse files
committed
updating with more details
1 parent 198cc11 commit cc68292

File tree

3 files changed

+111
-5
lines changed

3 files changed

+111
-5
lines changed
37.4 KB
Loading
8.63 KB
Loading

articles/sentinel/notebook-get-started.md

Lines changed: 111 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,121 @@ This procedure describes how to launch your notebook with Microsoft Sentinel.
5757
- *Markdown* cells contain text and graphics with instructions for using the notebook
5858
- *Code* cells contain executable code that performs the notebook functions
5959

60-
1. Read and run the code cells in order, using the directions in the notebook. Skipping cells or running them out of order might cause errors later in the notebook.
60+
1. At the top of the page, select your **Compute**, and then read and run the code cells in order using the instructions in the notebook. Skipping cells or running them out of order might cause errors later in the notebook.
6161

62-
Depending on the function being performed, the code in the cell might run quickly, or it might take a few seconds to complete. When the cell is running, the play button changes to a loading spinner, and a status of `Executing` is displayed at the bottom of the cell, together with the elapsed time.
62+
Depending on the compute you selected, it might take a few minutes to start. When the compute is ready, it'll show as **Ready** at the top of the tab.
6363

64-
The notebook contains sections for you to run the following tasks:
64+
:::image type="content" source="media/notebook-get-started/compute-ready.png" alt-text="Screenshot of a machine learning environment ready to run code cells.":::
6565

66-
- **Initialize the notebook and MSTICPy**. Use this section of the notebook to set up your environment and understand the basics of notebooks and MSYTICPy. For more information, see the sample [`msticpyconfig.yaml](https://github.com/Azure/Azure-Sentinel-Notebooks/blob/master/msticpyconfig.yaml) template, which has commented-out sections that might help you understand the settings.
66+
Depending on the function being performed, the code in the cell might run quickly, or it might take a few seconds to complete. When the cell is running, the play button changes to a loading spinner, and the status is displayed at the bottom of the cell, together with the elapsed time.
6767

68-
- **Query data from Microsoft Sentinel.** Use this section of the notebook to verify your Microsoft Sentinel settings in MSTICPy, load a QueryProvider to query data from Microsoft Sentinel, authenticate to Microsoft Sentinel, and test your connection.
68+
Run the code cells in the **Introduction** section to learn the basics of running code in notebooks, and then run the code in the **Initializing the notebook and MSTICPy** section to set up your initial environment.
69+
70+
When initializing the notebook, configuration warnings about missing settings are expected because you didn't configure anything yet.
71+
72+
## Create your configuration file
73+
74+
After the basic initialization, you're ready to create your configuration file with basic settings for working with MSTICPy.
75+
76+
Many Microsoft Sentinel notebooks connect to external services such as [VirusTotal](https://www.virustotal.com) (VT) to collect and enrich data. To connect to these services you need to set and store configuration details, such as authentication tokens. Having this data in your configuration file avoids you having to type in authentication tokens and workspace details each time you use a notebook.
77+
78+
MSTICPy uses a **msticpyconfig.yaml** for storing a wide range of configuration details. By default, a **msticpyconfig.yaml** file is generated by the notebook initialization function. If you [cloned this notebook from the Microsoft Sentinel portal](#run-and-initialize-the-getting-started-guide-notebook), the configuration file is populated with Microsoft Sentinel workspace data. This data is read from a **config.json** file, created in the Azure Machine Learning workspace when you launch your notebook. For more information, see the [MSTICPy Package Configuration documentation](https://msticpy.readthedocs.io/en/latest/getting_started/msticpyconfig.html).
79+
80+
The following sections describe how to add more configuration details to the **msticpyconfig.yaml** file.
81+
82+
If you run the *Getting Started Guide* notebook again, and already have a minimally configured **msticpyconfig.yaml** file, the `init_notebook` function doesn't overwrite or modify your existing file.
83+
84+
At any point in time, select the **-Help** drop-down menu in the MSTICPy configuration tool for more instructions and links to detailed documentation.
85+
86+
### Display the MSTICPy settings editor
87+
88+
1. Add a code cell to your notebook, and run the following code to import the `MpConfigEdit` tool and display a settings editor for your **msticpyconfig.yaml** file:
89+
90+
```python
91+
from msticpy.config import MpConfigEdit
92+
93+
mpedit = MpConfigEdit( "msticpyconfig.yaml")
94+
mpedit.set_tab("AzureSentinel")
95+
display(mpedit)
96+
```
97+
98+
The automatically created **msticpyconfig.yaml** file is shown in the notebook in a series of editable tabs. In the **Microsoft Sentinel** tab, two entries are already populated with details of the Microsoft Sentinel workspace that the notebook was cloned from. One entry has the name of your workspace and the other is named **Default**.
99+
100+
MSTICPy allows you to store configurations for multiple Microsoft Sentinel workspaces and switch between them. The **Default** entry allows you to authenticate to your "home" workspace by default, without having to name it explicitly. If you add another workspaces, you can configure any one of them to be the **Default** entry.
101+
102+
In the Azure Machine Learning environment, the settings editor might take 10-20 seconds to appear.
103+
104+
1. Verify your current settings and select **Save Settings**.
105+
106+
### Add threat intelligence provider settings
107+
108+
This procedure describes how to store your [VirusTotal API key](#prerequisites) in the **msticpyconfig.yaml** file. You can opt to upload the API key to Azure Key Vault, but you must configure the Key Vault settings first. For more information, see [Configure Key Vault settings](#configure-key-vault-settings).
109+
110+
To add VirusTotal details in the MSTICPy settings editor, complete the following steps.
111+
112+
1. Add a new code cell and run the following:
113+
114+
```python
115+
mpedit.set_tab("TI Providers")
116+
mpedit
117+
```
118+
119+
1. In the **TI Providers** tab, from the **Add prov** dropdown, select **VirusTotal** > **Add**.
120+
121+
1. Under **Auth Key**, select **Text** next to the **Storage** option.
122+
123+
1. In the **Value** field, paste your API key.
124+
125+
1. Select **Update**, and then select **Save Settings** at the bottom of the settings editor.
126+
127+
For more information about other supported threat intelligence providers, see [Threat intelligence providers](https://msticpy.readthedocs.io/en/latest/data_acquisition/TIProviders.html) in the MSTICPy documentation and [Threat intelligence integration in Microsoft Sentinel](threat-intelligence-integration.md).
128+
129+
### Add GeoIP provider settings
130+
131+
This procedure describes how to store a [MaxMind GeoLite2 account key](#prerequisites) in the **msticpyconfig.yaml** file, which allows your notebook to use geolocation lookup services for IP addresses.
132+
133+
To add GeoIP provider settings in the MSTICPy settings editor, complete the following steps.
134+
135+
1. Add a new code cell and run the following:
136+
137+
```python
138+
mpedit.set_tab("GeoIP Providers")
139+
mpedit
140+
```
141+
142+
1. In the **GeoIP Providers** tab, from the **Add prov** dropdown, select **GeoIPLite** > **Add**.
143+
144+
1. In the **Value** field, enter your MaxMind account key.
145+
146+
1. If needed, update the default **~/.msticpy** folder for storing the downloaded GeoIP database.
147+
148+
- On Windows, this folder is mapped to the **%USERPROFILE%/.msticpy**.
149+
- On Linux or macOS, this path is mapped to the **.msticpy** folder in your home folder.
150+
151+
For more information about other supported geolocation lookup services, see the [MSTICPy GeoIP Providers documentation](https://msticpy.readthedocs.io/en/latest/data_acquisition/GeoIPLookups.html).
152+
153+
### Configure Azure Cloud settings
154+
155+
If your organization doesn't use the Azure public cloud, you must specify this in your settings to successfully authenticate and use data from Microsoft Sentinel and Azure. For more information, see [Specify the Azure Cloud and default Azure Authentication methods](#specify-the-azure-cloud-and-azure-authentication-methods).
156+
157+
### Validate settings
158+
159+
1. On any tab in the MSTICPy settings editor, select **Validate settings**.
160+
161+
Warning messages about missing configurations are expected, but you shouldn't have any for threat intelligence provider or GeoIP provider settings.
162+
163+
1. Depending on your environment, you might also need to [Configure Key Vault settings](#configure-key-vault-settings) or [Specify the Azure cloud](#specify-the-azure-cloud-and-azure-authentication-methods).
164+
165+
1. If you need to make any changes because of the validation, make those changes and then select **Save Settings**.
166+
167+
1. When you're done, select the **Close** button to hide the validation output.
168+
169+
For more information, see: [Advanced configurations for Jupyter notebooks and MSTICPy in Microsoft Sentinel](notebooks-msticpy-advanced.md)
170+
171+
## find a space for this
172+
173+
174+
- **Querying data from Microsoft Sentinel.** Use this section of the notebook to verify your Microsoft Sentinel settings in MSTICPy, load a QueryProvider to query data from Microsoft Sentinel, authenticate to Microsoft Sentinel, and test your connection.
69175

70176
If you restart your Compute instance or switch to a different instance, you'll need to re-authenticate to Microsoft Sentinel. For more information, see [Caching credentials with Azure CLI](https://github.com/Azure/Azure-Sentinel-Notebooks/wiki/Caching-credentials-with-Azure-CLI).
71177

0 commit comments

Comments
 (0)