在情境感知分析中使用 Sensitive Data Protection 数据
本文档演示了如何使用 Sensitive Data Protection 中的实体上下文数据和其他日志来源,在执行调查时添加有关潜在威胁的影响和范围的上下文理解。
本文档中描述的用例可检测用户执行恶意文件(MITRE ATT&CK 技术 T1204.002)的行为,以及该用户是否还具有对网络中其他位置的敏感数据的访问权限。
此示例要求已在 Google Security Operations 中注入并归一化以下数据:
- 使用网络和 EDR 日志的用户活动数据。
- 来自 Google Cloud IAM 分析等数据源的资源关系。
- 包含有关所存储数据类型和敏感度的标签的敏感数据保护日志。
Google SecOps 必须能够将原始数据解析为统一数据模型 (UDM) 实体和事件记录。
如需了解如何将 Sensitive Data Protection 数据注入到 Google SecOps,请参阅将 Sensitive Data Protection 数据导出到 Google SecOps。
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 日志数据存储了有关 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 网络代理日志。它捕获了用户下载可执行文件的网络下载事件,其中 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
Sensitive Data Protection infoType 标签。outcome
部分还会设置其他变量,例如$principalHostname
和$entity_resource_name
。这些变量会随检测结果一起返回并存储,以便您在 Google SecOps 中查看检测结果时,还可以将变量值显示为列。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 分析 UDM 实体
- 敏感数据保护 UDM 实体
- Zscaler Web 代理 UDM 事件
- CrowdStrike Falcon EDR UDM 事件
在检测面板中,选择任意事件或实体记录即可查看详细信息。
检测还会存储在规则的 outcome
部分中定义的变量。如需在检测面板中显示变量,请选择列,然后从列菜单中选择一个或多个变量名称。所选列会显示在检测面板中。
后续步骤
如需编写自定义规则,请参阅 YARA-L 2.0 语言概览。
如需创建自定义情境感知分析,请参阅创建情境感知分析
如需使用预定义的威胁分析,请参阅使用 Google SecOps 精选检测。
需要更多帮助?从社区成员和 Google SecOps 专业人士那里获得解答。