在情境感知型分析中使用 Sensitive Data Protection 数据
本文档演示了如何使用 Sensitive Data Protection 和其他日志来源的实体上下文数据,在执行调查时深入了解潜在威胁的影响和范围。
本文档中介绍的用例可检测用户执行恶意文件的情况(MITRE ATT&CK 技术 T1204.002),以及该用户是否还拥有网络上其他位置的敏感数据的访问权限。
此示例要求已在 Google Security Operations 中提取并标准化以下数据:
- 使用网络日志和 EDR 日志的用户活动数据。
- 来自 Google Cloud IAM 分析等数据源的资源关系。
- 敏感数据保护日志,其中包含有关存储数据类型和敏感度的标签。
Google Security Operations 必须能够将原始数据解析为统一数据模型 (UDM) 实体和事件记录。
如需了解如何将敏感数据保护数据提取到 Google Security Operations,请参阅将敏感数据保护数据导出到 Google Security Operations。
Google Cloud IAM 分析数据
此示例中的 Google Cloud IAM 分析日志数据可识别组织中的用户,并捕获每位用户与网络上其他系统的关系。以下是存储为 UDM 实体记录的 IAM 分析日志的代码段。它存储了管理名为 analytics:claim.patients
的 BigQuery 表的用户 mikeross
的相关信息。
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"
敏感数据保护数据
此示例中的敏感数据保护日志数据存储了 BigQuery 表的相关信息。以下是存储为 UDM 实体记录的敏感数据保护日志的代码段。它表示名为 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 代理事件
此示例中的网络代理事件会捕获网络活动。以下代码段显示了存储为 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 用于识别网络事件和 EDR 事件,这些事件会捕获大量数据的下载或与 Excel 应用中的活动相关的某个可执行文件。
- 组 3 用于识别网络事件和 EDR 事件中标识的用户也拥有 BigQuery 表的权限的记录。
- 第 4 组用于识别用户有权访问的 BigQuery 表的敏感数据保护记录。
每组表达式都使用
$table_name
变量或$user
变量来联接与同一用户和数据库表相关的记录。在
outcome
部分中,规则会创建一个$risk_score
变量,并根据表中数据的敏感性设置一个值。在本例中,它会检查数据是否标记了US_SOCIAL_SECURITY_NUMBER
敏感数据保护 infoType。outcome
部分还会设置其他变量,例如$principalHostname
和$entity_resource_name
。这些变量会随检测结果一起返回并存储,这样当您在 Google 安全运营中心中查看检测结果时,还可以将变量值显示为列。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
}
检测简介
如果您针对现有数据测试规则,并且规则识别出定义中指定的活动模式,则会生成检测结果。检测面板会显示测试规则后生成的检测结果。检测面板还会显示导致规则创建检测的事件和实体记录。在此示例中,系统会显示以下记录:
- Google Cloud IAM Analysis UDM 实体
- 敏感数据保护 UDM 实体
- Zscaler Web 代理 UDM 事件
- CrowdStrike Falcon EDR UDM 事件
在检测面板中,选择任何事件或实体记录即可查看详细信息。
检测还会存储规则的 outcome
部分中定义的变量。如需在检测面板中显示变量,请选择列,然后从列菜单中选择一个或多个变量名称。所选列会显示在检测面板中。
后续步骤
如需编写自定义规则,请参阅 YARA-L 2.0 语言概览。
如需创建自定义情境感知分析,请参阅创建情境感知分析
如需使用预定义的威胁分析,请参阅使用 Google Security Operations 精选的检测。
需要更多帮助?向社区成员和 Google SecOps 专业人士寻求解答。