收集 Microsoft Graph 活動記錄
支援的國家/地區:
Google SecOps
SIEM
這個剖析器會從 Microsoft Graph 活動記錄中擷取欄位,並轉換為統一資料模型 (UDM)。這個函式會初始化 UDM 欄位、剖析酬載、擷取時間戳記、將各種屬性對應至 UDM 欄位、處理 IP 位址和通訊埠,以及根據主體和網路資訊的存在與否,將事件類型分類。
事前準備
請確認您已完成下列事前準備事項:
- Google SecOps 執行個體。
- Microsoft Entra ID 和 Azure 儲存體帳戶的特殊存取權。
設定 Azure 儲存體帳戶
- 在 Azure 控制台中搜尋儲存體帳戶。
- 點選「建立」。
- 指定下列輸入參數的值:
- 「訂閱」:選取訂閱方案。
- 資源群組:選取資源群組。
- 區域:選取區域。
- 效能:選取所需效能等級 (建議選擇標準)。
- 備援:選取所需的備援層級 (建議使用 GRS 或 LRS)。
- 「儲存體帳戶名稱」:輸入新儲存體帳戶的名稱。
- 按一下「Review + create」。
- 查看帳戶總覽,然後按一下「建立」。
- 在「Storage Account Overview」(儲存空間帳戶總覽) 頁面中,選取「Security + networking」(安全性 + 網路) 中的「Access keys」(存取金鑰) 子選單。
- 按一下「key1」或「key2」旁的「顯示」
- 按一下「複製到剪貼簿」即可複製金鑰。
將金鑰儲存於安全的位置,以供日後參考。
在「儲存空間帳戶總覽」頁面中,選取「設定」中的「端點」子選單。
按一下「複製到剪貼簿」,複製 Blob 服務端點網址 (例如 https://
.blob.core.windows.net )。將端點網址儲存在安全的位置,以供日後參考。
設定 Microsoft Graph 活動記錄匯出至儲存體帳戶
- 在 Azure 控制台中搜尋「Entra ID」。
- 依序選取「監控」>「診斷設定」。
- 按一下「+ 新增診斷設定」。
- 為設定提供專屬名稱 (例如 ms-graph-activity)。
- 選取要匯出至 Google SecOps 的「MicrosoftGraphActivityLog」MicrosoftGraphActivityLog類別。
- 在「目的地詳細資料」下方,選取「封存至儲存空間帳戶」。
- 選取訂閱項目,以及您在上一個步驟中建立的儲存空間帳戶。
按一下 [儲存]。
如何設定 Microsoft Graph 活動記錄
- 依序前往「SIEM 設定」>「動態消息」。
- 按一下「新增動態消息」。
- 在下一個頁面中,按一下「設定單一動態饋給」。
- 在「動態饋給名稱」欄位中,輸入動態饋給的名稱,例如「Microsoft Graph Activity Logs」。
- 選取「Microsoft Azure Blob Storage V2」做為「來源類型」。
- 選取「Microsoft Graph Activity Logs」做為「Log type」。
- 點選「下一步」。
指定下列輸入參數的值:
Azure URI:Blob 端點網址。
ENDPOINT_URL/BLOB_NAME更改下列內容:
ENDPOINT_URL:Blob 端點網址 (https://<storageaccountname>.blob.core.windows.net)BLOB_NAME:Blob 的名稱 (例如 insights-logs-)
來源刪除選項:根據偏好設定選取刪除選項。
檔案存在時間上限:在過去幾天內修改的檔案。預設值為 180 天。
共用金鑰:Azure Blob 儲存體的存取金鑰。
點選「下一步」。
在「Finalize」(完成) 畫面中檢查新的動態饋給設定,然後按一下「Submit」(提交)。
支援的 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 監視器 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 欄位會設為「公開用戶端」(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 專業人員尋求答案。