Bird
Raised Fist0
Azurecloud~5 mins

Azure Sentinel for SIEM - Commands & Configuration

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Introduction
Azure Sentinel helps you watch over your computer systems and networks to find problems or threats quickly. It collects data from many places and shows alerts so you can fix issues before they cause harm.
When you want to see all security alerts from your cloud and on-premises systems in one place.
When you need to investigate suspicious activities across multiple data sources easily.
When you want to automate responses to common security threats to save time.
When you want to use built-in tools to detect unusual behavior without building your own rules.
When you want to keep track of compliance and security reports for audits.
Commands
Log in to your Azure account to start managing resources like Azure Sentinel.
Terminal
az login
Expected OutputExpected
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ABCD1234 to authenticate. You have logged in. Now you can manage your Azure resources.
Create a resource group to hold your Azure Sentinel workspace and related resources.
Terminal
az group create --name example-sentinel-rg --location eastus
Expected OutputExpected
{ "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/example-sentinel-rg", "location": "eastus", "name": "example-sentinel-rg", "properties": { "provisioningState": "Succeeded" }, "tags": {}, "type": "Microsoft.Resources/resourceGroups" }
--name - Specifies the name of the resource group.
--location - Specifies the Azure region where the group is created.
Create a Log Analytics workspace where Azure Sentinel will store and analyze security data.
Terminal
az monitor log-analytics workspace create --resource-group example-sentinel-rg --workspace-name example-law --location eastus
Expected OutputExpected
{ "customerId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "location": "eastus", "name": "example-law", "resourceGroup": "example-sentinel-rg", "sku": { "name": "PerGB2018" }, "type": "Microsoft.OperationalInsights/workspaces" }
--resource-group - Specifies the resource group for the workspace.
--workspace-name - Names the Log Analytics workspace.
--location - Sets the Azure region for the workspace.
Enable Azure Sentinel on the Log Analytics workspace to start collecting and analyzing security data.
Terminal
az sentinel workspace enable --resource-group example-sentinel-rg --workspace-name example-law
Expected OutputExpected
{ "properties": { "provisioningState": "Succeeded" }, "resourceGroup": "example-sentinel-rg", "workspaceName": "example-law" }
--resource-group - Specifies the resource group of the workspace.
--workspace-name - Specifies the workspace to enable Sentinel on.
List available data connectors to connect different data sources to Azure Sentinel for monitoring.
Terminal
az sentinel data-connector list --resource-group example-sentinel-rg --workspace-name example-law
Expected OutputExpected
[ { "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/example-sentinel-rg/providers/Microsoft.OperationalInsights/workspaces/example-law/providers/Microsoft.SecurityInsights/dataConnectors/AzureActiveDirectory", "name": "AzureActiveDirectory", "kind": "AzureActiveDirectory", "properties": { "dataTypes": { "signInLogs": { "state": "Enabled" }, "auditLogs": { "state": "Enabled" } }, "connectorId": "AzureActiveDirectory" } } ]
--resource-group - Specifies the resource group of the workspace.
--workspace-name - Specifies the workspace to list connectors for.
Key Concept

If you remember nothing else from this pattern, remember: Azure Sentinel uses a Log Analytics workspace to collect and analyze security data from many sources in one place.

Common Mistakes
Trying to enable Azure Sentinel without first creating a Log Analytics workspace.
Azure Sentinel requires a Log Analytics workspace to store and analyze data, so enabling it without one fails.
Always create a Log Analytics workspace first, then enable Azure Sentinel on it.
Not logging into Azure CLI before running commands.
Without logging in, commands cannot authenticate and will fail with errors.
Run 'az login' and complete authentication before managing Azure resources.
Using inconsistent resource group or workspace names across commands.
Commands will fail if they reference resource groups or workspaces that do not exist or mismatch.
Use consistent names for resource groups and workspaces in all commands.
Summary
Log in to Azure CLI to authenticate your session.
Create a resource group and a Log Analytics workspace to hold your security data.
Enable Azure Sentinel on the workspace to start monitoring.
List data connectors to integrate various data sources for security insights.

Practice

(1/5)
1. What is the main purpose of Azure Sentinel in security management?
easy
A. To provide cloud storage for application data
B. To collect and analyze security data for threat detection
C. To manage user passwords and authentication
D. To store backups of all user files

Solution

  1. Step 1: Understand Azure Sentinel's role

    Azure Sentinel is designed to collect security data from various sources to detect threats.
  2. Step 2: Compare options with Sentinel's function

    Only To collect and analyze security data for threat detection describes collecting and analyzing security data for threat detection, which matches Sentinel's purpose.
  3. Final Answer:

    To collect and analyze security data for threat detection -> Option B
  4. Quick Check:

    Azure Sentinel = threat detection [OK]
Hint: Remember: Sentinel = security data + threat detection [OK]
Common Mistakes:
  • Confusing Sentinel with backup or storage services
  • Thinking Sentinel manages passwords directly
  • Assuming Sentinel is just cloud storage
2. Which of the following is the correct way to create an alert rule query in Azure Sentinel using Kusto Query Language (KQL)?
easy
A. GET SecurityEvent WHERE EventID = 4625
B. SELECT * FROM SecurityEvent WHERE EventID = 4625
C. FIND SecurityEvent WITH EventID 4625
D. SecurityEvent | where EventID == 4625

Solution

  1. Step 1: Identify the query language used in Azure Sentinel

    Azure Sentinel uses Kusto Query Language (KQL), which uses pipe operators and 'where' clauses.
  2. Step 2: Match the syntax to KQL

    SecurityEvent | where EventID == 4625 uses KQL syntax correctly: table name, pipe, and 'where' condition. Other options use SQL or invalid syntax.
  3. Final Answer:

    SecurityEvent | where EventID == 4625 -> Option D
  4. Quick Check:

    KQL uses pipes and 'where' [OK]
Hint: KQL uses pipes (|) and 'where' for filters [OK]
Common Mistakes:
  • Using SQL syntax instead of KQL
  • Missing pipe operator in query
  • Using incorrect keywords like GET or FIND
3. Given the following KQL query in Azure Sentinel alert rule:
SecurityEvent | where EventID == 4625 | summarize count() by Account
What does this query output?
medium
A. A count of all events without grouping
B. A list of all successful login events
C. A count of failed login attempts grouped by user account
D. A list of accounts with no login attempts

Solution

  1. Step 1: Analyze the query filters and aggregation

    The query filters SecurityEvent for EventID 4625, which means failed login attempts, then counts them grouped by Account.
  2. Step 2: Understand the summarize clause

    'summarize count() by Account' groups results by Account and counts events per account.
  3. Final Answer:

    A count of failed login attempts grouped by user account -> Option C
  4. Quick Check:

    EventID 4625 = failed logins, grouped count = A count of failed login attempts grouped by user account [OK]
Hint: EventID 4625 means failed login; summarize groups counts [OK]
Common Mistakes:
  • Confusing EventID 4625 with successful logins
  • Ignoring the grouping by Account
  • Thinking it lists accounts without attempts
4. You wrote this KQL alert rule query in Azure Sentinel:
SecurityEvent | where EventID = 4625 | summarize count() by Account
Why does this query fail to run correctly?
medium
A. Because the equality operator should be '==' not '=' in KQL
B. Because 'summarize' cannot be used with 'count()'
C. Because 'Account' is not a valid field in SecurityEvent
D. Because 'where' clause must come after 'summarize'

Solution

  1. Step 1: Check the operator syntax in the 'where' clause

    KQL requires '==' for equality comparison, not a single '=' which is assignment in some languages.
  2. Step 2: Validate other parts of the query

    'summarize count() by Account' is valid, and 'Account' is a common field. 'where' must come before 'summarize'.
  3. Final Answer:

    Because the equality operator should be '==' not '=' in KQL -> Option A
  4. Quick Check:

    KQL equality uses '==' not '=' [OK]
Hint: Use '==' for equality in KQL, not '=' [OK]
Common Mistakes:
  • Using single '=' instead of '==' in KQL
  • Misplacing 'where' after 'summarize'
  • Assuming 'count()' is invalid with 'summarize'
5. You want to create an Azure Sentinel alert that triggers when there are more than 5 failed login attempts from the same account within 10 minutes. Which KQL query correctly implements this logic?
hard
A. SecurityEvent | where EventID == 4625 | where TimeGenerated > ago(10m) | summarize FailedAttempts = count() by Account | where FailedAttempts > 5
B. SecurityEvent | where EventID == 4625 | summarize count() by Account | where count_ > 5
C. SecurityEvent | where EventID == 4625 and TimeGenerated < ago(10m) | summarize count() by Account | where count_ > 5
D. SecurityEvent | where EventID == 4625 | summarize count() by Account, TimeGenerated | where count_ > 5

Solution

  1. Step 1: Filter failed login events within last 10 minutes

    SecurityEvent | where EventID == 4625 | where TimeGenerated > ago(10m) | summarize FailedAttempts = count() by Account | where FailedAttempts > 5 uses 'where TimeGenerated > ago(10m)' to filter recent events correctly.
  2. Step 2: Group by Account and count attempts, then filter counts over 5

    SecurityEvent | where EventID == 4625 | where TimeGenerated > ago(10m) | summarize FailedAttempts = count() by Account | where FailedAttempts > 5 summarizes counts by Account and filters where count > 5, matching the requirement.
  3. Final Answer:

    SecurityEvent | where EventID == 4625 | where TimeGenerated > ago(10m) | summarize FailedAttempts = count() by Account | where FailedAttempts > 5 -> Option A
  4. Quick Check:

    Filter by time + count > 5 per account = SecurityEvent | where EventID == 4625 | where TimeGenerated > ago(10m) | summarize FailedAttempts = count() by Account | where FailedAttempts > 5 [OK]
Hint: Filter time first, then count and filter by count > 5 [OK]
Common Mistakes:
  • Not filtering events by time range
  • Using incorrect logical operators in filters
  • Grouping by TimeGenerated causing wrong counts