收集 Google Cloud Network Connectivity Center 日志

支持的平台:

本文档介绍了如何使用 Google Cloud Storage V2 将 Google Cloud Network Connectivity Center 日志注入到 Google Security Operations。

Network Connectivity Center 是一个编排框架,用于在连接到名为 hub 的集中管理资源的 spoke 资源之间简化网络连接。Network Connectivity Center 通过利用 Google 的网络,可以将 Google Cloud 外部的不同企业网络连接在一起。

准备工作

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

  • Google SecOps 实例
  • 启用了 Cloud Storage API 的Google Cloud 项目
  • 创建和管理 GCS 存储分区的权限
  • 管理 GCS 存储分区的 IAM 政策的权限
  • 创建和管理 Cloud Logging 接收器的权限
  • 在 Google Cloud 项目中配置的 Network Connectivity Center 资源

创建 Google Cloud Storage 存储分区

  1. 转到 Google Cloud Console
  2. 选择您的项目或创建新项目。
  3. 在导航菜单中,依次前往 Cloud Storage > 存储分区
  4. 点击创建存储分区
  5. 提供以下配置详细信息:

    设置
    为存储桶命名 输入一个全局唯一的名称(例如 ncc-logs-bucket
    位置类型 根据您的需求进行选择(区域级、双区域级、多区域级)
    位置 选择相应位置(例如 us-central1
    存储类别 标准(建议用于经常访问的日志)
    访问权限控制 统一(推荐)
    保护工具 可选:启用对象版本控制或保留政策
  6. 点击创建

配置 Cloud Logging 以将 Network Connectivity Center 日志导出到 GCS

Logging 只能将 Network Connectivity Center 日志存储 30 天。如果要将日志保留更长时间,您必须路由日志。

  1. Google Cloud 控制台中,依次前往 Logging > 日志路由器
  2. 点击创建接收器
  3. 提供以下配置详细信息:
    • 接收器名称:输入一个描述性名称(例如 ncc-chronicle-export)。
    • 接收器说明:可选说明。
  4. 点击下一步
  5. 选择接收器服务部分中:
    • 接收器服务:选择 Cloud Storage 存储桶
    • 选择 Cloud Storage 存储桶:从列表中选择存储桶(例如 ncc-logs-bucket)。
  6. 点击下一步
  7. 选择要包含在接收器中的日志部分,输入过滤查询:

    protoPayload.serviceName="networkconnectivity.googleapis.com"
    
  8. 点击下一步

  9. 检查配置,然后点击创建接收器

检索 Google SecOps 服务账号

Google SecOps 使用唯一的服务账号从您的 GCS 存储桶中读取数据。您必须授予此服务账号对您的存储桶的访问权限。

在 Google SecOps 中配置 Feed 以注入 GCP Network Connectivity Center 日志

  1. 依次前往 SIEM 设置 > Feed
  2. 点击添加新 Feed
  3. 点击配置单个 Feed
  4. Feed 名称字段中,输入 Feed 的名称(例如 Google Cloud Network Connectivity Center Logs)。
  5. 选择 Google Cloud Storage V2 作为来源类型
  6. 选择 GCP_NETWORK_CONNECTIVITY_CONTEXT 作为日志类型

  7. 点击获取服务账号。系统会显示一个唯一的服务账号电子邮件地址,例如:

    chronicle-12345678@chronicle-gcp-prod.iam.gserviceaccount.com
    
  8. 复制此电子邮件地址,以便在下一步中使用。

  9. 点击下一步

  10. 为以下输入参数指定值:

    • 存储桶网址:输入带有前缀路径的 GCS 存储桶 URI:

      gs://ncc-logs-bucket/
      
      • 替换:
        • ncc-logs-bucket:您的 GCS 存储桶名称。
    • 来源删除选项:根据您的偏好选择删除选项:

      • 永不:永不删除转移后的任何文件(建议用于测试)。
      • 删除已转移的文件:在成功转移后删除文件。
      • 删除已转移的文件和空目录:在成功转移后删除文件和空目录。

    • 文件存在时间上限:包含在过去指定天数内修改的文件。默认值为 180 天。

    • 资产命名空间资产命名空间

    • 注入标签:要应用于此 Feed 中事件的标签。

  11. 点击下一步

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

向 Google SecOps 服务账号授予 IAM 权限

Google SecOps 服务账号需要对您的 GCS 存储桶具有 Storage Object Viewer 角色。

  1. 前往 Cloud Storage > 存储分区
  2. 点击相应存储桶的名称(例如 ncc-logs-bucket)。
  3. 前往权限标签页。
  4. 点击授予访问权限
  5. 提供以下配置详细信息:
    • 添加主账号:粘贴 Google SecOps 服务账号电子邮件地址。
    • 分配角色:选择 Storage Object Viewer
  6. 点击保存

UDM 映射表

日志字段 UDM 映射 逻辑
resource.data.createTime entity.resource.attribute.creation_time 资源创建时的时间戳
resource.data.updateTime entity.resource.attribute.last_update_time 资源上次更新时的时间戳
temp_discovery_document、temp_discovery_name、temp_ipcidr_range、temp_overlaps、temp_peer、temp_prefix_length、temp_resource_name、temp_resource_state、temp_target_cidr_range、temp_usage、temp_labels、temp_label entity.resource.attribute.labels 其他资源属性的键值对
resource.data.description metadata.description 实体的说明
resource.data.locationId entity.location.name 营业地点的名称
name, val.uri, resource.data.hub, val, val.virtualMachine, resource.parent, val entity.resource.name 资源的名称
temp_main_ancestor, tmp_ancestor_name entity.resource_ancestors 祖先资源列表
resource.data.uniqueId, obj_id entity.resource.product_object_id 商品中资源的唯一标识符
assetType、HUB entity.resource.resource_subtype 资源的子类型
DEVICE、VPC_NETWORK、VIRTUAL_MACHINE、CLOUD_PROJECT entity.resource.resource_type 资源的类型
GOOGLE_CLOUD_PLATFORM entity.resource.attribute.cloud.environment 云环境(例如GOOGLE_CLOUD_PLATFORM)
reouting_vpc_relation, temp_hub_relation, linked_vpc_tunnel_relation, linked_attachments_relation, router_relation, anceator_relation, user_relations entity.relations 与其他实体的关系
resource.version metadata.product_version 生成相应事件的产品的版本

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