AZ-500 LAB 50 ~60 phút Chương 12 Lab cuối — AZ-500

Incident Investigation + Workbook

Điều tra incident được tạo từ Lab 49, thực hành quy trình triage đầy đủ (gán owner, comment, entity), chạy hunting query KQL, tạo Workbook dashboard giám sát hoạt động bảo mật và đóng incident đúng quy trình SOC.

🎯 Mục Tiêu Lab

Mở incident từ Lab 49 và thực hiện triage đầy đủ

Gán owner, đổi status, xem entity liên quan

Thêm investigation comment và kiểm tra evidence

Chạy hunting query KQL để tìm thêm context

Tạo Workbook hiển thị số lượng hoạt động nhạy cảm theo user

Đóng incident với lý do phù hợp (True Positive / False Positive)

📋 Chuẩn Bị

Yêu cầu:
  • Đã hoàn thành Lab 49 — Sentinel + Analytics Rule
  • Workspace law-az500-secops còn hoạt động
  • Ít nhất 1 incident đã được tạo từ analytics rule Lab 49
  • Quyền Microsoft Sentinel Responder hoặc Contributor
Lưu ý:
  • Đây là lab cuối — tổng hợp toàn bộ AZ-500
  • Workbook lưu trong Sentinel workspace, không tốn thêm chi phí
  • Nếu chưa có incident, tạo thêm delete operation theo hướng dẫn Lab 49
  • Xóa toàn bộ resources sau lab để dừng phát sinh chi phí

🏗️ Kịch Bản

Bạn là SOC Analyst Level 1. Analytics rule từ Lab 49 vừa sinh một incident báo cáo có thao tác delete tài nguyên bất thường. Nhiệm vụ của bạn: nhận incident, triage, điều tra entity liên quan, chạy hunting query để xác nhận hoặc loại trừ tấn công, tạo Workbook để chuẩn bị cho báo cáo tuần, và cuối cùng đóng incident với phán quyết rõ ràng.

🧪 Các Bước Thực Hiện

1

Mở Incident và Thực Hiện Triage

Mở incident từ analytics rule Lab 49, gán owner và cập nhật status để bắt đầu điều tra.

Cách 1 — Portal
  1. 1.1Sentinel → Threat managementIncidents
  2. 1.2Tìm incident "Detect Azure Resource Delete Operations" → click vào để mở
  3. 1.3Click "Assign to me" để gán owner = tài khoản của bạn
  4. 1.4Đổi Status từ NewActive
  5. 1.5Xem tab Entities → xem Account entity (Caller) và Resource Group bị xóa
  6. 1.6Click "View full details" → xem Investigation graph nếu có entities
Cách 2 — Azure CLI
Azure CLI— Xem và cập nhật incident
# Liệt kê incidents trong Sentinel
az sentinel incident list \
  --resource-group rg-az500-sentinel \
  --workspace-name law-az500-secops \
  --query "[].{title:title, severity:severity, status:status, incidentNumber:incidentNumber}" \
  -o table 2>/dev/null || echo "Dùng Portal để xem incidents — az sentinel incident list yêu cầu extension mới nhất"

# Lấy incident ID đầu tiên
INCIDENT_ID=$(az sentinel incident list \
  --resource-group rg-az500-sentinel \
  --workspace-name law-az500-secops \
  --query "[0].name" -o tsv 2>/dev/null)

echo "Incident ID: $INCIDENT_ID"

# Cập nhật status incident sang Active
az sentinel incident update \
  --resource-group rg-az500-sentinel \
  --workspace-name law-az500-secops \
  --incident-id "$INCIDENT_ID" \
  --status Active \
  --owner-object-id "$(az ad signed-in-user show --query id -o tsv)" \
  2>/dev/null || echo "Cập nhật incident qua Portal: Status → Active, Assign to me"
2

Thêm Comment Điều Tra và Xem Evidence

Ghi lại quá trình điều tra qua comments — thực hành quan trọng trong SOC workflow thực tế.

Cách 1 — Portal
  1. 2.1Trong incident → tab Comments+ Add comment
  2. 2.2Nhập: "Đang điều tra — delete operation bởi [Caller]. Kiểm tra xem đây là thao tác có chủ ý (lab cleanup) hay bất thường."
  3. 2.3Tab Alerts → click vào alert → xem Evidence → xem raw event details
  4. 2.4Ghi nhận: TimeGenerated, Caller (email/UPN), OperationNameValue, ResourceGroup, ActivityStatusValue
  5. 2.5Thêm comment thứ hai: "Xác nhận Caller là admin lab. ResourceGroup rg-az500-test-delete được xóa có chủ ý trong quá trình lab."
