收集 Microsoft Graph 活动日志
支持的平台:
Google SecOps
SIEM
此解析器可从 Microsoft Graph 活动日志中提取字段,并将其转换为统一数据模型 (UDM)。它会初始化 UDM 字段、解析载荷、提取时间戳、将各种属性映射到 UDM 字段、处理 IP 地址和端口,并根据正文信息和网络信息的存在情况对事件类型进行分类。
准备工作
确保您满足以下前提条件:
- Google SecOps 实例。
- 对 Microsoft Entra ID 和 Azure 存储账号的特权访问权限。
配置 Azure 存储账号
- 在 Azure 控制台中,搜索存储账号。
- 点击创建。
- 为以下输入参数指定值:
- 订阅:选择相应订阅。
- 资源组:选择资源组。
- 区域:选择相应区域。
- 性能:选择所需的性能级别(建议选择标准)。
- 冗余:选择所需的冗余级别(建议使用 GRS 或 LRS)。
- 存储账号名称:输入新存储账号的名称。
- 点击 Review + create(检查 + 创建)。
- 查看账号概览,然后点击创建。
- 在存储账号概览页面上,从安全性 + 网络中选择子菜单访问密钥。
- 点击 key1 或 key2 旁边的显示
- 点击复制到剪贴板以复制密钥。
将密钥保存在安全的位置,以备日后参考。
在存储账号概览页面中,选择设置中的子菜单终结点。
点击复制到剪贴板,复制 Blob 服务端点网址(例如 https://
.blob.core.windows.net )。将端点网址保存在安全的位置,以供日后参考。
将 Microsoft Graph 活动日志导出到存储账号
- 在 Azure 控制台中,搜索 Entra ID。
- 依次选择监控 > 诊断设置。
- 点击 + 添加诊断设置。
- 为设置指定一个唯一名称(例如 ms-graph-activity)。
- 选择要导出到 Google SecOps 的 MicrosoftGraphActivityLog 类别。
- 在目标位置详细信息下,选择归档到存储账号。
- 选择您的订阅和您在上一步中创建的存储账号。
点击保存。
如何设置 Microsoft Graph 活动日志
- 依次前往 SIEM 设置 > Feed。
- 点击添加新 Feed。
- 在下一页上,点击配置单个 Feed。
- 在 Feed 名称字段中,输入 Feed 的名称,例如 Microsoft Graph 活动日志。
- 选择 Microsoft Azure Blob Storage V2 作为来源类型。
- 选择 Microsoft Graph 活动日志作为日志类型。
- 点击下一步。
为以下输入参数指定值:
Azure URI:Blob 端点网址。
ENDPOINT_URL/BLOB_NAME替换以下内容:
ENDPOINT_URL:Blob 端点网址 (https://<storageaccountname>.blob.core.windows.net)BLOB_NAME:Blob 的名称(例如 insights-logs-)
源删除选项:根据您的偏好选择删除选项。
文件存在时间上限:在过去指定天数内修改的文件。默认值为 180 天。
共享密钥:Azure Blob Storage 的访问密钥。
点击下一步。
在最终确定界面中查看新的 Feed 配置,然后点击提交。
受支持的 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 字段会设置为“公共客户端”(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 专业人士的解答。