🎯 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ị
- Đã hoàn thành Lab 49 — Sentinel + Analytics Rule
- Workspace
law-az500-secopscò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
- Đâ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
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.
- 1.1Sentinel → Threat management → Incidents
- 1.2Tìm incident "Detect Azure Resource Delete Operations" → click vào để mở
- 1.3Click "Assign to me" để gán owner = tài khoản của bạn
- 1.4Đổi Status từ New → Active
- 1.5Xem tab Entities → xem Account entity (Caller) và Resource Group bị xóa
- 1.6Click "View full details" → xem Investigation graph nếu có entities
# 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"
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ế.
- 2.1Trong incident → tab Comments → + Add comment
- 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."
- 2.3Tab Alerts → click vào alert → xem Evidence → xem raw event details
- 2.4Ghi nhận: TimeGenerated, Caller (email/UPN), OperationNameValue, ResourceGroup, ActivityStatusValue
- 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."
# 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
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.
- 3.1Sentinel → Threat management → Hunting → tab Queries
- 3.2Tìm built-in hunting queries liên quan đến "Azure Activity"
- 3.3Hoặc dùng + New Query → paste KQL mẫu bên dưới
- 3.4Click Run Query → xem kết quả
- 3.5Nếu có kết quả đáng ngờ → click "Add to incident" để link với incident đang điều tra
AzureActivity
| where TimeGenerated > ago(7d)
| summarize TotalEvents=count() by Caller, OperationNameValue
| order by TotalEvents desc
// 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
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"
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.
- 4.1Sentinel → Threat management → Workbooks → tab My workbooks → + Add workbook
- 4.2Click Edit → xóa widget mặc định → click + Add → Add query
- 4.3Paste KQL workbook query bên dưới → Visualization: Bar chart hoặc Grid
- 4.4Click Run Query → xem preview → Done Editing
- 4.5Click biểu tượng Save → Name:
AZ500-SecOps-Dashboard→ Save - 4.6Thêm thêm query thứ hai: Failed operations chart → Save lại
AzureActivity
| where TimeGenerated > ago(7d)
| summarize TotalEvents=count() by Caller, OperationNameValue
| order by TotalEvents desc
AzureActivity
| where TimeGenerated > ago(7d)
| summarize OperationCount = count() by bin(TimeGenerated, 1d), ActivityStatusValue
| order by TimeGenerated asc
AzureActivity
| where TimeGenerated > ago(7d)
| where OperationNameValue has "delete"
| summarize DeleteCount = count() by Caller, ResourceGroup
| order by DeleteCount desc
| limit 10
Đó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.
- 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."
- 5.2Click Actions → Close incident
- 5.3Classification: True Positive (thao tác xóa thật sự xảy ra) → Reason: Benign Positive
- 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.5Click Close → kiểm tra incident chuyển sang status Closed
# 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 có owner, status = Active, entities mapped
Ít nhất 2 comments ghi lại quá trình điều tra
KQL hunting query trả về activity summary theo user
AZ500-SecOps-Dashboard với 3 KQL visualizations
Status = Closed, Classification = BenignPositive, lý do ghi rõ ràng
50/50 labs AZ-500 — từ Entra ID đến Security Operations
🧹 Dọn Dẹp Tài Nguyên — Cuối Khóa
# 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.