将 Google Cloud 数据注入 Google Security Operations

本页面介绍了如何启用和停用将 Google Cloud 数据提取到 Google Security Operations 的功能。借助 Google Security Operations,您可以存储、搜索和检查企业的汇总安全信息,这些数据可能会根据您的数据保留期限使用数月或更长时间。

概览

您可以通过以下两种方式将 Google Cloud 数据发送到 Google Security Operations。选择正确的选项取决于日志类型。

方案 1:直接提取

您可以在 Google Cloud 中配置特殊的 Cloud Logging 过滤条件,以向 Google Security Operations 实时发送特定类型的日志。这些日志由 Google Cloud 服务生成

即使日志已在 Google Cloud 的项目级排除,Google Security Operations 也会收到这些日志,但会同时包含在日志导出过滤条件和组织级 Google Cloud 日志记录中。如需从 Google Security Operations 中排除日志,您必须更新 Google Cloud 中的 Google Security Operations 日志导出过滤条件。

可用的日志类型包括:

如需收集 Compute Engine 或应用日志(例如 Apache、Nginx 或 IIS),请使用选项 2。此外,请向 Google Security Operations 提交支持服务工单,提供反馈,以便将来考虑使用选项 1 作为日志类型提供支持。

如需了解特定的日志过滤条件和更多提取详情,请参阅将 Google Cloud 日志导出到 Google Security Operations

也可以将用于扩充上下文的其他 Google Cloud 元数据发送到 Google Security Operations。如需了解详情,请参阅将 Google Cloud 资产元数据导出到 Google Security Operations

方案 2:Google Cloud Storage

Cloud Logging 可以将日志路由到 Cloud Storage,以便 Google Security Operations 按计划提取。

如需详细了解如何为 Google Security Operations 配置 Cloud Storage,请参阅 Feed 管理:Cloud Storage

准备工作

您必须先完成以下步骤,然后才能将 Google Cloud 数据注入 Google Security Operations 实例:

  1. 与您的 Google Security Operations 代表联系,并获取注入 Google Cloud 数据所需的一次性访问代码。

  2. 授予您访问 Google Security Operations 部分所需的以下 IAM 角色

    • Chronicle Service Admin (roles/chroniclesm.admin):执行所有活动的 IAM 角色。
    • Chronicle Service Viewer (roles/chroniclesm.viewer):仅查看提取状态的 IAM 角色。
    • Security Center Admin Editor (roles/securitycenter.adminEditor):必须启用此权限才能启用 Cloud Asset 元数据的提取。
  3. 如果您打算启用 Cloud Asset Metadata,则还必须启用 Security Command Center 标准层级或 Security Command Center 高级层级 Google Cloud 服务。如需了解详情,请参阅为组织激活 Security Command Center

授予 IAM 角色

您可以使用 Google Cloud 控制台或 gcloud CLI 授予所需的 IAM 角色。

如需使用 Google Cloud 控制台授予 IAM 角色,请完成以下步骤:

  1. 登录要连接的 Google Cloud 组织,然后使用产品 > IAM 和管理 > IAM 导航到 IAM 屏幕。
  2. 从 IAM 屏幕中,选择用户,然后点击修改成员

  3. 在“修改权限”屏幕中,点击添加其他角色,然后搜索 Google Security Operations 以查找 IAM 角色。

  4. 分配角色后,点击保存

