Artifact Registry Service Agent 在与 Google Cloud 服务交互时代表 Artifact Registry 行事。
在Google Cloud 项目中创建第一个 Artifact Registry 仓库后,系统会自动创建 Artifact Registry 服务代理。服务代理标识符为:
service-PROJECT-NUMBER@gcp-sa-artifactregistry.iam.gserviceaccount.com
PROJECT-NUMBER 是Google Cloud 项目(Artifact Registry 运行所在的项目)的项目编号。
您可以使用以下命令在没有任何存储库的项目中手动创建服务代理:
gcloud beta services identity create \
--service=artifactregistry.googleapis.com \
--project=PROJECT-ID
将 PROJECT-ID 替换为 Google Cloud 项目 ID。
系统会为 Artifact Registry Service Agent 授予项目内资源的 Artifact Registry Service Agent 角色 (roles/artifactregistry.serviceAgent)。为了强制执行最小权限原则安全原则,该角色仅具有最低必需权限:
- 发布 Pub/Sub 主题:
pubsub.topics.publish - 从 Artifact Registry 制品库下载制品:
artifactregistry.repositories.downloadArtifacts - 读取代码库元数据:
artifactregistry.repositories.get - 使用虚拟仓库读取工件:
artifactregistry.repositories.readViaVirtualRepository - 删除制品:
artifactregistry.versions.delete
后续步骤
了解 Artifact Registry 角色以及如何配置对存储库的访问。