Artifact Registry Service Agent 是 Google 代管式服务帐号,在与 Google Cloud 服务交互时代表 Artifact Registry 执行操作。
当您在 Google Cloud 项目中创建第一个 Artifact Registry 代码库时,系统会自动创建 Artifact Registry Service Agent。服务代理标识符为:
service-PROJECT-NUMBER@gcp-sa-artifactregistry.iam.gserviceaccount.com
PROJECT-NUMBER 是运行 Artifact Registry 的 Google Cloud 项目的编号。
您可以在没有任何代码库的情况下使用以下命令在项目中手动创建服务帐号:
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.versions.delete
后续步骤
了解 Artifact Registry 角色并配置对代码库的访问权限。