收集 Security Command Center 观测日志

支持的语言:

本文档介绍了如何使用 Cloud Storage 将 Security Command Center 观测日志导出并注入到 Google Security Operations 中。解析器会将原始 JSON 数据转换为统一数据模型 (UDM)。它会规范化数据结构,处理输入中可能存在的差异,然后提取相关字段并将其映射到 UDM 架构,通过添加更多上下文和标志来丰富数据,以便进行下游分析。

准备工作

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

  • Security Command Center 已在您的 Google Cloud 环境中启用和配置。
  • Google SecOps 实例。
  • 对 Security Command Center 和 Cloud Logging 的特权访问权限。

创建 Cloud Storage 存储桶

  1. 登录 Google Cloud 控制台
  2. 前往 Cloud Storage 存储分区页面。

    进入“存储桶”

  3. 点击创建

  4. 创建存储桶页面上,输入您的存储桶信息。完成以下每一步后,点击继续以继续执行后续步骤:

    1. 开始使用部分中,执行以下操作:

      1. 输入符合存储桶名称要求的唯一名称,例如 gcp-scc-observation-logs
      2. 如需启用分层命名空间,请点击展开箭头以展开优化文件导向型和数据密集型工作负载部分,然后选择在此存储桶上启用分层命名空间

      3. 如需添加存储桶标签,请点击展开箭头以展开标签部分。

      4. 点击添加标签,然后为标签指定键和值。

    2. 选择数据存储位置部分中,执行以下操作:

      1. 选择位置类型
      2. 使用位置类型菜单选择一个位置,用于永久存储存储桶中的对象数据。

      3. 如需设置跨存储桶复制,请展开设置跨存储桶复制部分。

    3. 为数据选择一个存储类别部分中,为存储桶选择默认存储类别,或者选择 Autoclass 对存储桶数据进行自动存储类别管理。

    4. 选择如何控制对对象的访问权限部分中,选择强制执行禁止公开访问,然后为存储桶对象选择访问权限控制模型

    5. 选择如何保护对象数据部分中,执行以下操作:

      1. 数据保护下,选择您要为存储桶设置的任何选项。
      2. 如需选择对象数据的加密方式,请点击标有数据加密的展开箭头,然后选择数据加密方法
  5. 点击创建

配置 Security Command Center 日志记录

  1. 登录 Google Cloud 控制台
  2. 前往 Security Command Center 页面。

    进入 Security Command Center

  3. 选择您的组织。

  4. 点击设置

  5. 点击连续导出标签页。

  6. 导出名称下,点击 Logging 导出

  7. 接收器下,开启将发现结果记录到 Logging

  8. 记录项目下,输入或搜索要在其中记录发现结果的项目。

  9. 点击保存

配置 Security Command Center 观测日志导出

  1. 登录 Google Cloud 控制台
  2. 前往日志记录 > 日志路由器
  3. 点击创建接收器
  4. 提供以下配置参数:

    • 接收器名称:输入一个有意义的名称,例如 scc-observation-logs-sink
    • 接收器目标位置:选择 Cloud Storage 存储空间,然后输入存储桶的 URI,例如 gs://gcp-scc-observation-logs
    • 日志过滤条件

      logName="projects/<your-project-id>/logs/cloudsecurityscanner.googleapis.com%2Fobservations"
      resource.type="security_command_center_observation"
      logName="projects/<your-project-id>/logs/cloudsecurityscanner.googleapis.com%2Ffindings"
       resource.type="security_center_findings"
      
    • 设置导出选项:包含所有日志条目。

  5. 点击创建

配置 Cloud Storage 权限

  1. 前往 IAM 和管理> IAM
  2. 找到 Cloud Logging 服务账号。
  3. 授予对相应存储桶的 roles/storage.admin

设置 Feed

您可以通过两种不同的入口点在 Google SecOps 平台中设置 Feed:

  • SIEM 设置 > Feed
  • 内容中心 > 内容包

通过“SIEM 设置”>“Feed”设置 Feed

