Google Cloud Armor

本文档提供了一些指导,可帮助您将 Google Cloud Armor 与 Google Security Operations 集成。

前提条件

请务必先完成所有前提步骤,然后再配置集成。

创建和配置 IAM 角色

  1. 在 Google Cloud 控制台中,前往 IAM 角色页面。

    前往“IAM 角色”

  2. 点击创建角色,以创建具有集成所需权限的自定义角色。

  3. 对于新的自定义角色,请提供标题说明和唯一的 ID

  4. 角色发布阶段设置为正式版

  5. 向创建的角色添加以下权限:

    • compute.backendBuckets.setSecurityPolicy
    • compute.backendServices.setSecurityPolicy
    • compute.regionBackendServices.setSecurityPolicy
    • compute.regionSecurityPolicies.create
    • compute.regionSecurityPolicies.get
    • compute.regionSecurityPolicies.list
    • compute.regionSecurityPolicies.update
    • compute.securityPolicies.create
    • compute.securityPolicies.get
    • compute.securityPolicies.list
    • compute.securityPolicies.update
  6. 点击创建

创建服务账号

  1. 如需创建服务账号,请按照创建服务账号的流程操作。

  2. 创建服务账号后,请将其下载为 JSON 文件。配置集成参数时,您需要提供下载的 JSON 文件的内容。

    如需使用 Workload Identity Federation for GKE 电子邮件地址,而不是服务账号 JSON 文件内容,请向集成中使用的服务账号分配 Service Account Token Creator 角色。

将 Cloud Armor 与 Google SecOps 集成

如需配置集成,请使用以下参数:

参数
API Root 必需

Cloud Armor 服务的 API 根。

默认值为 https://compute.googleapis.com/compute/v1/

Project ID 可选

用于 Cloud Armor 集成的项目 ID。如果未提供值,系统会从 User Service Account(用户服务账号)参数中提供的 JSON 文件内容中提取项目 ID。

Workload Identity Email 可选

服务账号的客户端电子邮件地址。

您可以配置此参数,也可以配置用户服务账号参数。

如需使用 Workload Identity Federation for GKE 电子邮件地址模拟服务账号,请向您的服务账号授予“Service Account Token Creator”角色。如需详细了解工作负载身份以及如何使用它们,请参阅工作负载的身份

User Service Account 可选

您用于 Cloud Armor 服务的服务账号 JSON 文件的内容。

提供服务账号 JSON 文件的完整内容。

您可以配置此参数,也可以配置 Workload Identity 电子邮件地址参数。

Verify SSL 可选

如果选择此参数,则会验证与 Cloud Armor 服务的连接所用的 SSL 证书是否有效。

此选项将会默认选中。

操作

某些操作不需要输入参数。

向安全政策添加规则

在 Cloud Armor 服务中向安全政策添加新规则。

实体

此操作不会在实体上运行。

操作输入

如需配置操作,请使用以下参数:

参数
Policy Name 必需

要向其添加新规则的安全政策的名称。

Region 可选

要添加规则的政策的区域。

如果未提供值,则将规则添加到全局级安全政策。

Rule JSON 必需

要添加的规则的 JSON 定义。

如需详细了解如何向政策添加规则,请参阅方法:securityPolicies.addRule

操作输出

操作输出类型
案例墙附件 不适用
案例墙链接 不适用
“支持请求墙”表格 不适用
丰富化表 不适用
JSON 结果 可用
脚本结果 可用
脚本结果
脚本结果名称
is_success True 或 False
JSON 结果
{
   "kind": "compute#securityPolicy",
   "id": "ID",
   "creationTimestamp": "2024-04-14T05:39:05.798-07:00",
   "name": "example",
   "description": "Test for integration",
   "rules": [
       {
           "kind": "compute#securityPolicyRule",
           "description": "test",
           "priority": 100,
           "match": {
               "versionedExpr": "SRC_IPS_V1",
               "config": {
                   "srcIpRanges": [
                       "*"
                   ]
               }
           },
           "action": "allow",
           "preview": false
       },
       {
           "kind": "compute#securityPolicyRule",
           "description": "Default rule, higher priority overrides it",
           "priority": 2147483647,
           "match": {
               "versionedExpr": "SRC_IPS_V1",
               "config": {
                   "srcIpRanges": [
                       "*"
                   ]
               }
           },
           "action": "allow",
           "preview": false
       }
   ],
   "fingerprint": "A3hq2ZQYxj8=",
   "selfLink": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1/securityPolicies/example",
   "type": "CLOUD_ARMOR",
   "labelFingerprint": "42WmSpB8rSM=",
   "region": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1"
}
案例墙

此操作会提供以下输出消息:

输出消息 消息说明
Successfully added a new rule to the security policy! 操作成功。
Error executing action "Add a Rule to a Security Policy". Reason: ERROR_REASON

操作失败。

检查与服务器的连接、输入参数、凭据、区域名称、JSON 文件的内容或政策名称。

创建安全政策

在 Cloud Armor 服务中创建安全政策。

实体

此操作不会在实体上运行。

操作输入

