Microsoft Sentinel + Log Analytics demo lab for security monitoring, KQL detections and incident workflows.
This repository contains sample Kusto Query Language (KQL) queries and a reference workflow for building a basic security monitoring lab using Microsoft Sentinel and Azure Log Analytics.
The goal is to demonstrate how to:
- Ingest Azure AD and Azure Activity data into a Log Analytics workspace
- Enable Microsoft Sentinel
- Create analytics rules using KQL
- Investigate suspicious sign-ins and privilege escalations
High-level flow:
- Azure resources send logs to Log Analytics workspace
- Microsoft Sentinel is enabled on that workspace
- Sentinel uses KQL queries to detect:
- Sign-in anomalies
- High-privilege role assignments
- Incidents are created in Sentinel for security investigation
You can later extend this with:
- Logic Apps playbooks (SOAR)
- Workbooks and dashboards
- Alerts integration with email, Teams, ITSM
- Azure subscription
- Log Analytics workspace
- Microsoft Sentinel enabled on the workspace
- Data connectors configured for:
- Azure Active Directory sign-in logs
- Azure Active Directory audit logs
- Azure Activity
- Open the Azure portal and go to Microsoft Sentinel.
- Select your Sentinel-enabled workspace.
- Go to Logs.
- Open the
queriesfolder in this repo. - Copy the contents of
.kqlfiles and paste into the Log query window. - Run the query and verify the results.
- Convert validated queries into Scheduled analytics rules:
- Sentinel → Analytics → + Create → Scheduled query rule
- Set frequency and lookback period
- Configure incident creation and severity
Detects suspicious sign-in activity such as:
- Multiple failed sign-ins
- Sign-ins from multiple countries in a short period
- Sign-ins from high-risk countries
Detects privileged role assignments such as:
- Global Administrator
- Privileged Role Administrator
- User Access Administrator
- Security Administrator
- Add Logic Apps playbooks to:
- Disable user on confirmed compromise
- Notify security team via email or Teams
- Build a Sentinel workbook with:
- Failed sign-in trends
- High-risk IP addresses
- Admin role changes over time
This lab is for learning and demonstration. Always tune detections for your environment before production use.
This lab has been tested in a personal Azure subscription with:
- Azure AD sign-in logs
- Azure Activity logs
- Microsoft Sentinel enabled on a single workspace
Below are sample screenshots (sourced from public Microsoft documentation/demo environments) that illustrate how Microsoft Sentinel visualizes logs, runs queries, and generates incidents.
Provides a high-level summary of alerts, incidents, events, and security trends.

Shows incidents generated by analytics rules, anomaly detections, and log-based alerts.

KQL query results for sign-in anomalies and privilege escalations.

How a custom KQL detection is operationalized into an automated rule.

Shows structured log events feeding into Sentinel analytics.

Sample dashboard visualizing trends and incidents using Sentinel Workbooks.