Cách 2 — Azure CLI
Azure CLI— Thêm comment điều tra
# Thêm comment điều tra vào incident
az sentinel incident comment create \
  --resource-group rg-az500-sentinel \
  --workspace-name law-az500-secops \
  --incident-id "$INCIDENT_ID" \
  --message "Investigating — delete operation by admin lab account. Checking if this was intentional lab cleanup or unauthorized action." \
  2>/dev/null || echo "Thêm comment qua Portal: Incident → Comments → Add comment"

# Xem danh sách comments
az sentinel incident comment list \
  --resource-group rg-az500-sentinel \
  --workspace-name law-az500-secops \
  --incident-id "$INCIDENT_ID" \
  --query "[].{author:author.name, message:message, time:createdTimeUtc}" \
  -o table 2>/dev/null
3

Chạy Hunting Query

Dùng KQL hunting query để tìm thêm context xung quanh incident — xem user đó còn thực hiện những gì khác.

Cách 1 — Portal
  1. 3.1Sentinel → Threat managementHunting → tab Queries
  2. 3.2Tìm built-in hunting queries liên quan đến "Azure Activity"
  3. 3.3Hoặc dùng + New Query → paste KQL mẫu bên dưới
  4. 3.4Click Run Query → xem kết quả
  5. 3.5Nếu có kết quả đáng ngờ → click "Add to incident" để link với incident đang điều tra
KQL— Hunting query Lab 50: Tóm tắt hoạt động nhạy cảm theo user (7 ngày)
AzureActivity
| where TimeGenerated > ago(7d)
| summarize TotalEvents=count() by Caller, OperationNameValue
| order by TotalEvents desc
KQL— Hunting query: Tất cả hoạt động của Caller cụ thể trong 7 ngày
// Thay YOUR_CALLER_EMAIL bằng email từ incident
let SuspectCaller = "YOUR_CALLER_EMAIL";
AzureActivity
| where TimeGenerated > ago(7d)
| where Caller == SuspectCaller
| project TimeGenerated, OperationNameValue, ResourceGroup, ActivityStatusValue, Properties
| order by TimeGenerated desc
Cách 2 — Azure CLI
Azure CLI— Chạy hunting query từ CLI
WORKSPACE_ID=$(az monitor log-analytics workspace show \
  --resource-group rg-az500-sentinel \
  --workspace-name law-az500-secops \
  --query id -o tsv)

# Chạy hunting query: tóm tắt theo user
az monitor log-analytics query \
  --workspace "$WORKSPACE_ID" \
  --analytics-query "AzureActivity | where TimeGenerated > ago(7d) | summarize TotalEvents=count() by Caller, OperationNameValue | order by TotalEvents desc | limit 20" \
  -o table 2>/dev/null || echo "Chạy query trong Sentinel → Logs hoặc Hunting"
4

Tạo Workbook Giám Sát Bảo Mật

Tạo Workbook dashboard hiển thị hoạt động nhạy cảm theo user — công cụ báo cáo cho SOC team.

Cách 1 — Portal
  1. 4.1Sentinel → Threat managementWorkbooks → tab My workbooks+ Add workbook
  2. 4.2Click Edit → xóa widget mặc định → click + AddAdd query
  3. 4.3Paste KQL workbook query bên dưới → Visualization: Bar chart hoặc Grid
  4. 4.4Click Run Query → xem preview → Done Editing
  5. 4.5Click biểu tượng Save → Name: AZ500-SecOps-Dashboard → Save
  6. 4.6Thêm thêm query thứ hai: Failed operations chart → Save lại
KQL— Workbook query Lab 50: Hoạt động nhạy cảm theo user (7 ngày)
AzureActivity
| where TimeGenerated > ago(7d)
| summarize TotalEvents=count() by Caller, OperationNameValue
| order by TotalEvents desc
KQL— Workbook query 2: Số lượng operation theo ngày (trend chart)
AzureActivity
| where TimeGenerated > ago(7d)
| summarize OperationCount = count() by bin(TimeGenerated, 1d), ActivityStatusValue
| order by TimeGenerated asc
KQL— Workbook query 3: Top delete operations
AzureActivity
| where TimeGenerated > ago(7d)
| where OperationNameValue has "delete"
| summarize DeleteCount = count() by Caller, ResourceGroup
| order by DeleteCount desc
| limit 10
5

Đóng Incident Đúng Quy Trình

Sau khi điều tra xong, đóng incident với classification và lý do rõ ràng — bước cuối trong quy trình SOC.

Cách 1 — Portal
  1. 5.1Trong incident → tab Comments → thêm comment cuối: "Điều tra hoàn tất. Xác nhận thao tác delete là hoạt động lab có chủ ý của admin. Không có dấu hiệu tấn công."
  2. 5.2Click ActionsClose incident
  3. 5.3Classification: True Positive (thao tác xóa thật sự xảy ra) → Reason: Benign Positive
  4. 5.4Comment: "Xóa RG lab có chủ ý trong quá trình thực hành Lab 49-50. Rule cần được tune để loại trừ lab admin account."
  5. 5.5Click Close → kiểm tra incident chuyển sang status Closed
