将 Google Cloud 数据注入 Google Security Operations

本页面介绍了如何启用和停用 Google Cloud 数据的提取 Google Security OperationsGoogle Security Operations 可让您存储、搜索和 查看汇总的安全信息,供企业返回 个月或更长时间(具体取决于数据保留期限)。

概览

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

方案 1:直接提取

您可以在 Google Cloud 中配置一个特殊的 Cloud Logging 过滤器, Google Security Operations 实时监控特定日志类型。这些日志是 各种 Google Cloud 服务

即使日志已在项目级排除,Google Security Operations 也会收到这些日志 在 Google Cloud 中,但同时包含在日志导出过滤条件和组织级别中 Google Cloud Logging。如需从 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 可以将日志路由到 将由 Google Security Operations 按计划提取的 Cloud Storage。

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

准备工作

将 Google Cloud 数据注入您的 Google Security Operations 实例之前, 您必须完成以下步骤:

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

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

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

授予 IAM 角色

您可以使用 Google Cloud 控制台或 gcloud CLI

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

  1. 登录您要连接的 Google Cloud 组织,然后导航到 使用产品 >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 之间的私有内部 API 注入 以及 Google Security Operations 等工具。提取从未到达外部网络 从不使用 IP 地址Google 会直接访问 Google Cloud 日志, 使用 Google Security Operations 提供的一次性代码完成的身份验证 Security Command Center

实现从 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 的 Read 和 List 操作:

  ( `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 Cloud 资产元数据, 导出到您的 Google Security Operations 账号:

  • 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.name、 和 resource.version

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

如需将 Google Cloud 资产元数据导出到 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 Security Operations 系统,请设置 Export Cloud logs to Google Security Operations 将其切换为“已停用”,然后再次切换为“已启用”
  • 资产元数据会定期注入 Google Security Operations 中。 所做更改可能需要几小时才能在 Google Security Operations 界面和 API 中显示。

后续步骤

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