在情境感知分析中使用敏感数据保护数据

本文档演示了如何使用来自敏感数据保护和其他日志源的实体上下文数据,在执行调查时添加背景信息来了解潜在威胁的影响和范围。

本文档中介绍的用例可以检测用户执行恶意文件(MITRE ATT&CK 技术 T1204.002)以及用户是否有权访问网络上其他位置的敏感数据。

此示例要求已在 Google Security Operations 中提取并规范化以下数据:

  • 使用网络和 EDR 日志的用户活动数据。
  • 来自 Google Cloud IAM Analysis 等数据源的资源关系。
  • 包含有关所存储数据的类型和敏感度标签的 Sensitive Data Protection 日志。

Google Security Operations 必须能够将原始数据解析为统一数据模型 (UDM) 实体和事件记录。

如需了解如何将 Sensitive Data Protection 数据注入 Google Security Operations,请参阅将 Sensitive Data Protection 数据导出到 Google Security Operations

Google Cloud IAM 分析数据

此示例中的 Google Cloud IAM 分析日志数据可识别组织中的用户,并捕获每个用户与网络上其他系统的关系。以下是存储为 UDM 实体记录的 IAM 分析日志的代码段。它会存储用户 mikeross 的相关信息,该用户负责管理名为 analytics:claim.patients 的 BigQuery 表。

metadata.vendor_name: "Google Cloud Platform"
metadata.product_name: "GCP IAM Analysis"
metadata.entity_type: "USER"
entity.user.userid: "mikeross"
relations[2].entity.resource.name: "analytics:claim.patients"
relations[2].entity.resource.resource_type: "TABLE"
relations[2].entity_type: "RESOURCE"
relations[2].relationship: "ADMINISTERS"

Sensitive Data Protection 数据

此示例中的 Sensitive Data Protection 日志数据用于存储有关 BigQuery 表的信息。以下是作为 UDM 实体记录存储的 Sensitive Data Protection 日志的代码段。它代表名为 analytics:claim.patients 的 BigQuery 表,其 Predicted InfoType 标签为 US_SOCIAL_SECURITY_NUMBER,表示该表存储了美国社会保障号。

metadata.vendor_name: "Google Cloud Platform"
metadata.product_name: "GCP DLP CONTEXT"
metadata.entity_type: "RESOURCE"
metadata.description: "RISK_HIGH"
entity.resource.resource_type: "TABLE"
entity.resource.resource_subtype: "BigQuery Table"
entity.resource.attribute.cloud.environment"GOOGLE_CLOUD_PLATFORM"
entity.resource.attribute.labels[0].key: "Sensitivity Score"
entity.resource.attribute.labels[0].value: "SENSITIVITY_HIGH"
entity.resource.attribute.labels[1].key: "Predicted InfoType"
entity.resource.attribute.labels[1].value: "US_SOCIAL_SECURITY_NUMBER"
entity.resource.product_object_id: "analytics:claim.patients"

Web 代理事件

此示例中的 Web 代理事件会捕获网络活动。以下代码段是一个以 UDM 事件记录形式存储的 Zscaler Web 代理日志。它会捕获用户执行的可执行文件的网络下载事件,其 userid 值为 mikeross,其中 received_bytes 值为 514605。

metadata.log_type = "ZSCALER_WEBPROXY"
metadata.product_name = "NSS"
metadata.vendor_name = "Zscaler"
metadata.event_type = "NETWORK_HTTP"
network.http.response_code = 200
network.received_bytes = 514605
principal.user.userid = "mikeross"
target.url = "http://manygoodnews.com/dow/Client%20Update.exe"

EDR 活动

此示例中的 EDR 事件捕获端点设备上的活动。以下代码段是一个以 UDM 事件记录形式存储的 CrowdStrike Falcon EDR 日志。它会捕获涉及 Microsoft Excel 应用和用户且 userid 值为 mikeross 的网络事件。

metadata.log_type = "CS_EDR"
metadata.product_name = "Falcon"
metadata.vendor_name = "Crowdstrike"
metadata.event_type = "NETWORK_HTTP"
target.process.file.full_path = "\\Device\\HarddiskVolume1\\Program Files\\C:\\Program Files\\Microsoft Office\\Office16\\EXCEL.exe"
target.url = "http://manygoodnews.com/dow/Client%20Update.exe"
target.user.userid = "mikeross"

请注意,这些记录中存在通用信息,包括用户标识符 mikeross 和表名称 analytics:claim.patients。本文档的下一部分将演示如何在规则中使用这些值来联接记录。