如需配置 Feed,请按以下步骤操作:

  1. 依次前往 SIEM 设置 > Feed
  2. 点击添加新 Feed
  3. 在下一页上,点击配置单个 Feed
  4. Feed 名称字段中,输入 Feed 的名称;例如,Security Command Center 观测日志
  5. 选择 Google Cloud Storage 作为来源类型
  6. 选择 Security Command Center 观测作为日志类型
  7. 点击Chronicle 服务账号字段旁边的获取服务账号
  8. 点击下一步
  9. 为以下输入参数指定值:

    • 存储分区 URI:Cloud Storage 存储桶网址;例如 gs://gcp-scc-observation-logs
    • URI Is A:选择目录(包括子目录)
    • 来源删除选项:根据您的偏好设置选择删除选项。

  10. 点击下一步

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

设置来自内容中心的 Feed

为以下字段指定值:

  • 存储分区 URI:Cloud Storage 存储桶网址;例如 gs://gcp-scc-observation-logs
  • URI Is A:选择目录(包括子目录)
  • 来源删除选项:根据您的偏好设置选择删除选项。

高级选项

  • Feed 名称:用于标识 Feed 的预填充值。
  • 来源类型:用于将日志收集到 Google SecOps 中的方法。
  • 资源命名空间:与 Feed 关联的命名空间。
  • 提取标签:应用于相应 Feed 中所有事件的标签。

UDM 映射表

