收集 Microsoft Azure 资源日志

支持的平台:

本文档介绍了如何使用 Microsoft Azure Blob Storage V2 设置 Google Security Operations Feed 来收集 Microsoft Azure 资源日志。

Azure 资源日志可提供对 Azure 资源中执行的操作的深入了解。这些日志会捕获有关资源操作、状态和效果指标的详细信息。内容因资源类型而异,包括身份验证事件、配置更改、访问尝试和运营指标等数据。

准备工作

确保您满足以下前提条件:

  • Google SecOps 实例
  • Microsoft Azure 门户拥有特权访问权限,并具有以下权限:

    • 创建存储账号
    • 为 Azure 资源配置诊断设置
    • 管理访问密钥

配置 Azure 存储账号

创建存储账号

  1. Azure 门户中,搜索存储账号
  2. 点击 + 创建
  3. 提供以下配置详细信息:

    设置
    订阅 选择您的 Azure 订阅
    资源组 选择现有内容或创建新内容
    存储账号名称 输入唯一名称(例如 azureresourcelogs
    区域 选择区域(例如 East US
    性能 标准(推荐)
    冗余 GRS(地理位置冗余存储)或 LRS(本地冗余存储)
  4. 点击 Review + create(检查 + 创建)。

  5. 查看账号概览,然后点击创建

  6. 等待部署完成。

获取存储账号凭据

  1. 前往您刚刚创建的存储账号
  2. 在左侧导航栏中,选择安全性 + 网络下的访问密钥
  3. 点击显示键
  4. 复制并保存以下内容以供日后使用:

    • 存储账号名称azureresourcelogs
    • 密钥 1密钥 2:共享访问密钥(采用 base-64 编码的 512 位随机字符串)

获取 Blob 服务端点

  1. 在同一存储账号中,从左侧导航栏中选择端点
  2. 复制并保存 Blob 服务端点网址。
    • 示例:https://azureresourcelogs.blob.core.windows.net/

配置 Azure 资源诊断设置

默认情况下,系统不会收集 Azure 资源日志。您必须为每个 Azure 资源创建诊断设置,以便将日志路由到存储账号。

  1. Azure 门户中,导航到要监控的 Azure 资源。
  2. 在左侧导航栏中,选择监控下的诊断设置
  3. 点击 + 添加诊断设置
  4. 提供以下配置详细信息:
    • 诊断设置名称:输入一个描述性名称(例如 export-to-secops)。
    • 日志部分,选择要收集的日志类别。可用类别因资源类型而异。常见类别包括:
      • 管理(适用于活动日志)
      • 安全性(针对活动日志)
      • AuditEvent(适用于 Key Vault)
      • ApplicationGatewayAccessLog(适用于 Application Gateway)
      • ApplicationGatewayFirewallLog(适用于 Application Gateway)
      • NetworkSecurityGroupEvent(适用于网络安全群组)
    • 指标部分(可选)中,选择 AllMetrics 以将平台指标发送到存储账号。
    • 目标详细信息部分中,选中归档到存储账号复选框。
    • 订阅:选择包含您的存储账号的订阅。
    • 存储账号:选择您创建的存储账号(例如 azureresourcelogs)。
  5. 点击保存

配置完成后,日志会自动导出到存储账号中的容器。Azure 会使用 insights-logs-<log-category-name> 的命名模式创建容器。例如:

  • Key Vault 审核日志:insights-logs-auditevent
  • Application Gateway 访问日志:insights-logs-applicationgatewayaccesslog
  • Application Gateway 防火墙日志:insights-logs-applicationgatewayfirewalllog
  • 网络安全组事件:insights-logs-networksecuritygroupevent

在 Google SecOps 中配置 Feed 以注入 Azure 资源日志

  1. 依次前往 SIEM 设置 > Feed
  2. 点击添加新 Feed
  3. 在下一页上,点击配置单个 Feed
  4. Feed 名称字段中,输入 Feed 的名称(例如 Azure Resource Logs - Key Vault)。
  5. 选择 Microsoft Azure Blob Storage V2 作为来源类型
  6. 选择 Microsoft Azure 资源作为日志类型
  7. 点击下一步
  8. 为以下输入参数指定值:

    • Azure URI:输入包含容器路径的 Blob 服务端点网址:
    https://azureresourcelogs.blob.core.windows.net/insights-logs-auditevent/
    
    • 替换以下内容:
      • azureresourcelogs:您的 Azure 存储账号名称。
      • insights-logs-auditevent:存储日志的 Blob 容器名称(因资源类型和日志类别而异)。
    • 来源删除选项:根据您的偏好选择删除选项:

      • 永不:永不删除转移后的任何文件。
      • 删除已转移的文件:在成功转移后删除文件。
      • 删除已转移的文件和空目录:在成功转移后删除文件和空目录。
    • 文件存在时间上限:包含在过去指定天数内修改的文件。默认值为 180 天。

    • 共享密钥:输入您在第 3 步中从存储账号捕获的共享密钥值(访问密钥)。

    • 资产命名空间资产命名空间

    • 注入标签:要应用于此 Feed 中事件的标签。

  9. 点击下一步

  10. 最终确定界面中查看新的 Feed 配置,然后点击提交

配置 Azure 存储防火墙(如果已启用)

如果您的 Azure 存储账号使用防火墙,则必须添加 Google SecOps IP 范围。

  1. Azure 门户中,前往您的存储账号(例如 azureresourcelogs)。
  2. 安全性 + 网络下,选择网络
  3. 防火墙和虚拟网络下,选择从所选虚拟网络和 IP 地址启用
  4. 防火墙部分的地址范围下,点击 + 添加 IP 范围
  5. 以 CIDR 表示法添加每个 Google SecOps IP 范围。

  6. 点击保存

UDM 映射表

日志字段 UDM 映射 逻辑
各种额外的字段*_label 字段 additional.fields 从各种额外的字段*_label 字段合并
authenticationMethod extensions.auth.mechanism 如果 authenticationMethod 为 Password,则设置为 USERNAME_PASSWORD
category、event_type extensions.auth.type 对于 SQLSecurityAuditEvents,设置为 MACHINE;对于特定类别,设置为 SSO;对于其他类别,设置为 AUTHTYPE_UNSPECIFIED
properties.partialipaddress intermediary.ip 如果 properties.partialipaddress 不为空,则使用该值
properties.event_time、stage_time、risk_time、last_update_time、time metadata.collected_timestamp 使用 ISO8601 从 properties.event_time、stage_time、risk_time、last_update_time 或 time(使用后备 grok)转换而来
properties.message、properties.activity、properties.log.stage metadata.description 如果 properties.message 不为空,则取其值;否则取 properties.activity 的值;否则取 properties.log.stage 的值
event_type metadata.event_type 如果 event_type 不为空,则为 event_type 中的值;否则为 GENERIC_EVENT
category, record.category metadata.product_event_type 直接从类别或 record.category 复制的值
properties.event_id, properties.log.auditID metadata.product_log_id 如果 properties.event_id 不为空,则取自该属性;否则,取自 properties.log.auditID
properties.log.apiVersion metadata.product_version 直接从 properties.log.apiVersion 复制的值
协议 network.application_protocol 直接从协议复制的值
properties.log.verb network.dhcp.opcode 直接从 properties.log.verb(大写)复制的值
properties.CsMethod, record.properties.CsMethod network.http.method 直接从 properties.CsMethod 或 record.properties.CsMethod 复制的值
user_agent network.http.parsed_user_agent 从 user_agent 转换
properties.Referer、uri network.http.referral_url 来自属性的值。如果非空,则为 Referer;否则,来自 URI
properties.ScStatus、record.properties.ScStatus、properties.statusCode、record.properties.statusCode、responseStatus.code network.http.response_code 从属性(ScStatus、record.properties.ScStatus、properties.statusCode、record.properties.statusCode 或 responseStatus.code)转换为整数
user_agent network.http.user_agent 直接从 user_agent 复制的值
properties.ScBytes、record.properties.ScBytes、properties.responseLength network.received_bytes 从 properties.ScBytes、record.properties.ScBytes 或 properties.responseLength 转换为 uinteger
properties.CsBytes、record.properties.CsBytes、properties.requestLength network.sent_bytes 从 properties.CsBytes、record.properties.CsBytes 或 properties.requestLength 转换为 uinteger
properties.session_id network.session_id 直接从 properties.session_id 复制的值(已转换为字符串)
properties.tlsVersion network.tls.version 直接从 properties.tlsVersion 复制的值
domain_name_value principal.administrative_domain 直接从 domain_name_value 复制的值
properties.clientAppUsed, target_application principal.application 如果 properties.clientAppUsed 不为空,则取自该属性;否则取自 target_application
prop_device_id principal.asset.asset_id 设置为“设备 ID:”后跟 prop_device_id(如果不为 null)
硬件 principal.asset.hardware 从硬件合并
properties.host_name、properties.CIp、record.properties.CIp、properties.ComputerName、record.properties.ComputerName、properties.CsHost、record.properties.CsHost、properties.server_instance_name、record.properties.server_instance_name、server_name principal.asset.hostname 如果 properties.host_name 不为空,则取自该属性;否则取自 properties.CIp(grok IP)、record.properties.CIp(grok IP)、properties.ComputerName、record.properties.ComputerName、properties.CsHost、record.properties.CsHost、properties.server_instance_name、record.properties.server_instance_name 或 server_name
src_ip、src_ip1、properties.client_ip、record.properties.clientIpAddress、properties.clientIpAddress、callerIpAddress、properties.ipAddress、ip principal.asset.ip 来自 src_ip、src_ip1、properties.client_ip(Grok IP)、record.properties.clientIpAddress、properties.clientIpAddress(Grok IP)、record.properties.clientIpAddress、callerIpAddress(Grok IP)、properties.ipAddress 或 ip 的值
properties.host_name、properties.CsHost、record.properties.CsHost principal.hostname 如果 properties.host_name 不为空,则取自该属性;否则取自 properties.CsHost 或 record.properties.CsHost
src_ip、src_ip1、properties.client_ip、record.properties.clientIpAddress、properties.clientIpAddress、callerIpAddress、properties.ipAddress、ip principal.ip 来自 src_ip、src_ip1、properties.client_ip(Grok IP)、record.properties.clientIpAddress、properties.clientIpAddress(Grok IP)、record.properties.clientIpAddress、callerIpAddress(Grok IP)、properties.ipAddress 或 ip 的值
properties.location.city, provisioning_steps_city principal.location.city 如果 properties.location.city 不为空,则取该值;否则取 provisioning_steps_city
properties.location.countryOrRegion、provisioning_steps_country、location、Region principal.location.country_or_region 如果 properties.location.countryOrRegion 不为空,则取自该属性;否则取自 provisioning_steps_country;否则取自 location;否则取自 Region
properties.location.geoCoordinates.latitude principal.location.region_latitude 直接从 properties.location.geoCoordinates.latitude 复制的值
properties.location.geoCoordinates.longitude principal.location.region_longitude 直接从 properties.location.geoCoordinates.longitude 复制的值
properties.location.state principal.location.state 直接从 properties.location.state 复制的值
prop_os principal.platform 如果 prop_os 与 (?i)Win 匹配,则设置为 WINDOWS;如果与 (?i)Lin 匹配,则设置为 LINUX;如果与 (?i)Mac 匹配,则设置为 MAC
properties.deviceDetail.operatingSystem principal.platform_version 直接从 properties.deviceDetail.operatingSystem 复制的值
src_port principal.port 从 src_port 转换为整数
is_compliant_label、is_managed_label、serice_type_label、serice_credential_label principal.resource.attribute.labels 已合并来自 is_compliant_label、is_managed_label、serice_type_label、serice_credential_label 的数据
properties.sourceSystem.Name principal.resource.name 直接从 properties.sourceSystem.Name 复制的值
properties.sourceSystem.Id principal.resource.product_object_id 直接从 properties.sourceSystem.Id 复制的值
properties.server_principal_name、source_user_principal_name、user_principal_name、local_account_username_value principal.user.email_addresses 合并自 properties.server_principal_name(如果与电子邮件地址匹配)、source_user_principal_name(如果与电子邮件地址匹配)、user_principal_name(如果与电子邮件地址匹配)或 local_account_username_value(如果与电子邮件地址匹配)
properties.sequence_group_id, grpname, properties.log.user.groups principal.user.group_identifiers 从 properties.sequence_group_id、grpname 或 properties.log.user.groups 合并
properties.sourceIdentity.details.id、properties.userId、details_id_not_present principal.user.product_object_id 如果 properties.sourceIdentity.details.id 不为空,则返回该值;否则,返回 properties.userId;否则,返回 details_id_not_present
properties.ServicePrincipalDisplayName、properties.servicePrincipalName、properties.sourceIdentity.details.DisplayName、properties.userDisplayName、record.properties.log.user.username principal.user.user_display_name 如果 properties.ServicePrincipalDisplayName 不为空,则取自该属性;否则,取自 properties.servicePrincipalName;否则,取自 properties.sourceIdentity.details.DisplayName;否则,取自 properties.userDisplayName;否则,取自 record.properties.log.user.username
properties.servicePrincipalId、user_userPrincipalName、source_user_principal_name、details_user_principal_name、user_principal_name、properties.accountName、record.properties.log.user.uid principal.user.userid 如果 properties.servicePrincipalId 不为空,则取该值;否则,取 user_userPrincipalName 的值;否则,取 source_user_principal_name 的值;否则,取 details_user_principal_name 的值;否则,取 user_principal_name 的值;否则,取 properties.accountName 的值;否则,取 record.properties.log.user.uid 的值
security_action、succeeded、statusText、resultType security_result.action 如果 security_action 为 allow,则设置为 ALLOW;否则,如果 succeeded 为 true 或 statusText 为 Success 或 resultType 为 success,则设置为 ALLOW;否则,如果 succeeded 为 false 或 statusText 为 failed 或 resultType 为 failed,则设置为 BLOCK
properties.action_name security_result.action_details 直接从 properties.action_name 复制的值
status_label security_result.about.resource.attribute.labels 已从 status_label 合并
properties_log_label、corr_key_label、resultType_label、resultSignature_label、networkName_label、networkType_label、method_label、authentication_step_requirement_label、authentication_step_result_detail_label、stepdate_label、initiatedby_name_label、initiatedby_id_label、initiatedby_type_label、targetSystem_id_label、targetSystem_name_label、containerID_label、pod_label、authentication_label、api_name_label、scale_unit_label、namespace_name_label、subscription_id_label、activity_id_label_1、task_name_label、environment_label、cookie、additional_field_event_ip、additional_field_event_primary_stamp、additional_field_event_stamp_type、source、correlationId_field、activityDateTime_field、detectedDateTime_field、lastUpdatedDateTime_field、count_label、total_label、minimum_label、maximum_label、average_label、metricName_label、timeGrain_label、ApiName_label、Authentication_label、GeoType_label、old_label、new_label、add_label、keyId_label、sr_result.rule_name、sr_result.rule_id、resultField、sr_result.detection_fields security_result.detection_fields 合并自 properties_log_label、corr_key_label、resultType_label、resultSignature_label、networkName_label、networkType_label、method_label、authentication_step_requirement_label、authentication_step_result_detail_label、stepdate_label、initiatedby_name_label、initiatedby_id_label、initiatedby_type_label、targetSystem_id_label、targetSystem_name_label、containerID_label、pod_label、authentication_label、api_name_label、scale_unit_label、namespace_name_label、subscription_id_label、activity_id_label_1、task_name_label、environment_label、cookie、additional_field_event_ip、additional_field_event_primary_stamp、additional_field_event_stamp_type、source、correlationId_field、activityDateTime_field、detectedDateTime_field、lastUpdatedDateTime_field、count_label、total_label、minimum_label、maximum_label、average_label、metricName_label、timeGrain_label、ApiName_label、Authentication_label、GeoType_label、old_label、new_label、add_label、keyId_label、sr_result.rule_name、sr_result.rule_id、resultField、sr_result.detection_fields
resultDescription、sec_result.description、properties.queryexecutionstatus security_result.description 来自 resultDescription(替换换行符)的值;否则来自 sec_result.description;否则来自 properties.queryexecutionstatus
policy_id_value security_result.rule_id 直接从 policy_id_value 复制的值
properties.Result、statusText、properties.queryexecutionstatus security_result.summary 来自属性的值。如果不为空,则为结果;否则,来自 statusText;否则,来自属性的 queryexecutionstatus
target_application target.application 来自 target_application 的值
properties.ComputerName、record.properties.ComputerName、properties.server_instance_name、record.properties.server_instance_name target.asset.hostname 来自 properties.ComputerName、record.properties.ComputerName、properties.server_instance_name 或 record.properties.server_instance_name 的值
(硬编码) target.cloud.environment 设置为“MICROSOFT_AZURE”
properties.SPort、record.properties.SPort target.port 从属性 properties.SPort 或 record.properties.SPort 转换为整数
properties.querytext.query target.process.command_line 直接从 properties.querytext.query 复制的值
properties.processId target.process.pid 从 properties.processId 转换为字符串
subscription_id_label、resource_group_label、request_resource_type_label、request_resource_id_label、additional_objectKey、additional_clientRequestId、additional_RiskEventType、additional_tokenIssuerType、keyId_label、appid_label target.resource.attribute.labels 合并自 subscription_id_label、resource_group_label、request_resource_type_label、request_resource_id_label、additional_objectKey、additional_clientRequestId、additional_RiskEventType、additional_tokenIssuerType、keyId_label、appid_label
properties_databasename、properties.resourceDisplayName、record.properties.databasename、record.properties.databaseName target.resource.name 如果 properties_databasename 不为空,则取自该属性;否则,取自 properties.resourceDisplayName;否则,取自 record.properties.databasename;否则,取自 record.properties.databaseName
resourceId、properties.resourceId target.resource.product_object_id 如果 resourceId 不为空,则为来自 resourceId 的值;否则为来自 properties.resourceId 的值
properties_collectionname, properties.resourceDisplayName, record.properties.collectionname, record.properties.collectionName, properties.log.objectRef.resource target.resource.resource_subtype 如果 properties_collectionname 不为空,则取自该属性;否则,取自 properties.resourceDisplayName;否则,取自 record.properties.collectionname;否则,取自 record.properties.collectionName;否则,取自 properties.log.objectRef.resource
resourceId、message target.resource.resource_type 如果 resourceId 与模式匹配,则设置为 DATABASE;否则,如果消息与 MANAGEDCLUSTERS 匹配,则设置为 CLUSTER;否则,如果消息与 MANAGEDINSTANCES 匹配,则设置为 VIRTUAL_MACHINE;否则,如果消息与 DATABASEACCOUNTS 匹配,则设置为 DATABASE
resourceType target.resource.type 直接从 resourceType 复制的值
properties.CsUriStem、properties.log.requestURI、value(来自 additionalInfo) target.url 如果 properties.CsUriStem 不为空,则返回该值;否则,返回 properties.log.requestURI;否则,返回值(来自 additionalInfo)
user_principal_name target.user.email_addresses 从 user_principal_name 合并(如果匹配电子邮件地址)
properties.userId target.user.product_object_id 直接从 properties.userId 复制的值
properties.userDisplayName target.user.user_display_name 直接从 properties.userDisplayName 复制的值
user_principal_name, properties.userPrincipalName target.user.userid 如果 user_principal_name 不为空,则返回该值;否则,返回 properties.userPrincipalName 中的值
(硬编码) metadata.product_name 设置为“Azure 资源日志”
(硬编码) metadata.vendor_name 设置为“Microsoft”

需要更多帮助?获得社区成员和 Google SecOps 专业人士的解答。