此示例中的检测引擎规则

此示例规则可检测用户对恶意文件的执行情况(MITRE ATT&CK 技术 T1204.002)。

如果用户还有权访问网络上其他位置的敏感数据,该规则会为检测分配较高的风险得分。该规则将以下信息相关联:

  • 用户活动,例如下载或启动可执行文件。
  • 资源之间的关系,例如用户与 BigQuery 表的关系。
  • 用户有权访问的资源中存在敏感信息,例如 BigQuery 表中存储的数据类型。

以下是对示例规则中各个部分的说明。

  • events 部分指定规则查找的数据格式,其中包含以下内容:

    • 第 1 组和第 2 组标识的是捕获大量数据的下载或与 Excel 应用中的活动相关的可执行文件的网络和 EDR 事件。
    • 第 3 组标识网络中标识的用户还有权访问 BigQuery 表的记录。
    • 第 4 组标识用户有权访问的 BigQuery 表的 Sensitive Data Protection 记录。

    每组表达式使用 $table_name 变量或 $user 变量联接与同一用户和数据库表相关的记录。

  • outcome 部分中,该规则会创建一个 $risk_score 变量,并根据表中数据的敏感度设置一个值。在本例中,它会检查数据是否带有 US_SOCIAL_SECURITY_NUMBER 敏感数据保护 infoType 标签。

    outcome 部分还会设置其他变量,例如 $principalHostname$entity_resource_name。这些变量随检测一起返回和存储,因此在 Google Security Operations 中查看时,您还可以将变量值显示为列。

  • condition 部分表示该模式查找 events 部分指定的所有 UDM 记录。

  rule high_risk_user_download_executable_from_macro {
 meta:
   author = "Google Cloud Security Demos"
   description = "Executable downloaded by Microsoft Excel from High Risk User"
   severity = "High"
   technique = "T1204.002"

 events:
   //Group 1. identify a proxy event with suspected executable download
   $proxy_event.principal.user.userid = $user
   $proxy_event.target.url =  /.*\.exe$/ or
   $proxy_event.network.received_bytes > 102400

   //Group 2. correlate with an EDR event indicating Excel activity
   $edr_event.target.user.userid  = $user
   $edr_event.target.process.file.full_path = /excel/ nocase
   $edr_event.metadata.event_type = "NETWORK_HTTP"

   //Group 3. Use the entity to find the permissions
   $user_entity.graph.entity.user.userid = $user
   $user_entity.graph.relations.entity.resource.name = $table_name

   //Group 4. the entity is from Cloud DLP data
   $table_context.graph.entity.resource.product_object_id = $table_name
   $table_context.graph.metadata.product_name = "GCP DLP CONTEXT"

 match:
    $user over 5m

 outcome:
   //calculate risk score
   $risk_score = max(
       if( $table_context.graph.entity.resource.attribute.labels.value = "US_SOCIAL_SECURITY_NUMBER", 80)
       )
   $technique = array_distinct("T1204.002")
   $principalHostname = array_distinct($proxy_event.principal.hostname)
   $principalIp = array_distinct($proxy_event.principal.ip)
   $principalMac = array_distinct($proxy_event.principal.mac)
   $targetHostname = array_distinct($proxy_event.target.hostname)
   $target_url = array_distinct($proxy_event.target.url)
   $targetIp = array_distinct($proxy_event.target.ip)
   $principalUserUserid =  array_distinct($proxy_event.principal.user.userid)
   $entity_resource_name = array_distinct($table_context.graph.entity.resource.name)

condition:
   $proxy_event and $edr_event and $user_entity and $table_context
}

检测简介

如果您针对现有数据测试规则,并且它识别出定义中指定的活动模式,则会生成检测。Detection 面板显示测试规则后生成的检测结果。Detection 面板还会显示导致规则创建检测的事件和实体记录。此示例会显示以下记录:

  • Google Cloud IAM 分析 UDM 实体
  • Sensitive Data Protection UDM 实体
  • Zscaler 网络代理 UDM 事件
  • CrowdStrike Falcon EDR UDM 活动

检测面板中,选择任意事件或实体记录以查看详细信息。

检测还会存储规则的 outcome 部分中定义的变量。如需在检测面板中显示变量,请选择,然后从菜单中选择一个或多个变量名称。所选列会显示在检测面板中。

后续步骤

如需编写自定义规则,请参阅 YARA-L 2.0 语言概览

如需创建自定义情境感知分析,请参阅创建情境感知分析

如需使用预定义的威胁分析,请参阅使用 Google Security Operations 精选检测