保护服务边界中的代码库

VPC Service Controls 可帮助您降低未经授权从 Google 托管服务中复制或转移数据的风险。

借助 VPC Service Controls,您可以为 Google 托管服务的资源配置安全边界,并控制跨边界的数据移动。

搭配使用 Artifact Registry 与 VPC Service Controls

如果您在服务边界内的项目中使用 Artifact Registry 和 Google Kubernetes Engine 专用集群,您可以访问服务边界内的容器映像以及 Google 提供的映像

存储在 mirror.gcr.io 上的缓存 Docker Hub 映像不包含在服务边界内,除非添加了出站规则以允许流向托管 mirror.gcr.io 的 Artifact Registry Docker 缓存的出站流量。

如需在服务边界内使用 mirror.gcr.io,请添加以下出站规则:

- egressTo:
    operations:
    - serviceName: artifactregistry.googleapis.com
      methodSelectors:
      - method: artifactregistry.googleapis.com/DockerRead
    resources:
    - projects/342927644502
  egressFrom:
    identityType: ANY_IDENTITY

如需详细了解入站和出站规则,请参阅入站和出站规则

您可以使用默认 Google API 和服务网域的 IP 地址或以下特殊 IP 地址访问 Artifact Registry:

  • 199.36.153.4/30 (restricted.googleapis.com)
  • 199.36.153.8/30 (private.googleapis.com)

如需详细了解这些选项,请参阅配置专用 Google 访问通道。如需查看使用 199.36.153.4/30 (restricted.googleapis.com) 的示例配置,请参阅使用虚拟 IP 进行注册表访问文档。

确保需要访问 Artifact Registry 的 Google Cloud 服务也位于服务边界内,包括 Binary Authorization、Artifact Analysis 以及 Google Kubernetes Engine 和 Cloud Run 等运行时环境。请参阅支持的服务列表,详细了解每项服务。

如需了解如何将 Artifact Registry 添加到服务边界,请参阅创建服务边界

将 Artifact Analysis 与 VPC Service Controls 配合使用

如需了解如何将 Artifact Analysis 添加到边界,请参阅在服务边界内保护 Artifact Analysis