Agent Foskett Academy • Microsoft Sentinel • Module 2 • Lesson 20

Lesson 20 — Microsoft Sentinel Notebooks

KQL is ideal for querying Microsoft Sentinel data quickly.

Notebooks extend that investigation by combining code, queries, notes, enrichment, visualisations and repeatable analysis inside a single interactive document.

Analysts can use Jupyter Notebooks, Python and security-focused libraries to explore complex datasets, enrich indicators, build timelines and document advanced hunting workflows.

KQL finds the evidence. Notebooks help analysts explore, enrich and visualise it.
Agent Foskett Microsoft Sentinel Notebooks lesson
What you will learn

This lesson explains how Notebooks support advanced Microsoft Sentinel investigations and hunting workflows.

What a Sentinel Notebook is
Jupyter, Python and MSTICPy
Enrichment and visualisation
Security and cost considerations

Learning objectives

After completing this lesson, you should understand how Microsoft Sentinel Notebooks extend advanced investigation and hunting workflows.

  • Explain what a Jupyter Notebook is.
  • Understand when to use KQL and when to use a Notebook.
  • Recognise the role of Python and MSTICPy.
  • Use Notebooks for enrichment, visualisation and repeatable analysis.
  • Understand permissions, credentials, governance and cost considerations.

The problem this solves

Some investigations require more than one query or one table.

Notebooks let analysts combine many steps, data sources, code blocks, notes and visualisations into a repeatable workflow.

What is a Microsoft Sentinel Notebook?

A Notebook is an interactive document that combines executable code, query results, written explanations and visualisations.

In Microsoft Sentinel, Notebooks are commonly used for advanced hunting, enrichment, investigation timelines, data science and repeatable analysis.

Agent Foskett tip:

A Notebook should make an investigation easier to reproduce. Keep the code readable, explain each step and avoid hiding important assumptions.

How a Notebook investigation works

Start with a hypothesis │ ▼ Query Sentinel data │ ├── KQL results ├── Entity details ├── Alerts and incidents └── Threat indicators │ ▼ Enrich with Python or external services │ ▼ Visualise timelines, relationships and patterns │ ▼ Document findings and repeat the workflow

Jupyter Notebooks

Jupyter provides the interactive notebook format used for code, text and visual output.

Analysts can run cells individually, inspect results and refine the investigation step by step.

Python

Python is commonly used in Sentinel Notebooks for data processing, enrichment, visualisation and automation.

It gives analysts access to a broad ecosystem of libraries for working with security data.

MSTICPy

MSTICPy is a Microsoft security investigation and threat hunting library for Python.

It can help query data, enrich indicators, analyse entities, build timelines and visualise investigation results.

KQL versus Notebooks

KQL is usually the fastest tool for querying and summarising Sentinel data.

Notebooks become useful when the investigation needs multiple stages, external enrichment, custom visualisation or reusable analysis logic.

Use KQL when

  • You need a quick query.
  • The data already exists in Sentinel.
  • You are filtering, summarising or joining tables.
  • You want to create an analytics rule or hunting query.

Use a Notebook when

  • The workflow has many investigation steps.
  • You need external enrichment.
  • You need custom charts or relationship analysis.
  • You want the investigation to be repeatable and documented.

KQL versus Notebooks

KQLNotebook
Optimised for querying Microsoft security data.Combines queries, code, notes and visualisations.
Fast for filtering, joining and summarising tables.Useful for multi-stage and repeatable investigations.
Natural fit for analytics rules and hunting queries.Natural fit for enrichment and advanced analysis.
Runs primarily inside supported Microsoft query experiences.Runs in a notebook environment with configured access.

Threat intelligence enrichment

Notebooks can enrich IP addresses, domains, URLs, hashes and other indicators using approved intelligence sources.

Record the source, confidence and time of each enrichment result.

Visualisation

Notebooks can create timelines, charts, graphs and tables tailored to the investigation.

Visual output should support the evidence rather than replace it.

Real-world phishing investigation

Suspicious email incident │ ▼ Query email and URL evidence │ ▼ Extract sender, domains, URLs and recipients │ ▼ Enrich indicators with approved sources │ ▼ Build recipient and click timeline │ ▼ Visualise affected users and devices │ ▼ Document findings and recommended response

Reusable workflows

A well-designed Notebook can become a repeatable investigation procedure.

Parameters can allow another analyst to run the same workflow for a different account, incident or indicator.

Documentation

Use markdown cells to explain the hypothesis, data sources, assumptions, findings and limitations.

This makes the investigation easier to review and hand over.

Credentials and secrets

Do not store passwords, API keys or tokens directly inside Notebook code.

Use secure authentication methods, managed identities or approved secret storage where available.

Permissions

Notebook users and compute identities should only receive the access required for the investigation.

Least privilege reduces the risk of exposing security data or allowing unintended actions.

Compute and cost

Notebook environments may use compute resources that generate cost.

Stop or remove unused compute, review workspace policies and understand how the selected environment is billed.

Common mistake

A common mistake is using a Notebook for a task that one clear KQL query could solve.

Choose the simplest tool that provides reliable and repeatable evidence.

Agent Foskett investigation tip

Make the workflow explain itself.

A good Notebook should show where the data came from, what each step did and how the final conclusion was reached.

Best practices

  • Start with a clear investigation hypothesis.
  • Use parameters instead of hard-coded values.
  • Keep secrets out of the Notebook.
  • Document data sources and assumptions.
  • Test the workflow before relying on it operationally.

Agent Foskett takeaway

Microsoft Sentinel Notebooks extend KQL-driven investigations with code, enrichment, visualisation and repeatable workflows.

They are most valuable when the analysis is too complex for one query but still needs to remain transparent and reproducible.

Lesson summary
Microsoft Sentinel Notebooks combine Jupyter, Python, queries, enrichment, visualisations and documentation into repeatable investigation workflows. Use KQL for direct security queries and use Notebooks when the investigation requires multiple stages, external context or custom analysis.
Sentinel Academy Home

Microsoft Sentinel Notebooks

Microsoft Sentinel Notebooks use Jupyter, Python and security investigation libraries to support advanced hunting, enrichment, visualisation, entity analysis and repeatable SOC workflows.

Microsoft Sentinel Lesson 20

This Agent Foskett Microsoft Sentinel Academy lesson explains Notebooks, Python, MSTICPy, KQL comparisons, threat intelligence enrichment, visualisation, permissions, credentials, compute and investigation governance.