如需使用 Google Cloud CLI 授予 IAM 角色,请完成以下步骤:

  1. 确保您已登录正确的组织。运行 gcloud init 命令可对此进行验证。

  2. 如需使用 gcloud 授予 Chronicle Service Admin IAM 角色,请运行以下命令:

    gcloud organizations add-iam-policy-binding ORGANIZATION_ID \
    --member "user:USER_EMAIL" \
    --role roles/chroniclesm.admin
    

    请替换以下内容:

    • ORGANIZATION_ID:数字形式的组织 ID。
    • USER_EMAIL:管理员用户的电子邮件地址。
  3. 如需使用 gcloud 授予 Google Security Operations Service Viewer IAM 角色,请运行以下命令:

    gcloud organizations add-iam-policy-binding ORGANIZATION_ID \
    --member "user:USER_EMAIL" \
    --role roles/chroniclesm.viewer
    
  4. 如需使用 gcloud 授予 Security Center Admin Editor 角色,请运行以下命令:

     gcloud organizations add-iam-policy-binding ORGANIZATION_ID \
     --member "user:USER_EMAIL" \
     --role roles/securitycenter.adminEditor`
    

启用 Google Cloud 数据注入

Google Cloud 数据通过 Security Command Center 和 Google Security Operations 之间的私有内部 API 提取。提取永远不会到达外部网络,也绝不会使用 IP 地址。Google 会根据使用 Google Security Operations for Security Command Center 提供的一次性代码完成的身份验证直接访问 Google Cloud 日志。

如需实现从 Google Cloud 组织到 Google Security Operations 实例的数据注入,请完成以下步骤:

  1. 前往 Google Cloud 控制台的 Google Security Operations 页面。
    转到 Google Security Operations 页面

  2. Google Security Operations 一次性访问代码字段中输入您的一次性访问代码。

  3. 如需同意使用 Google Security Operations,请选中标有我同意 Chronicle 使用我的 Google Cloud 数据的条款及条件的复选框。

  4. 点击 Connect Google Security Operations

您的 Google Cloud 数据现在将发送到 Google Security Operations。您可以使用 Google Security Operations 的分析功能来调查任何与安全相关的问题。以下部分介绍了如何调整将发送到 Google Security Operations 的 Google Cloud 数据类型

将 Google Cloud 日志导出到 Google Security Operations

您可以将以下类型的 Google Cloud 数据导出到 Google Security Operations 实例:

  • GCP_CLOUDAUDIT:
    • log_id(“cloudaudit.googleapis.com/activity”)(由默认过滤条件导出)
    • log_id(“cloudaudit.googleapis.com/system_event”)(由默认过滤条件导出)
    • log_id("cloudaudit.googleapis.com/policy")
    • log_id("cloudaudit.googleapis.com/access_transparency")
  • GCP_CLOUD_NAT:
    • log_id("compute.googleapis.com/nat_flows")
  • GCP_DNS:
    • log_id(“dns.googleapis.com/dns_queries”)(由默认过滤条件导出)
  • GCP_FIREWALL:
    • log_id("compute.googleapis.com/firewall")
  • GCP_IDS:
    • log_id("ids.googleapis.com/threat")
    • log_id("ids.googleapis.com/traffic")
  • GCP_LOADBALANCING:
    • log_id("requests")
    • log_id("loadbalancing.googleapis.com/external_regional_requests")
    • log_id("networksecurity.googleapis.com/network_dos_attack_mitigations")
    • log_id("networksecurity.googleapis.com/dos_attack")
    • 这包括来自 Google Cloud Armor 和 Cloud Load Balancing 的日志
  • GCP_CLOUDSQL:
    • log_id("cloudsql.googleapis.com/mysql-general.log")
    • log_id("cloudsql.googleapis.com/mysql.err")
    • log_id("cloudsql.googleapis.com/postgres.log")
    • log_id("cloudsql.googleapis.com/sqlagent.out")
    • log_id("cloudsql.googleapis.com/sqlserver.err")
  • NIX_SYSTEM:
    • log_id("syslog")
    • log_id("authlog")
    • log_id("securelog")
  • LINUX_SYSMON:
    • log_id("sysmon.raw")
  • WINEVTLOG:
    • log_id("winevt.raw")
    • log_id("windows_event_log")
  • BRO_JSON:
    • log_id("zeek_json_streaming_conn")
    • log_id("zeek_json_streaming_dhcp")
    • log_id("zeek_json_streaming_dns")
    • log_id("zeek_json_streaming_http")
    • log_id("zeek_json_streaming_ssh")
    • log_id("zeek_json_streaming_ssl")
  • KUBERNETES_NODE:
    • log_id("events")
    • log_id("stdout")
    • log_id("stderr")
  • AUDITD:
    • log_id("audit_log")
  • GCP_APIGEE_X:
    • log_id("apigee-logs")
    • logName =~ "^projects/[\w\-]+/logs/apigee\.googleapis\.com[\w\-]*$"
    • 根据需要调整日志过滤条件的正则表达式
  • GCP_RECAPTCHA_ENTERPRISE:
    • log_id("recaptchaenterprise.googleapis.com/assessment")
    • log_id("recaptchaenterprise.googleapis.com/annotation")
  • GCP_RUN:
    • log_id("run.googleapis.com/stderr")
    • log_id("run.googleapis.com/stdout")
    • log_id("run.googleapis.com/requests")
    • log_id("run.googleapis.com/varlog/system")
  • GCP_NGFW_ENTERPRISE:
    • log_id("networksecurity.googleapis.com/firewall_threat")

如需将 Google Cloud 日志导出到 Google Security Operations,请将 Google Cloud 日志开关切换为“启用”。上面列出的所有 Google Cloud 日志类型都将导出到您的 Google Security Operations 实例。

如需了解应使用哪些日志过滤条件的最佳实践,请参阅 Google Cloud 中的安全日志分析

导出过滤条件设置

默认情况下,您的 Cloud Audit Logs 日志(管理员活动和系统事件)和 Cloud DNS 日志会发送到您的 Google Security Operations 帐号。但是,您可以自定义导出过滤条件,以包含或排除特定类型的日志。导出过滤条件基于 Google 日志记录查询语言

如需为日志定义自定义过滤条件,请完成以下步骤:

  1. 使用日志记录查询语言为日志创建自定义过滤条件,以定义过滤条件。以下文档介绍了如何定义此类过滤条件:/logging/docs/view/logging-query-language

  2. 使用导出过滤器设置标签页上提供的链接转到日志浏览器,将新查询复制到查询字段,然后点击运行查询以进行测试。

    验证日志浏览器中显示的匹配日志是否与您要导出到 Google Security Operations 的日志完全一致。

导出过滤条件设置标签页中完成以下步骤:

  1. 过滤条件准备就绪后,点击“修改”图标,然后将过滤条件粘贴到导出过滤条件字段中。

  2. 点击保存自定义过滤器。新的自定义过滤条件适用于导出到您的 Google Security Operations 帐号的所有新日志。

  3. 您可以点击重置为默认值,将导出过滤条件重置为默认版本。 请务必先保存自定义过滤条件的副本。

调整 Cloud Audit Logs 过滤条件

Cloud Audit Data Access 日志可以生成大量没有太多威胁检测值的日志。如果您选择将这些日志发送到 Google Security Operations,则应滤除日常活动生成的日志。

以下导出过滤条件可捕获数据访问日志并排除大量事件,例如 Cloud Storage 和 Cloud SQL 的“读取”和“列出”操作:

  ( `log_id("cloudaudit.googleapis.com/data_access")`
  AND NOT protoPayload.methodName =~ "^storage\.(buckets|objects)\.(get|list)$"
  AND NOT protoPayload.request.cmd = "select" )

如需详细了解如何调整 Cloud Audit Data Access 日志,请参阅此处

导出过滤条件示例

以下导出过滤条件示例说明了如何在将特定类型的日志导出到您的 Google Security Operations 帐号时包含或排除此类日志。

导出过滤条件示例 1:包含其他日志类型

以下导出过滤条件除了导出默认日志外,还会导出 Access Transparency 日志:

log_id("dns.googleapis.com/dns_queries") OR
log_id("cloudaudit.googleapis.com/activity") OR
log_id("cloudaudit.googleapis.com/system_event") OR
log_id("cloudaudit.googleapis.com/access_transparency")

导出过滤条件示例 2:包含特定项目中的其他日志

除了默认日志之外,以下导出过滤条件还会导出特定项目的 Access Transparency 日志:

log_id("dns.googleapis.com/dns_queries") OR
log_id("cloudaudit.googleapis.com/activity") OR
log_id("cloudaudit.googleapis.com/system_event") OR
logName = "projects/my-project-id/logs/cloudaudit.googleapis.com%2Faccess_transparency"

导出过滤条件示例 3:包含特定文件夹中的其他日志

除了默认日志之外,以下导出过滤条件还会从特定文件夹导出 Access Transparency 日志:

log_id("dns.googleapis.com/dns_queries") OR
log_id("cloudaudit.googleapis.com/activity") OR
log_id("cloudaudit.googleapis.com/system_event") OR
logName = "folders/my-folder-id/logs/cloudaudit.googleapis.com%2Faccess_transparency"

导出过滤条件示例 4:排除特定项目中的日志

以下导出过滤条件会从整个 Google Cloud 组织(特定项目除外)导出默认日志:

(log_id("dns.googleapis.com/dns_queries") OR
log_id("cloudaudit.googleapis.com/activity") OR
log_id("cloudaudit.googleapis.com/system_event")) AND
(NOT logName =~ "^projects/my-project-id/logs/.*$")

将 Google Cloud 资产元数据导出到 Google Security Operations

您可以将 Google Cloud 资产元数据导出到 Google Security Operations。此资产元数据提取自您的 Google Cloud Asset Inventory,包含有关您的资产、资源和身份的信息,其中包括:

  • 环境
  • 位置
  • 可用区
  • 硬件型号
  • 资源和身份之间的访问权限控制关系

以下是将导出到您的 Google Security Operations 帐号的特定类型的 Google Cloud Asset 元数据:

  • GCP_BIGQUERY_CONTEXT
  • GCP_CLOUD_FUNCTIONS_CONTEXT
  • GCP_COMPUTE_CONTEXT
  • GCP_IAM_CONTEXT
  • GCP_IAM_ANALYSIS
  • GCP_KUBERNETES_CONTEXT
  • GCP_NETWORK_CONNECTIVITY_CONTEXT
  • GCP_RESOURCE_MANAGER_CONTEXT
  • GCP_SQL_CONTEXT
  • GCP_STORAGE_CONTEXT

以下是 Google Cloud 资产元数据的一些示例:

  • 应用名称—Google-iamSample/0.1
  • 项目名称—projects/my-project

Resource Manager 上下文日志字段示例包括 assetTyperesource.data.nameresource.version

如需详细了解资源类型,请参阅 Cloud Asset Inventory 支持的资源类型

如需将 Google Cloud Asset 元数据导出到 Google Security Operations,请将 Cloud Asset Metadata 切换开关设置为“已启用”。

字段映射参考文档和支持的资源类型

下表列出了 Google Security Operations 支持的上下文解析器、相应的提取标签和支持的资源类型。

如需查看上下文解析器的映射参考文档,请点击表中相应的上下文解析器名称。

服务名称 提取标签 支持的资源类型
BigQuery GCP_BIGQUERY_CONTEXT
Resource Manager GCP_RESOURCE_MANAGER_CONTEXT
Cloud SQL GCP_SQL_CONTEXT
Cloud Functions GCP_CLOUD_FUNCTIONS_CONTEXT
Identity and Access Management GCP_IAM_CONTEXT
Network Connectivity Center GCP_NETWORK_CONNECTIVITY_CONTEXT
Google Kubernetes Engine GCP_KUBERNETES_CONTEXT
Compute Engine GCP_COMPUTE_CONTEXT

将 Security Command Center 发现结果导出到 Google Security Operations

您可以将 Security Command Center 高级事件威胁检测 (ETD) 发现结果和所有其他发现结果导出到 Google Security Operations。

如需详细了解 Event Threat Detection 发现结果,请参阅 Security Command Center 概览

如需将 Security Command Center 高级层级发现结果导出到 Google Security Operations,请将 Security Command Center 高级发现结果切换开关设置为“启用”。

将 Sensitive Data Protection 数据导出到 Google Security Operations

如需注入 Sensitive Data Protection 资产元数据 (DLP_CONTEXT),请执行以下操作:

  1. 完成本文档中的上一部分,启用 Google Cloud 数据注入功能。
  2. 配置 Sensitive Data Protection 以分析数据
  3. 配置扫描配置,以将数据分析文件发布到 Google Security Operations。

如需详细了解如何为 BigQuery 数据创建数据分析文件,请参阅敏感数据保护文档

停用 Google Cloud 数据注入

  1. 选中标有我想断开与 Google Security Operations 的连接,并停止将 Google Cloud 日志发送到 Google Security Operations 的复选框。

  2. 点击 Disconnect Google Security Operations

问题排查

  • 如果 Google 安全操作系统中缺少资源与身份之间的关系,请将将 Cloud 日志导出至 Google Security Operations 切换为停用,然后再次启用。
  • 资产元数据会定期注入 Google Security Operations 中。所做更改可能需要几小时才能在 Google Security Operations 界面和 API 中显示。

后续步骤

  • 使用 Google Security Operations 代表提供的客户专用网址打开您的 Google Security Operations 帐号。
  • 详细了解 Google Security Operations