稽核 Microsoft Sentinel 查詢和活動

本文說明如何檢視在 Microsoft Sentinel 工作區中執行之查詢和活動的稽核資料,例如安全性作業 (SOC) 工作區中的內部和外部合規性需求。

Microsoft Sentinel 可讓您存取:

  • AzureActivity 資料表,其提供有關在 Microsoft Sentinel 中採取之所有動作的詳細資料,例如編輯警示規則。 AzureActivity 資料表不會記錄特定查詢資料。 如需詳細資訊,請參閱使用 Azure 活動記錄進行稽核

  • LAQueryLogs 資料表,其提供有關在 Log Analytics 中執行之查詢的詳細資料,包括從 Microsoft Sentinel 執行的查詢。 如需詳細資訊,請參閱使用 LAQueryLogs 進行稽核

提示

除了本文所述的手動查詢之外,Microsoft Sentinel 還提供內建活頁簿以協助您稽核 SOC 環境中的活動。

在 Microsoft Sentinel [活頁簿] 區域中,搜尋工作區稽核活頁簿。

使用 Azure 活動記錄進行稽核

Microsoft Sentinel 的稽核記錄會保留在 Azure 活動記錄中,其中 AzureActivity 資料表包含在您 Microsoft Sentinel 工作區中採取的所有動作。

當您使用 Microsoft Sentinel 稽核 SOC 環境中的活動時,您可以使用 AzureActivity 資料表。

若要查詢 AzureActivity 資料表

  1. 連接 Azure 活動資料來源,開始將稽核記錄串流到 [記錄] 畫面中名為 AzureActivity 的新資料表。

  2. 然後,使用 KQL 查詢資料,就像任何其他資料表一樣。

    AzureActivity 資料表包含來自許多服務的資料,包括 Microsoft Sentinel。 若要只篩選來自 Microsoft Sentinel 的資料,請使用下列程式碼開始查詢:

     AzureActivity
    | where OperationNameValue startswith "MICROSOFT.SECURITYINSIGHTS"
    

    例如,若要找出誰是最後一位編輯特定分析規則的使用者,請使用下列查詢 (以您想要檢查之規則的規則識別碼取代 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx):

    AzureActivity
    | where OperationNameValue startswith "MICROSOFT.SECURITYINSIGHTS/ALERTRULES/WRITE"
    | where Properties contains "alertRules/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    | project Caller , TimeGenerated , Properties
    

根據您需要報告的內容,將更多參數新增至查詢,以進一步探索 AzureActivities 資料表。 下列各節提供以 AzureActivity 資料表資料稽核時要使用的其他範例查詢。

如需詳細資訊,請參閱 Azure 活動記錄中包含的 Microsoft Sentinel 資料

尋找特定使用者在過去 24 小時內採取的所有動作

下列 AzureActivity 資料表查詢會列出特定 Microsoft Entra 使用者在過去 24 小時內採取的所有動作。

AzureActivity
| where OperationNameValue contains "SecurityInsights"
| where Caller == "[AzureAD username]"
| where TimeGenerated > ago(1d)

尋找所有刪除作業

下列 AzureActivity 資料表查詢會列出在您 Microsoft Sentinel 工作區中執行的所有刪除作業。

AzureActivity
| where OperationNameValue contains "SecurityInsights"
| where OperationName contains "Delete"
| where ActivityStatusValue contains "Succeeded"
| project TimeGenerated, Caller, OperationName

Azure 活動記錄中包含的 Microsoft Sentinel 資料

Microsoft Sentinel 的稽核記錄會保留在 Azure 活動記錄中,並包含下列資訊類型:

作業 資訊類型
已建立 警示規則
案例註解
事件註解
已儲存的搜尋
關注清單
活頁簿
已刪除 警示規則
書籤
資料連接器
事故
已儲存的搜尋
設定
威脅情報報告
關注清單
活頁簿
工作流程
已更新 警示規則
書籤
案例
資料連接器
事故
事件註解
威脅情報報告
活頁簿
工作流程

您也可以使用 Azure 活動記錄來檢查是否有使用者授權 (Authorization) 和授權 (license)。

例如,下表列出在 Azure 活動記錄中找到的選取作業,其中包含從中提取記錄資料的特定資源。

作業名稱 資源類型
建立或更新活頁簿 Microsoft.Insights/workbooks
刪除活頁簿 Microsoft.Insights/workbooks
設定工作流程 Microsoft.Logic/workflows
刪除工作流程 Microsoft.Logic/workflows
建立已儲存的搜尋 Microsoft.OperationalInsights/workspaces/savedSearches
刪除儲存的搜尋 Microsoft.OperationalInsights/workspaces/savedSearches
更新警示規則 Microsoft.SecurityInsights/alertRules
刪除警示規則 Microsoft.SecurityInsights/alertRules
更新警示規則回應動作 Microsoft.SecurityInsights/alertRules/actions
刪除警示規則回應動作 Microsoft.SecurityInsights/alertRules/actions
更新書籤 Microsoft.SecurityInsights/bookmarks
刪除書籤 Microsoft.SecurityInsights/bookmarks
更新案例 Microsoft.SecurityInsights/Cases
更新案例調查 Microsoft.SecurityInsights/Cases/investigations
建立案例註解 Microsoft.SecurityInsights/Cases/comments
更新資料連接器 Microsoft.SecurityInsights/dataConnectors
刪除資料連接器 Microsoft.SecurityInsights/dataConnectors
更新設定 Microsoft.SecurityInsights/settings

如需詳細資訊,請參閱 Azure 活動記錄事件結構描述

使用 LAQueryLogs 進行稽核

