限制工作负载的资源用量

本页面介绍如何在 Assured Workloads 文件夹中对不合规资源启用或停用限制。默认情况下,每个文件夹的控制软件包决定了支持哪些产品,从而确定可以使用哪些资源。此功能由创建文件夹时自动应用于文件夹的 gcp.restrictServiceUsage 组织政策限制条件强制执行。

准备工作

所需 IAM 角色

如需修改资源使用限制,必须使用包含更多权限集的预定义角色或仅限于最少必要权限的自定义角色为调用方授予 Identity and Access Management (IAM) 权限。

目标工作负载需要以下权限:

  • assuredworkloads.workload.update
  • orgpolicy.policy.set

以下两个角色拥有这些权限:

  • Assured Workloads Administrator (roles/assuredworkloads.admin)
  • Assured Workloads Editor (roles/assuredworkloads.editor)

如需详细了解 Assured Workloads 的角色,请参阅 IAM 角色

启用资源使用限制

如需为工作负载启用资源使用限制,请运行以下命令。 此命令根据控制软件包支持的服务,对 Assured Workloads 文件夹施加限制:

curl  -d '{ "restrictionType": "ALLOW_COMPLIANT_RESOURCES" }' \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer TOKEN"   -X POST \
      "SERVICE_ENDPOINT/v1/organizations/ORGANIZATION_ID/locations/WORKLOAD_LOCATION/workloads/WORKLOAD_ID:restrictAllowedServices"

将以下占位值替换为您自己的值:

  • TOKEN:请求的身份验证令牌,例如:ya29.a0AfB_byDnQW7A2Vr5...tanw0427

    如果您已在自己的环境中安装了 Google Cloud SDK 并已通过身份验证,则可以使用 gcloud auth print-access-token 命令:-H "Authorization: Bearer $(gcloud auth print-access-token)" -X POST \

  • SERVICE_ENDPOINT:所需的服务端点,例如:https://us-central1-assuredworkloads.googleapis.com

  • ORGANIZATION_ID:Google Cloud 组织的唯一标识符,例如 12321311

  • WORKLOAD_LOCATION:工作负载的位置,例如:us-central1

  • WORKLOAD_ID:工作负载的唯一标识符,例如:00-c25febb1-f3c1-4f19-8965-a25

替换占位符值后,您的请求应类似于以下示例:

curl  -d '{ "restrictionType": "ALLOW_COMPLIANT_RESOURCES" }' \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer ya29.a0AfB_byDnQW7A2Vr5...tanw0427"   -X POST \
      "https://us-central1-assuredworkloads.googleapis.com/v1/organizations/12321311/locations/us-central1/workloads/00-c25febb1-f3c1-4f19-8965-a25:restrictAllowedServices"

如果成功,响应将为空。

停用资源用量限制

如需停用工作负载的资源使用限制,请运行以下命令。 此命令可有效移除 Assured Workloads 文件夹上的所有服务和资源限制:

curl  -d '{ "restrictionType": "ALLOW_ALL_GCP_RESOURCES" }' \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer TOKEN"   -X POST \
      "SERVICE_ENDPOINT/v1/organizations/ORGANIZATION_ID/locations/WORKLOAD_LOCATION/workloads/WORKLOAD_ID:restrictAllowedServices"

将以下占位值替换为您自己的值:

  • TOKEN:请求的身份验证令牌,例如:ya29.a0AfB_byDnQW7A2Vr5...tanw0427

    如果您已在自己的环境中安装了 Google Cloud SDK 并已通过身份验证,则可以使用 gcloud auth print-access-token 命令:-H "Authorization: Bearer $(gcloud auth print-access-token)" -X POST \

  • SERVICE_ENDPOINT:所需的服务端点,例如:https://us-central1-assuredworkloads.googleapis.com

  • ORGANIZATION_ID:Google Cloud 组织的唯一标识符,例如 12321311

  • WORKLOAD_LOCATION:工作负载的位置,例如:us-central1

  • WORKLOAD_ID:工作负载的唯一标识符,例如:00-c25febb1-f3c1-4f19-8965-a25