Classification Options trong Sentinel:
True Positive: Alert chính xác — sự kiện thật sự xảy ra đúng như rule detect
Benign Positive: Alert đúng nhưng hành động là hợp lệ/có chủ ý (lab cleanup, planned maintenance)
False Positive: Alert sai — rule cần được điều chỉnh
Undetermined: Không đủ thông tin để kết luận
Cách 2 — Azure CLI
Azure CLI— Đóng incident với classification
# Thêm comment cuối trước khi đóng
az sentinel incident comment create \
  --resource-group rg-az500-sentinel \
  --workspace-name law-az500-secops \
  --incident-id "$INCIDENT_ID" \
  --message "Investigation complete. Delete operations confirmed as intentional lab cleanup by admin account. No attack indicators found. Rule should be tuned to exclude lab admin accounts." \
  2>/dev/null

# Đóng incident với classification Benign Positive
az sentinel incident update \
  --resource-group rg-az500-sentinel \
  --workspace-name law-az500-secops \
  --incident-id "$INCIDENT_ID" \
  --status Closed \
  --classification BenignPositive \
  --classification-reason InaccurateData \
  2>/dev/null || echo "Đóng incident qua Portal: Actions → Close incident → Classification → Close"

# Xác nhận incident đã closed
az sentinel incident show \
  --resource-group rg-az500-sentinel \
  --workspace-name law-az500-secops \
  --incident-id "$INCIDENT_ID" \
  --query "{title:title, status:status, classification:classification}" \
  -o table 2>/dev/null

📊 Kết Quả Đầu Ra Lab 50

Incident Triaged

Incident có owner, status = Active, entities mapped

Investigation Documented

Ít nhất 2 comments ghi lại quá trình điều tra

Hunting Query Ran

KQL hunting query trả về activity summary theo user

Workbook Created

AZ500-SecOps-Dashboard với 3 KQL visualizations

Incident Closed

Status = Closed, Classification = BenignPositive, lý do ghi rõ ràng

AZ-500 Labs Hoàn Thành

50/50 labs AZ-500 — từ Entra ID đến Security Operations

🧹 Dọn Dẹp Tài Nguyên — Cuối Khóa

Azure CLI— Dọn dẹp toàn bộ resource groups của Lab 49-50
# Xóa tất cả resource groups của lab 49-50
az group delete --name rg-az500-sentinel --yes --no-wait

# Kiểm tra còn lại resource groups nào từ các labs trước
az group list \
  --query "[?starts_with(name,'rg-az500')].{name:name, location:location}" \
  -o table

# Xóa các RG còn lại nếu cần
# az group delete --name rg-az500-defender --yes --no-wait
# az group delete --name rg-az500-storage-sec --yes --no-wait

echo "Cleanup complete — AZ-500 lab environment removed"

❓ Câu Hỏi Ôn Tập

1. Tại sao phải thêm comment trong quá trình điều tra incident?

Gợi ý: Tạo audit trail cho compliance; chia sẻ context với các analyst khác trong team; ghi lại reasoning để reference khi incident tương tự xảy ra; hỗ trợ post-incident review và lessons learned

2. Sự khác biệt giữa "True Positive — Benign" và "False Positive" trong incident classification?

Gợi ý: Benign Positive: alert kích hoạt đúng vì hoạt động thật sự xảy ra, nhưng là hành động hợp lệ (không phải tấn công); False Positive: alert kích hoạt sai vì rule logic có lỗi, không phản ánh thực tế

3. Workbook trong Sentinel dùng để làm gì? Khác gì với Dashboard trong Azure Monitor?

Gợi ý: Sentinel Workbook: visualization gắn trực tiếp vào Sentinel workspace, dùng KQL, phù hợp cho security reporting; Azure Monitor Dashboard: tổng quát hơn cho operational metrics, không đặc thù security

4. Hunting trong Sentinel khác Analytics Rule ở điểm nào?

Gợi ý: Analytics Rule: chạy tự động theo lịch, tạo incident/alert tự động; Hunting: do analyst chủ động chạy khi điều tra, không tự động — dùng để tìm thêm context hoặc threat mà rule chưa cover

5. Sau lab này bạn có thể làm gì để cải thiện analytics rule để giảm false/benign positives?

Gợi ý: Thêm exclusion list (KQL: where Caller !in ("[email protected]")); Thêm time condition (only outside business hours); Tăng threshold (chỉ alert khi >5 delete operations); Thêm entity behavior context từ UEBA

Chúc mừng hoàn thành 50 Labs AZ-500!

Bạn đã thực hành đủ 4 nhóm kỹ năng AZ-500: Identity & Access, Networking, Compute/Storage/Data, và Security Operations với Defender for Cloud + Microsoft Sentinel.

Lab 49: Sentinel + Analytics Rule Thư viện Labs Capstone Project
Zalo