日志字段 UDM 映射 逻辑
access.callerIp read_only_udm.principal.ip 直接映射。
access.callerIpGeo.regionCode read_only_udm.principal.location.country_or_region 直接映射。
access.methodName read_only_udm.additional.fields.value.string_value 直接映射。还映射到 read_only_udm.target.labels.value。
access.principalEmail read_only_udm.principal.user.email_addresses 直接映射。
access.principalSubject read_only_udm.principal.user.attribute.labels.value 直接映射。
assetDisplayName read_only_udm.target.resource.attribute.labels.value 直接映射。
assetId read_only_udm.target.asset.asset_id assets/ 之后的值从 assetId 字段中提取并映射为 AssetID:<extracted_value>
类别 read_only_udm.metadata.product_event_type 直接映射。
contacts.security.contacts.email read_only_udm.security_result.about.user.email_addresses 直接映射。about 对象可以根据联系人的数量重复多次。对于此字段,roles.name 字段设置为 Security
contacts.technical.contacts.email read_only_udm.security_result.about.user.email_addresses 直接映射。about 对象可以根据联系人的数量重复多次。对于此字段,roles.name 字段设置为 Technical
createTime read_only_udm.security_result.detection_fields.value 直接映射。detection_fields 对象可以根据可用字段重复多次。对于此字段,key 字段设置为 createTime
eventTime read_only_udm.metadata.event_timestamp 已转换为时间戳格式。
externalUri read_only_udm.about.url 直接映射。
findingClass read_only_udm.security_result.category_details 直接映射。
findingProviderId read_only_udm.target.resource.attribute.labels.value 直接映射。
mitreAttack.primaryTactic read_only_udm.security_result.detection_fields.value 直接映射。detection_fields 对象可以根据可用字段重复多次。对于此字段,key 字段设置为 primary_tactic
mitreAttack.primaryTechniques read_only_udm.security_result.detection_fields.value 直接映射。detection_fields 对象可以根据技术数量重复多次。对于此字段,key 字段设置为 primary_technique
mute read_only_udm.security_result.detection_fields.value 直接映射。detection_fields 对象可以根据可用字段重复多次。对于此字段,key 字段设置为 mute
name read_only_udm.metadata.product_log_id 直接映射。
parentDisplayName read_only_udm.metadata.description 直接映射。
resource.display_name read_only_udm.target.resource.attribute.labels.value 直接映射。
resource.name read_only_udm.target.resource.name, read_only_udm.principal.resource.name 直接映射。当此字段用于填充 principal.resource.name 字段时,解析器将检查 resource.project_name 是否为空。如果该参数不为空,则系统会改用 resource.project_name
resource.parent_display_name read_only_udm.target.resource.attribute.labels.value 直接映射。
resource.parent_name read_only_udm.target.resource.attribute.labels.value 直接映射。
resource.project_display_name read_only_udm.target.resource.attribute.labels.value 直接映射。
resource.project_name read_only_udm.target.resource.attribute.labels.value 直接映射。
resource.type read_only_udm.target.resource.attribute.labels.value 直接映射。
resourceName read_only_udm.target.resource.name 直接映射。
securityMarks.name read_only_udm.security_result.detection_fields.value 直接映射。detection_fields 对象可以根据可用字段重复多次。对于此字段,key 字段设置为 securityMarks_name
和程度上减少 read_only_udm.security_result.severity, read_only_udm.security_result.priority_details 直接映射。
sourceDisplayName read_only_udm.target.resource.attribute.labels.value 直接映射。
sourceProperties.contextUris.mitreUri.displayName read_only_udm.security_result.detection_fields.key 直接映射。detection_fields 对象可以根据可用字段重复多次。
sourceProperties.contextUris.mitreUri.url read_only_udm.security_result.detection_fields.value 直接映射。detection_fields 对象可以根据可用字段重复多次。
sourceProperties.detectionCategory.ruleName read_only_udm.security_result.rule_name 直接映射。
sourceProperties.detectionCategory.subRuleName read_only_udm.security_result.detection_fields.value 直接映射。detection_fields 对象可以根据可用字段重复多次。对于此字段,key 字段设置为 sourceProperties_detectionCategory_subRuleName
sourceProperties.detectionPriority read_only_udm.security_result.priority_details 直接映射。
sourceProperties.findingId read_only_udm.target.resource.attribute.labels.value 直接映射。
state read_only_udm.security_result.detection_fields.value 直接映射。detection_fields 对象可以根据可用字段重复多次。对于此字段,key 字段设置为 state
不适用 read_only_udm.metadata.log_type 硬编码为 GCP_SECURITYCENTER_OBSERVATION
不适用 read_only_udm.metadata.product_name 硬编码为 Security Command Center
不适用 read_only_udm.metadata.vendor_name 硬编码为 Google
不适用 read_only_udm.principal.user.account_type 如果存在主账号电子邮件地址,则设置为 CLOUD_ACCOUNT_TYPE。
不适用 read_only_udm.security_result.alert_state 硬编码为 ALERTING
不适用 read_only_udm.security_result.priority 如果严重程度为 LOW,则设置为 LOW_PRIORITY。
不适用 read_only_udm.target.application 从 resourceName 字段中提取。
不适用 read_only_udm.target.resource.product_object_id 从父字段中提取。
不适用 read_only_udm.target.resource.resource_type 默认设置为 CLUSTER。如果类别为 Impact: GPU Instance CreatedImpact: Many Instances Created,则设置为 VIRTUAL_MACHINE。如果类别为 Persistence: Add Sensitive Role,则设置为 SETTING
不适用 read_only_udm.target.resource_ancestors.name 从父级字段和 resourceName 字段中提取。
不适用 read_only_udm.target.resource_ancestors.product_object_id 从父级、resource.project_name 和 resourceName 字段中提取。
不适用 read_only_udm.target.resource_ancestors.resource_type 如果 resource.type 为 google.compute.Project,则设置为 CLOUD_PROJECT。
不适用 read_only_udm.target.labels.key 如果存在 access.methodName,则该值设置为 access_methodName
不适用 read_only_udm.target.labels.value 该值是从 access.methodName 设置的。
不适用 read_only_udm.target.resource.attribute.labels.key 根据可用字段,将键设置为以下值之一:resource_parentDisplayNameresource_typeresource_parentNameresource_projectDisplayNameresource_displayNamefinding_idsource_idFindingProviderIdsourceDisplayNameasset_display_name
不适用 read_only_udm.target.resource.attribute.labels.value 该值根据可用字段(parentDisplayName、resource.type、resource.parent_name、resource.project_display_name、resource.display_name、sourceProperties.findingId、sourceProperties.sourceId、findingProviderId、sourceDisplayName、assetDisplayName)中的一个进行设置。

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