拦截端点组 关联 是一种全球性资源,用于将消费者的虚拟私有云网络链接到 拦截端点组 以进行流量检查。对于每个需要流量检查的 VPC 网络,您都需要创建一个拦截端点组关联。在您配置端点组、端点组关联和防火墙规则以重定向流量后,VPC 网络即可进行流量检查。
在您配置端点组和端点组关联,并配置防火墙规则以重定向要检查的流量后,VPC 网络即可进行流量检查。
本页面介绍如何创建和管理拦截端点组关联。
准备工作
启用项目中的 Compute Engine API。 Google Cloud
在项目中 启用 Network Security API Google Cloud 。
安装 gcloud CLI。
创建拦截端点 组。
角色
如需创建、查看或删除拦截端点组关联,请让您的 管理员向您授予项目的必要 Identity and Access Management (IAM) 角色 。如需详细了解如何授予角色,请参阅管理对项目、文件夹和 组织的访问权限。
如需检查本页面上列出的操作的进度,请确保您的用户角色拥有以下 Intercept Endpoint Admin 角色 (roles/networksecurity.interceptEndpointAdmin) 和权限:
networksecurity.interceptEndpointGroupAssociations.createnetworksecurity.interceptEndpointGroupAssociations.deletenetworksecurity.interceptEndpointGroupAssociations.updatenetworksecurity.interceptEndpointGroupAssociations.getnetworksecurity.interceptEndpointGroupAssociations.listnetworksecurity.interceptEndpointGroups.usecompute.networks.use
创建拦截端点组关联
您可以将一个 VPC 网络与多个拦截端点组相关联。您还可以将一个拦截端点组与多个 VPC 网络相关联。
在创建和管理拦截端点 组 部分,您创建了一个拦截端点组来处理拦截的 流量。不过,您还必须指定可以检查哪些 VPC 的流量。为此,您需要创建一个项目级拦截端点组关联。
您必须在与 VPC 网络相同的项目中创建拦截端点组关联。
控制台
在 Google Cloud 控制台中,前往端点组页面。
点击端点组的名称。
在关联 部分,点击创建 。
在“创建关联”窗格中,点击添加端点组关联 。
对于项目 和网络 ,选择托管拦截部署组的项目和 VPC 网络。
点击完成 。
点击创建。
gcloud
如需创建拦截端点组关联,请使用 gcloud
network-security intercept-endpoint-group-associations create
命令:
gcloud network-security intercept-endpoint-group-associations create ENDPOINT_GROUP_ASSOCIATION_ID \
--location global \
--network NETWORK \
--no-async \
--intercept-endpoint-group \
projects/ENDPOINT_GROUP_PROJECT_ID/locations/global/interceptEndpointGroups/ENDPOINT_GROUP_ID
替换以下内容:
ENDPOINT_GROUP_ASSOCIATION_ID:拦截端点组关联的 ID。NETWORK:网络的名称。ENDPOINT_GROUP_PROJECT_ID:您在其中创建拦截端点组的 Google Cloud 项目的 ID。ENDPOINT_GROUP_ID:拦截端点组的 ID。
Terraform
如需创建拦截端点组关联,您可以使用 google_network_security_intercept_endpoint_group_association 资源。
如需了解如何应用或移除 Terraform 配置,请参阅 基本 Terraform 命令。
查看拦截端点组关联的详细信息
您可以查看拦截端点组关联的详细信息,包括其名称、拦截端点组、位置和网络。
您还可以从 VPC 网络详情页面的端点组 标签页中查看拦截端点组关联的详细信息。
控制台
在 Google Cloud 控制台中,前往端点组页面。
点击拦截端点组的名称。关联 部分列出了拦截端点关联的详细信息。
gcloud
如需查看拦截端点组关联,请使用 gcloud
network-security intercept-endpoint-group-associations describe
命令:
gcloud network-security intercept-endpoint-group-associations describe ENDPOINT_GROUP_ASSOCIATION_ID \
--location global
将 ENDPOINT_GROUP_ASSOCIATION_ID 替换为拦截端点组关联的 ID。
在输出中,拦截端点关联的名称以
以下
projects/PROJECT_ID/locations/global/interceptEndpointGroupAssociations/ENDPOINT_GROUP_ASSOCIATION_ID
格式显示。
列出拦截端点组关联
您可以列出项目中的所有拦截器端点组关联,包括其 ID。
控制台
在 Google Cloud 控制台中,前往端点组页面。
点击拦截端点组的名称。关联 部分列出了拦截端点组的所有拦截端点关联。
gcloud
如需列出项目中的所有拦截端点组关联,请使用
gcloud network-security intercept-endpoint-group-associations list
命令:
gcloud network-security intercept-endpoint-group-associations list
删除拦截端点组关联
您可以删除拦截部署组的拦截端点组关联。
控制台
在 Google Cloud 控制台中,前往端点组页面。
点击拦截端点组的名称。
在关联 部分,选择要删除的拦截端点关联。
点击删除 。
再次点击删除进行确认。
gcloud
如需删除拦截端点组关联,请使用 gcloud
network-security intercept-endpoint-group-associations delete
命令:
gcloud network-security intercept-endpoint-group-associations delete ENDPOINT_GROUP_ASSOCIATION_ID \
--no-async \
--location global
将 ENDPOINT_GROUP_ASSOCIATION_ID 替换为拦截端点组关联的 ID。