收集 Security Command Center 未指定日志

支持的语言:

本文档介绍了如何使用 Cloud Storage 将 Security Command Center 未指定日志导出并注入到 Google Security Operations 中。解析器会将原始 JSON 格式的安全发现结果转换为统一数据模型 (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-unspecified-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-unspecified-logs-sink
    • 接收器目标位置:选择 Cloud Storage 存储空间,然后输入存储桶的 URI,例如 gs://gcp-scc-unspecified-logs
    • 日志过滤条件

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

  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 name(Feed 名称)字段中,输入 Feed 的名称;例如,Security Command Center Unspecified logs(Security Command Center 未指定日志)。
  5. 选择 Google Cloud Storage 作为来源类型
  6. 选择 Security Command Center 未指定作为日志类型
  7. 点击Chronicle 服务账号字段旁边的获取服务账号
  8. 点击下一步
  9. 为以下输入参数指定值:

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

  10. 点击下一步

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

设置来自内容中心的 Feed

为以下字段指定值:

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

高级选项

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

UDM 映射表

日志字段 UDM 映射 逻辑
canonicalName read_only_udm.target.resource_ancestors.name 直接从原始日志字段 canonicalName 映射。表示目标资源的祖先。
类别 read_only_udm.metadata.product_event_type 直接从原始日志字段 category 映射。
类别 read_only_udm.metadata.event_type 派生自 category 字段。如果类别为 OPEN_FIREWALL 且满足特定条件,则映射到 SCAN_VULN_HOST。否则,该值会默认为 GENERIC_EVENT
类别 read_only_udm.security_result.category 从原始日志字段 category 映射而来。如果类别为 OPEN_FIREWALL,则映射到 POLICY_VIOLATION
complies.ids read_only_udm.additional.fields.value.string_value 直接从原始日志字段 complies.ids 映射。表示合规性 ID。
complies.standard read_only_udm.additional.fields.value.string_value 直接从原始日志字段 complies.standard 映射。表示合规性标准。
complies.standard read_only_udm.about.labels.value 直接从原始日志字段 complies.standard 映射。表示合规性标准。
contacts.security.contacts.email read_only_udm.security_result.about.user.email_addresses 直接从原始日志字段 contacts.security.contacts.email 映射。表示安全联系人的电子邮件地址。
contacts.technical.contacts.email read_only_udm.security_result.about.user.email_addresses 直接从原始日志字段 contacts.technical.contacts.email 映射。表示技术联系人的电子邮件地址。
createTime read_only_udm.security_result.detection_fields.value 直接从原始日志字段 createTime 映射。
eventTime read_only_udm.metadata.event_timestamp 直接从原始日志字段 eventTime 映射,并转换为时间戳。
externalUri read_only_udm.about.url 直接从原始日志字段 externalUri 映射。
mute read_only_udm.security_result.detection_fields.value 直接从原始日志字段 mute 映射。
muteInitiator read_only_udm.security_result.detection_fields.value 直接从原始日志字段 muteInitiator 映射。
muteUpdateTime read_only_udm.security_result.detection_fields.value 直接从原始日志字段 muteUpdateTime 映射。
name read_only_udm.target.resource.attribute.labels.value 直接从原始日志字段 name 映射。该名称将用作发现 ID。
父级 read_only_udm.target.resource_ancestors.name 直接从原始日志字段 parent 映射。
parentDisplayName read_only_udm.metadata.description 直接从原始日志字段 parentDisplayName 映射。
resourceName read_only_udm.target.resource.name 直接从原始日志字段 resourceName 映射。
和程度上减少 read_only_udm.security_result.severity 直接从原始日志字段 severity 映射。
sourceDisplayName read_only_udm.target.resource.attribute.labels.value 直接从原始日志字段 sourceDisplayName 映射。
sourceProperties.AllowedIpRange read_only_udm.target.resource.attribute.labels.value 直接从原始日志字段 sourceProperties.AllowedIpRange 映射。
sourceProperties.ExternallyAccessibleProtocolsAndPorts.IPProtocol read_only_udm.target.resource.attribute.labels.value 直接从原始日志字段 sourceProperties.ExternallyAccessibleProtocolsAndPorts.IPProtocol 映射。
sourceProperties.ExternallyAccessibleProtocolsAndPorts.ports read_only_udm.target.resource.attribute.labels.value 直接从原始日志字段 sourceProperties.ExternallyAccessibleProtocolsAndPorts.ports 映射。
sourceProperties.ReactivationCount read_only_udm.target.resource.attribute.labels.value 直接从原始日志字段 sourceProperties.ReactivationCount 映射。
sourceProperties.ResourcePath read_only_udm.target.resource.attribute.labels.value 直接从原始日志字段 sourceProperties.ResourcePath 映射。这些值会连接成一个字符串。
sourceProperties.ScannerName read_only_udm.additional.fields.value.string_value 直接从原始日志字段 sourceProperties.ScannerName 映射。
sourceProperties.ScannerName read_only_udm.principal.labels.value 直接从原始日志字段 sourceProperties.ScannerName 映射。
state read_only_udm.security_result.detection_fields.value 直接从原始日志字段 state 映射。
read_only_udm.metadata.log_type 在解析器代码中硬编码为 GCP_SECURITYCENTER_UNSPECIFIED
read_only_udm.metadata.product_log_id name 字段中提取,表示发现结果 ID。
read_only_udm.metadata.product_name 在解析器代码中硬编码为 Security Command Center
read_only_udm.metadata.vendor_name 在解析器代码中硬编码为 Google
read_only_udm.security_result.about.investigation.status 在解析器代码中硬编码为 NEW
read_only_udm.security_result.alert_state 在解析器代码中硬编码为 NOT_ALERTING
read_only_udm.security_result.url_back_to_product 在解析器代码中使用以下格式构建:https://console.cloud.google.com/security/command-center/findingsv2;name=organizations%2F{organization_id}%2Fsources%2F{source_id}%2Ffindings%2F{finding_id}
read_only_udm.target.resource.product_object_id 从原始日志的 parent 字段中提取,表示来源 ID。
read_only_udm.target.resource.resource_type 在解析器代码中设置为 CLUSTER
read_only_udm.target.resource_ancestors.resource_type 在解析器代码中硬编码为 CLOUD_PROJECT
read_only_udm.target.resource_ancestors.name 从原始日志的 resourceName 字段中提取,表示项目 ID。
read_only_udm.additional.fields.key 使用硬编码的键创建了多个实例:compliances_id_0_0compliances_standard_0sourceProperties_ScannerName
read_only_udm.about.labels.key 在解析器代码中硬编码为 compliances_standardcompliances_id
read_only_udm.principal.labels.key 在解析器代码中硬编码为 sourceProperties_ScannerName
read_only_udm.target.resource.attribute.labels.key 使用硬编码的键创建了多个实例:finding_idsource_idsourceProperties_ResourcePathsourceDisplayNamesourceProperties_ReactivationCountsourceProperties_AllowedIpRangesourceProperties_ExternallyAccessibleProtocolsAndPorts_IPProtocolsourceProperties_ExternallyAccessibleProtocolsAndPorts_ports
read_only_udm.security_result.about.user.attribute.roles.name 系统会根据原始日志中的 contacts 字段创建两个实例,一个的值为 Security,另一个的值为 Technical
read_only_udm.security_result.detection_fields.key 使用硬编码的键创建了多个实例:mutemute_update_timemute_initiatorcreateTimestate

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