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

支持以下语言:

本文档演示了如何使用来自以下来源的实体上下文数据: 敏感数据保护和其他日志源 以便更具体地了解相关影响和 潜在威胁的范围。

本文档中介绍的用例可检测 文件(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 Analysis 数据

此示例中的 Google Cloud IAM Analysis 日志数据可识别 并捕获每个用户与 Google Cloud 上其他系统的关系 。以下是存储为 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 数据

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

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 网络代理日志。它可以捕获 可执行文件的网络下载事件,其 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 组识别导致 捕获下载的大量数据或 活动。
    • 组 3 用于识别网络事件和 EDR 事件中标识的用户也拥有 BigQuery 表的权限的记录。
    • 第 4 组用于识别用户有权访问的 BigQuery 表的敏感数据保护记录。

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

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

    outcome 部分还会设置其他变量,例如 $principalHostname$entity_resource_name。这些变量会随检测结果一起返回并存储,这样当您在 Google 安全运营中心中查看检测结果时,还可以将变量值显示为列。

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

  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
}

检测简介

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

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

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

检测还会存储 outcome 中定义的变量 部分。如需在 Detection 面板中显示变量,请选择 ,然后从 菜单。所选列会显示在检测面板中。

后续步骤

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

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

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