收集 Cloud Security Command Center 观察日志

支持的平台:

本文档介绍了如何使用 Cloud Storage 将 Security Command Center 观察日志导出并提取到 Google 安全运营中。解析器会将原始 JSON 数据转换为统一数据模型 (UDM)。它会对数据结构进行标准化,处理输入中的潜在变体,然后提取相关字段并将其映射到 UDM 架构,通过额外的上下文和标志丰富数据,以便进行下游分析。

准备工作

  • 确保 Google Cloud 在您的环境中启用并配置了 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. 点击保存

配置 Google Cloud 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

在 Google SecOps 中配置 Feed 以提取 Google Cloud Security Command Center 观察日志

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

    • 存储分区 URI:Cloud Storage 存储分区网址;例如 gs://gcp-scc-observation-logs
    • URI 类型:选择包含子目录的目录
    • 来源删除选项:根据您的偏好选择删除选项。

    • 资源命名空间资源命名空间

    • 提取标签:应用于此 Feed 中的事件的标签。

  9. 点击下一步

  10. 最终确定界面中查看新的 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 系统会从 assetId 字段中提取 assets/ 后的值,并将其映射为 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
不适用 is_alert 如果成功解析日志,则设为 true。
不适用 is_significant 如果成功解析日志,则设为 true。
不适用 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 从 parent 和 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。

变化

2023-11-29

  • 修复了解析器中处理主机名的方式不一致的问题。

2023-05-02

  • 确保 security_result.url_back_to_product 字段现在包含格式正确的网址。

2023-04-12

  • 默认更新了 GCP_SECURITYCENTER_OBSERVATION 解析器。

需要更多帮助?向社区成员和 Google SecOps 专业人士寻求解答。