替换占位符值后,您的请求应类似于以下示例:

curl  -d '{ "restrictionType": "ALLOW_ALL_GCP_RESOURCES" }' \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer ya29.a0AfB_byDnQW7A2Vr5...tanw0427"   -X POST \
      "https://us-central1-assuredworkloads.googleapis.com/v1/organizations/12321311/locations/us-central1/workloads/00-c25febb1-f3c1-4f19-8965-a25:restrictAllowedServices"

如果成功,响应将为空。

支持的产品及不支持的产品

本部分中的表格包含各种控制软件包的支持和不支持的产品。如果启用默认资源使用限制,则只能使用受支持的产品。如果您停用资源使用限制,则可以使用受支持和不受支持的产品。

FedRAMP 中等风险级别

端点 支持的产品 不支持的产品
aiplatform.googleapis.com Vertex AI AI Platform Training and Prediction API

FedRAMP 高风险级别

端点 支持的产品 不支持的产品
compute.googleapis.com
Compute Engine
Persistent Disk
AI Platform Training and Prediction API
Cloud CDN
虚拟私有云 (VPC)
Cloud Interconnect
Cloud Load Balancing
Cloud NAT
Cloud Router
Cloud VPN
Google Cloud Armor
Network Service Tiers

刑事司法信息服务 (CJIS)

端点 支持的产品 不支持的产品
accesscontextmanager.googleapis.com
VPC Service Controls
Access Context Manager
compute.googleapis.com
虚拟私有云 (VPC)
Persistent Disk
Compute Engine
Cloud CDN
Cloud Interconnect
Cloud Load Balancing
Cloud NAT
Cloud Router
Cloud VPN
Google Cloud Armor
Network Service Tiers
cloudkms.googleapis.com
Cloud Key Management Service
Cloud HSM

影响级别 4 (IL4)

端点 支持的产品 不支持的产品
compute.googleapis.com
Compute Engine
Persistent Disk
AI Platform Training and Prediction API
Cloud CDN
虚拟私有云 (VPC)
Cloud Interconnect
Cloud Load Balancing
Cloud NAT
Cloud Router
Cloud VPN
Google Cloud Armor
Network Service Tiers
cloudkms.googleapis.com
Cloud Key Management Service
Cloud HSM

美国区域和支持

端点 支持的产品 不支持的产品
accesscontextmanager.googleapis.com
VPC Service Controls
Access Context Manager
compute.googleapis.com
虚拟私有云 (VPC)
Persistent Disk
Compute Engine
Cloud CDN
Cloud Interconnect
Cloud Load Balancing
Cloud NAT
Cloud Router
Cloud VPN
Google Cloud Armor
Network Service Tiers
cloudkms.googleapis.com
Cloud Key Management Service
Cloud HSM

Service 端点

本部分列出了在启用资源使用限制后未被屏蔽的 API 端点。

API 名称 端点网址
Cloud Asset API cloudasset.googleapis.com
Cloud Logging API logging.googleapis.com
Service Control servicecontrol.googleapis.com
Cloud Monitoring API monitoring.googleapis.com
Google Cloud Observability stackdriver.googleapis.com
Security Token Service API sts.googleapis.com
Identity and Access Management API iam.googleapis.com
Cloud Resource Manager API cloudresourcemanager.googleapis.com
Advisory Notifications API advisorynotifications.googleapis.com
IAM 服务账号凭据 API iamcredentials.googleapis.com
Organization Policy Service API orgpolicy.googleapis.com
Policy Troubleshooter API policytroubleshooter.googleapis.com
Network Telemetry API networktelemetry.googleapis.com
Service Usage API serviceusage.googleapis.com
Service Networking API servicenetworking.googleapis.com
Cloud Billing API cloudbilling.googleapis.com
Service Management API servicemanagement.googleapis.com
Identity Toolkit API identitytoolkit.googleapis.com
Access Context Manager API accesscontextmanager.googleapis.com
Service Consumer Management API serviceconsumermanagement.googleapis.com

后续步骤