LAQueryLogs 資料表提供有關在 Log Analytics 中執行之記錄查詢的詳細資料。 由於使用 Log Analytics 作為 Microsoft Sentinel 的基礎資料存放區,因此您可以設定系統收集 Microsoft Sentinel 工作區中的 LAQueryLogs 資料。

LAQueryLogs 資料包含類似如下的資訊:

  • 何時執行查詢
  • 誰在 Log Analytics 中執行查詢
  • 使用了哪些工具在 Log Analytics 中執行查詢,例如 Microsoft Sentinel
  • 查詢文字本身
  • 每個查詢執行的效能資料

注意

  • LAQueryLogs 資料表只會包含已在 Microsoft Sentinel 的 [記錄] 刀鋒視窗中執行的查詢, 而不會包含排程分析規則執行的查詢 (使用調查圖表或在 Microsoft Sentinel [搜捕] 頁面中)。
  • 從執行查詢到在 LAQueryLogs 資料表中填入資料期間可能會有短暫的延遲。 建議您等候大約 5 分鐘,以查詢 LAQueryLogs 資料表中是否有稽核資料。

若要查詢 LAQueryLogs 資料表

  1. 預設不會在您的 Log Analytics 工作區中啟用 LAQueryLogs 資料表。 若要在 Microsoft Sentinel 中稽核時使用 LAQueryLogs 資料,請先在 Log Analytics 工作區的 [診斷設定] 區域中啟用 [LAQueryLogs]

    如需詳細資訊,請參閱稽核 Azure 監視器記錄中的查詢

  2. 然後,使用 KQL 查詢資料,就像任何其他資料表一樣。

    例如,下列查詢顯示上週執行的查詢數目 (按日列出):

    LAQueryLogs
    | where TimeGenerated > ago(7d)
    | summarize events_count=count() by bin(TimeGenerated, 1d)
    

下列各節顯示使用 Microsoft Sentinel 稽核 SOC 環境中的活動時,要在 LAQueryLogs 資料表上執行更多範例查詢。

回應不是 "OK" 的已執行查詢數目

下列 LAQueryLogs 資料表查詢顯示收到 HTTP 回應 200 OK 以外任何回應的已執行查詢數目。 例如,此數目會包含無法執行的查詢。

LAQueryLogs
| where ResponseCode != 200 
| count 

顯示執行 CPU 密集查詢的使用者

下列 LAQueryLogs 資料表查詢會根據使用的 CPU 和查詢時間長度,列出執行 CPU 最密集查詢的使用者。

LAQueryLogs
|summarize arg_max(StatsCPUTimeMs, *) by AADClientId
| extend User = AADEmail, QueryRunTime = StatsCPUTimeMs
| project User, QueryRunTime, QueryText
| order by QueryRunTime desc

顯示在過去一週內執行最多查詢的使用者

下列 LAQueryLogs 資料表查詢會列出在過去一週內執行最多查詢的使用者。

LAQueryLogs
| where TimeGenerated > ago(7d)
| summarize events_count=count() by AADEmail
| extend UserPrincipalName = AADEmail, Queries = events_count
| join kind= leftouter (
    SigninLogs)
    on UserPrincipalName
| project UserDisplayName, UserPrincipalName, Queries
| summarize arg_max(Queries, *) by UserPrincipalName
| sort by Queries desc

設定 Microsoft Sentinel 活動的警示

您可能想要使用 Microsoft Sentinel 稽核資源來建立主動式警示。

例如,如果您的 Microsoft Sentinel 工作區中有敏感性資料表,請使用下列查詢在每次有人查詢這些資料表時通知您:

LAQueryLogs
| where QueryText contains "[Name of sensitive table]"
| where TimeGenerated > ago(1d)
| extend User = AADEmail, Query = QueryText
| project User, Query

使用活頁簿、規則和劇本監視 Microsoft Sentinel

使用 Microsoft Sentinel 本身的功能來監視 Microsoft Sentinel 中發生的事件和動作。

  • 使用活頁簿進行監視。 已建置下列活頁簿來監視工作區活動:

    • 工作區稽核。 包含環境中哪些使用者正在執行動作、他們已執行哪些動作等相關資訊。
    • 分析效率。 深入解析正在使用哪些分析規則、最常涵蓋哪些 MITRE 策略,以及從規則產生的事件。
    • 安全性作業效率。 提供 SOC 小組效能、已開啟的事件數、已關閉的事件數等計量。 此活頁簿可用來顯示小組效能,並醒目提示可能缺少而需要注意的任何區域。
    • 資料收集狀況監控。 協助監看是否有已停滯或停止的擷取。

    如需詳細資訊,請參閱常用的 Microsoft Sentinel 活頁簿

  • 監看是否有擷取延遲。 如果您擔心擷取延遲,請在分析規則中設定變數來表示延遲。

    例如,下列分析規則可協助確保結果不會包含重複項目,而且在執行規則時不會遺漏記錄:

    let ingestion_delay= 2min;let rule_look_back = 5min;CommonSecurityLog| where TimeGenerated >= ago(ingestion_delay + rule_look_back)| where ingestion_time() > (rule_look_back)
    - Calculating ingestion delay
      CommonSecurityLog| extend delay = ingestion_time() - TimeGenerated| summarize percentiles(delay,95,99) by DeviceVendor, DeviceProduct
    

    如需詳細資訊,請參閱使用自動化規則將 Microsoft Sentinel 中的事件處理自動化

  • 使用連接器健康狀態推播通知解決方案 (英文) 劇本監視資料連接器健康狀態,以監看是否有已停滯或停止的擷取,並在連接器停止收集資料或電腦停止報告時傳送通知。

下一步

在 Microsoft Sentinel 中,使用 [工作區稽核] 活頁簿來稽核 SOC 環境中的活動。

如需詳細資訊,請參閱將資料視覺化並加以監視