收集 Microsoft Graph 活動記錄

支援的服務:

這個剖析器會從 Microsoft Graph 活動記錄擷取欄位,並轉換為 Unified Data Model (UDM) 格式。這個剖析器會初始化 UDM 欄位、剖析酬載、擷取時間戳記、將各種屬性對應至 UDM 欄位、處理 IP 位址和通訊埠,並根據主體和網路資訊是否存在,將事件類型分類。

事前準備

請確認您符合下列必要條件:

  • Google SecOps 執行個體。
  • Microsoft Entra ID 和 Azure 儲存體帳戶的特殊權限存取權。

設定 Azure 儲存體帳戶

  1. 在 Azure 控制台中搜尋儲存體帳戶。
  2. 點選「建立」。
  3. 指定下列輸入參數的值:
    • Subscription:選取訂閱項目。
    • 資源群組:選取資源群組。
    • Region (區域):選取區域。
    • 效能:選取所需的效能等級 (建議選取標準)。
    • Redundancy:選取所需的備援等級 (建議選取 GRS 或 LRS)。
    • Storage account name:輸入新儲存體帳戶的名稱。
  4. 按一下「Review + create」。
  5. 查看帳戶總覽,然後按一下「建立」。
  6. 在「Storage Account Overview」頁面,依序選取「Security + networking」和「Access keys」子選單。
  7. 按一下「key1」或「key2」旁的「顯示」
  8. 按一下「複製到剪貼簿」,複製金鑰。
  9. 將金鑰儲存在安全的位置,以供日後參考。

  10. 在「Storage Account Overview」頁面中,選取「Settings」中的子選單「Endpoints」。

  11. 按一下「複製到剪貼簿」,複製 Blob 服務端點網址 (例如 https://.blob.core.windows.net)。

  12. 將端點網址儲存在安全的位置,以供日後參考。

設定將 Microsoft Graph 活動記錄匯出至儲存體帳戶

  1. 在 Azure 控制台中搜尋 Entra ID。
  2. 依序選取「Monitoring」>「Diagnostic settings」。
  3. 按一下「+ Add diagnostic setting」。
  4. 為設定指定不重複的名稱 (例如 ms-graph-activity)。
  5. 選取要匯出至 Google SecOps 的 MicrosoftGraphActivityLog 類別。
  6. 在「Destination details」(目的地詳細資料) 下方,選取「Archive to a storage account」(封存至儲存體帳戶)。
  7. 選取訂閱項目和上一步建立的儲存體帳戶。
  8. 按一下「儲存」。

如何設定 Microsoft Graph 活動記錄

  1. 依序前往「設定」>「資料管理」>「動態饋給」。如果使用的是 SIEM 專用平台,請依序前往「設定」>「動態饋給」。
  2. 按一下「新增動態饋給」。
  3. 在下一頁,點按「設定單一動態饋給」。
  4. 在「Feed name」(動態饋給名稱) 欄位中,輸入動態饋給名稱,例如 Microsoft Graph 活動記錄。
  5. 選取「Microsoft Azure Blob Storage V2」做為「來源類型」。
  6. 在「Log type」部分,選取「Microsoft Graph 活動記錄」。
  7. 點選「下一步」。
  8. 指定下列輸入參數的值:

    • Azure URI:Blob 端點網址。

      ENDPOINT_URL/BLOB_NAME

      更改下列內容:

      • ENDPOINT_URL:blob 端點網址 (https://<storageaccountname>.blob.core.windows.net)
      • BLOB_NAME:blob 的名稱 (例如 insights-logs-)
    • 來源刪除選項:根據偏好選取刪除選項。

    • 檔案存在時間上限:過去幾天內修改過的檔案。預設值為 180 天。

    • 共用金鑰:Azure Blob 儲存體的存取金鑰。

  9. 點選「下一步」。

  10. 在「完成」畫面中檢查新的新聞動態消息設定,然後按一下「提交」。

支援的 Microsoft Graph 活動記錄範例

  • 標準 JSON

    {
      "time": "2024-02-24T02:36:04.9540786Z",
      "resourceId": "/TENANTS/00000000-0000-0000-0000-000000000000/PROVIDERS/MICROSOFT.AADIAM",
      "operationName": "Microsoft Graph Activity",
      "operationVersion": "v1.0",
      "category": "MicrosoftGraphActivityLogs",
      "tenantId": "00000000-0000-0000-0000-000000000000",
      "resultSignature": "200",
      "durationMs": 856631,
      "callerIpAddress": "192.0.2.1",
      "correlationId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "Level": 4,
      "location": "South Central US",
      "properties": {
        "timeGenerated": "2024-02-24T02:36:04.9540786Z",
        "location": "South Central US",
        "requestId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
        "operationId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
        "clientRequestId": "ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj",
        "apiVersion": "v1.0",
        "requestMethod": "GET",
        "responseStatusCode": 200,
        "tenantId": "00000000-0000-0000-0000-000000000000",
        "ipAddress": "192.0.2.1",
        "userAgent": "Internal-Service-Scanner",
        "requestUri": "https://graph.microsoft.com/v1.0/subscribedSkus",
        "durationMs": 856631,
        "responseSizeBytes": 11808,
        "signInActivityId": "REDACTED_ACTIVITY_ID",
        "roles": "Organization.Read.All Policy.Read.All User.Read.All",
        "tokenIssuedAt": "2024-02-23T23:48:42Z",
        "appId": "00000000-0000-0000-0000-000000000000",
        "userId": null,
        "servicePrincipalId": "11111111-2222-3333-4444-555555555555",
        "identityProvider": "https://sts.windows.net/00000000-0000-0000-0000-000000000000/",
        "clientAuthMethod": "2"
      }
    }
    
  • Azure Monitor PascalCase 格式

    {
      "TimeGenerated": "2024-06-07T11:52:40.4216173Z",
      "Location": "East US",
      "RequestId": "bbbbbbbb-1111-2222-3333-cccccccccccc",
      "OperationId": "bbbbbbbb-1111-2222-3333-cccccccccccc",
      "ClientRequestId": "dddddddd-4444-5555-6666-eeeeeeeeeeee",
      "ApiVersion": "v1.0",
      "RequestMethod": "GET",
      "ResponseStatusCode": 200,
      "AadTenantId": "00000000-0000-0000-0000-000000000000",
      "IPAddress": "198.51.100.50",
      "UserAgent": "LokiServer/1.2024",
      "RequestUri": "https://graph.microsoft.com/v1.0/users/user@example.com",
      "DurationMs": 1309774,
      "ResponseSizeBytes": 192,
      "SignInActivityId": "REDACTED_ACTIVITY_ID",
      "TokenIssuedAt": "2024-0G-07T11:47:39.0000000Z",
      "AppId": "00000000-0000-0000-0000-000000000000",
      "UserId": "user_id_9999",
      "Scopes": "User.Read User.Read.All",
      "ClientAuthMethod": 2,
      "_ItemId": "unique_item_id_001",
      "Type": "MicrosoftGraphActivityLogs",
      "TenantId": "00000000-0000-0000-0000-000000000000"
    }
    
  • UDI 必填欄位

    {
      "time": "2024-08-14T19:37:39.2484449Z",
      "resourceId": "/TENANTS/00000000-0000-0000-0000-000000000000/PROVIDERS/MICROSOFT.AADIAM",
      "operationName": "Microsoft Graph Activity",
      "resultSignature": "200",
      "callerIpAddress": "203.0.113.10",
      "properties": {
        "__UDI_RequiredFields_TenantId": "00000000-0000-0000-0000-000000000000",
        "__UDI_RequiredFields_UniqueId": "uuid-123456-7890",
        "timeGenerated": "2024-08-14T19:37:39.2484449Z",
        "requestId": "uuid-123456-7890",
        "requestMethod": "GET",
        "responseStatusCode": 200,
        "ipAddress": "203.0.113.10",
        "userAgent": "Security-Audit-Tool",
        "requestUri": "https://graph.microsoft.com/v1.0/auditLogs/directoryAudits",
        "UserPrincipalObjectID": "user_obj_8888",
        "appId": "00000000-0000-0000-0000-000000000000"
      },
      "tenantId": "00000000-0000-0000-0000-000000000000"
    }
    
  • UDI Beta 版格式

    {
      "time": "2024-08-14T18:37:12.8698765Z",
      "operationVersion": "beta",
      "callerIpAddress": "2001:db8::ff00:42:8329",
      "level": "Informational",
      "properties": {
        "__UDI_RequiredFields_TenantId": "00000000-0000-0000-0000-000000000000",
        "apiVersion": "beta",
        "requestMethod": "GET",
        "responseStatusCode": 404,
        "ipAddress": "2001:db8::ff00:42:8329",
        "requestUri": "https://graph.microsoft.com/beta/users/user_id_masked/photos",
        "userId": "user_id_7777",
        "appId": "00000000-0000-0000-0000-000000000000"
      }
    }
    

UDM 對應表

記錄欄位 UDM 對應 邏輯
callerIpAddress principal.asset.ip 原始記錄欄位 callerIpAddress 會複製到 UDM 欄位。
callerIpAddress principal.ip 原始記錄欄位 callerIpAddress 會複製到 UDM 欄位。
category security_result.category_details 原始記錄欄位 category 會複製到 UDM 欄位。
correlationId security_result.detection_fields.value 原始記錄欄位 correlationId 會複製到 UDM 欄位,其中鍵為 correlationId。
Level security_result.detection_fields.value 原始記錄欄位 Level 會轉換為字串,並複製到 UDM 欄位,其中鍵為 Level。
operationName metadata.product_event_type 原始記錄欄位 operationName 會複製到 UDM 欄位。
operationVersion additional.fields.value.string_value 原始記錄欄位 operationVersion 會複製到 UDM 欄位,其中鍵為 operationVersion。
properties.apiVersion metadata.product_version 原始記錄欄位 properties.apiVersion 會複製到 UDM 欄位。
properties.appId target.resource.product_object_id 原始記錄欄位 properties.appId 會複製到 UDM 欄位。
properties.atContent additional.fields.value.string_value 原始記錄欄位 properties.atContent 會複製到 UDM 欄位,其中鍵為 atContent。
properties.clientAuthMethod extensions.auth.auth_details 根據 properties.clientAuthMethod 的值,UDM 欄位會設為「Public Client」(0)、「用戶端 ID/用戶端密鑰」(1) 或「用戶端憑證」(2)。
properties.clientRequestId additional.fields.value.string_value 原始記錄欄位 properties.clientRequestId 會複製到 UDM 欄位,其中鍵為 clientRequestId。
properties.durationMs network.session_duration.seconds 原始記錄欄位 properties.durationMs 會從毫秒轉換為秒,並複製到 UDM 欄位。
properties.identityProvider security_result.detection_fields.value 原始記錄欄位 properties.identityProvider 會複製到 UDM 欄位,其中鍵為 identityProvider。
properties.ipAddress principal.asset.ip 系統會擷取原始記錄欄位 properties.ipAddress 中的 IP 位址,並複製到 UDM 欄位。
properties.ipAddress principal.ip 系統會擷取原始記錄欄位 properties.ipAddress 中的 IP 位址,並複製到 UDM 欄位。
properties.location principal.location.name 原始記錄欄位 properties.location 會複製到 UDM 欄位。
properties.operationId security_result.detection_fields.value 原始記錄欄位 properties.operationId 會複製到 UDM 欄位,其中鍵為 operationId。
properties.requestMethod network.http.method 原始記錄欄位 properties.requestMethod 會複製到 UDM 欄位。
properties.requestId metadata.product_log_id 原始記錄欄位 properties.requestId 會複製到 UDM 欄位。
properties.responseSizeBytes network.received_bytes 原始記錄欄位 properties.responseSizeBytes 會轉換為不帶正負號的整數,並複製到 UDM 欄位。
properties.responseStatusCode network.http.response_code 原始記錄欄位 properties.responseStatusCode 會轉換為整數,並複製到 UDM 欄位。
properties.roles additional.fields.value.string_value 原始記錄欄位 properties.roles 會複製到 UDM 欄位,其中鍵為 roles。
properties.scopes additional.fields.value.string_value 原始記錄欄位 properties.scopes 會複製到 UDM 欄位,其中鍵為 Scopes。
properties.servicePrincipalId principal.user.userid 如果 properties.userId 為空白,原始記錄欄位 properties.servicePrincipalId 會複製到 UDM 欄位。
properties.signInActivityId network.session_id 原始記錄欄位 properties.signInActivityId 會複製到 UDM 欄位。
properties.tenantId metadata.product_deployment_id 原始記錄欄位 properties.tenantId 會複製到 UDM 欄位。
properties.tokenIssuedAt additional.fields.value.string_value 原始記錄欄位 properties.tokenIssuedAt 會複製到 UDM 欄位,其中鍵為 tokenIssuedAt。
properties.userAgent network.http.user_agent 原始記錄欄位 properties.userAgent 會複製到 UDM 欄位。
properties.userId principal.user.userid 原始記錄欄位 properties.userId 會複製到 UDM 欄位。
properties.wids security_result.detection_fields.value 原始記錄欄位 properties.wids 會複製到 UDM 欄位,其中鍵為 wids。
resourceId target.resource.attribute.labels.value 原始記錄欄位 resourceId 會複製到 UDM 欄位,其中鍵為 Resource ID。
resultSignature additional.fields.value.string_value 原始記錄欄位 resultSignature 會複製到 UDM 欄位,其中鍵為 resultSignature。
time metadata.event_timestamp 系統會剖析原始記錄欄位 time,並轉換為時間戳記,然後複製到 UDM 欄位。如果 has_principal 為 true 且 network.http 不為空白,UDM 欄位 event.idm.read_only_udm.metadata.event_type 會設為「NETWORK_HTTP」;如果 has_principal 為 true 且 network.http 為空白,則會設為「STATUS_UPDATE」;否則會設為「GENERIC_EVENT」。UDM 欄位設為「Microsoft Graph」。UDM 欄位設為「Microsoft」。

變更記錄

查看這個剖析器的變更記錄

還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求解答。