如需配置操作,请使用以下参数:

参数
Region 可选

要在其中创建政策的区域。

如果未提供值,则会创建全局级安全政策。

Policy JSON 必需

要创建的政策的 JSON 定义。

如需详细了解政策,请参阅 REST 资源:securityPolicies

操作输出

操作输出类型
案例墙附件 不适用
案例墙链接 不适用
“支持请求墙”表格 不适用
丰富化表 不适用
JSON 结果 可用
脚本结果 可用
脚本结果
脚本结果名称
is_success True 或 False
JSON 结果
{
   "kind": "compute#securityPolicy",
   "id": "ID",
   "creationTimestamp": "2024-04-14T05:39:05.798-07:00",
   "name": "example",
   "description": "Test for integration",
   "rules": [
       {
           "kind": "compute#securityPolicyRule",
           "description": "test",
           "priority": 100,
           "match": {
               "versionedExpr": "SRC_IPS_V1",
               "config": {
                   "srcIpRanges": [
                       "*"
                   ]
               }
           },
           "action": "allow",
           "preview": false
       },
       {
           "kind": "compute#securityPolicyRule",
           "description": "Default rule, higher priority overrides it",
           "priority": 2147483647,
           "match": {
               "versionedExpr": "SRC_IPS_V1",
               "config": {
                   "srcIpRanges": [
                       "*"
                   ]
               }
           },
           "action": "allow",
           "preview": false
       }
   ],
   "fingerprint": "A3hq2ZQYxj8=",
   "selfLink": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1/securityPolicies/example",
   "type": "CLOUD_ARMOR",
   "labelFingerprint": "42WmSpB8rSM=",
   "region": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1"
}
案例墙

此操作会提供以下输出消息:

输出消息 消息说明
Successfully created a new security policy! 操作成功。
Error executing action "Create a Security Policy". Reason: ERROR_REASON

操作失败。

检查与服务器的连接、输入参数、凭据、区域名称或 JSON 文件的内容。

Ping

使用集成配置页面中提供的参数测试与 Cloud Armor 服务的连接。

实体

此操作不会在实体上运行。

操作输入

不适用

操作输出

操作输出类型
案例墙附件 不适用
案例墙链接 不适用
“支持请求墙”表格 不适用
丰富化表 不适用
JSON 结果 不适用
脚本结果 可用
脚本结果
脚本结果名称
is_success True 或 False
案例墙

此操作会提供以下输出消息:

输出消息 消息说明
Successfully connected to the Google Cloud Armor service with the provided connection parameters! 操作成功。
Failed to connect to the Google Cloud Armor service! Error is ERROR_REASON

操作失败。

检查与服务器的连接、输入参数或凭据。

更新安全政策

在 Cloud Armor 服务中更新现有安全政策。

此操作无法更新政策中的规则。如需向相关政策添加规则,请使用向安全政策添加规则操作。

实体

此操作不会在实体上运行。

操作输入

如需配置操作,请使用以下参数:

参数
Policy Name 必需

要向其添加新规则的安全政策的名称。

Region 可选

更新后政策的地区。

如果未提供值,则会创建全局级安全政策。

Rule JSON 必需

要更新的政策的 JSON 定义。

如需详细了解政策更新,请参阅方法:securityPolicies.patch

您无法通过此操作更新规则。 如需向政策添加规则,请使用向安全政策添加规则操作。

操作输出

操作输出类型
案例墙附件 不适用
案例墙链接 不适用
“支持请求墙”表格 不适用
丰富化表 不适用
JSON 结果 可用
脚本结果 可用
脚本结果
脚本结果名称
is_success True 或 False
JSON 结果
{
   "kind": "compute#securityPolicy",
   "id": "ID",
   "creationTimestamp": "2024-04-14T05:39:05.798-07:00",
   "name": "example",
   "description": "Test for integration",
   "rules": [
       {
           "kind": "compute#securityPolicyRule",
           "description": "test",
           "priority": 100,
           "match": {
               "versionedExpr": "SRC_IPS_V1",
               "config": {
                   "srcIpRanges": [
                       "*"
                   ]
               }
           },
           "action": "allow",
           "preview": false
       },
       {
           "kind": "compute#securityPolicyRule",
           "description": "Default rule, higher priority overrides it",
           "priority": 2147483647,
           "match": {
               "versionedExpr": "SRC_IPS_V1",
               "config": {
                   "srcIpRanges": [
                       "*"
                   ]
               }
           },
           "action": "allow",
           "preview": false
       }
   ],
   "fingerprint": "A3hq2ZQYxj8=",
   "selfLink": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1/securityPolicies/example",
   "type": "CLOUD_ARMOR",
   "labelFingerprint": "42WmSpB8rSM=",
   "region": "https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/regions/northamerica-northeast1"
}
案例墙

此操作会提供以下输出消息:

输出消息 消息说明
Successfully added comment to the identity protection detection with ID DETECTION_ID in CrowdStrike 操作成功。
Error executing action "Update a Security Policy". Reason: ERROR_REASON

操作失败。

检查与服务器的连接、输入参数或凭据。

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