共用方式為


稽核 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 資料表查詢會列出過去 24 小時內特定 Microsoft Entra 使用者所採取的所有動作。

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 活動記錄來檢查使用者授權和授權。

例如,下表列出在 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/data連線ors
刪除資料連線器 Microsoft.SecurityInsights/data連線ors
更新設定 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 資料表上 執行的更多範例查詢。

執行回應不是「確定」的查詢數目

下列 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 環境中的活動。

如需詳細資訊,請參閱 視覺化和監視您的資料