提供意見
身分與存取權管理角色和權限
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Cloud Build 中的存取權控管使用 身分與存取權管理 (IAM) 控管。IAM 可讓您建立及管理 Google Cloud 資源的權限。Cloud Build 提供一組特定的預先定義 IAM 角色 ,每個角色都包含一組權限。您可以使用這些角色,對特定 Google Cloud 資源授予更精細的存取權,並避免其他資源遭到未經授權者擅自存取。IAM 能讓您採用最低權限安全性原則 ,僅授予必要的資源存取權限給使用者。
本頁面說明 Cloud Build 角色和權限。
預先定義的 Cloud Build 角色
透過身分與存取權管理功能,Cloud Build API 中的每個 API 方法都要求提出 API 要求的身分具備使用該資源的適當權限。只要設定政策將角色授予實體 (使用者、群組或服務帳戶),即可授予權限。您可以將多個角色授予相同資源中的單一實體。
下表列出 Cloud Build 身分與存取權管理角色,以及這些角色所具備的權限:
角色
說明
權限
名稱 :roles/cloudbuild.builds.viewer
標題 :Cloud Build Viewer
可查看 Cloud Build資源
cloudbuild.builds.get
cloudbuild.builds.list
remotebuildexecution.blobs.get
resourcemanager.projects.get
resourcemanager.projects.list
名稱 :roles/cloudbuild.builds.editor
標題 :Cloud Build 編輯器
具備 Cloud Build 的完整控管權限資源
cloudbuild.builds.create
cloudbuild.builds.get
cloudbuild.builds.list
cloudbuild.builds.update
remotebuildexecution.blobs.get
resourcemanager.projects.get
resourcemanager.projects.list
名稱 :roles/cloudbuild.builds.approver
職稱 :Cloud Build 核准者
提供存取權,以便核准或拒絕待處理的建構作業
cloudbuild.builds.approve
cloudbuild.builds.get
cloudbuild.builds.list
remotebuildexecution.blobs.get
resourcemanager.projects.get
resourcemanager.projects.list
名稱 :roles/cloudbuild.builds.builder
標題 :Cloud Build 舊版服務帳戶
為專案啟用 Cloud Build API 時, Cloud Build 舊版服務帳戶 會自動在專案 中建立,並授予專案中資源 的這個角色。Cloud Build 舊版服務帳戶只會在執行建構作業時,在需要執行動作時使用這個角色。
如需查看這個角色包含的權限清單,請參閱「預設 Cloud Build 服務帳戶 」。
名稱 :roles/cloudbuild.integrationsViewer
標題 :Cloud Build 整合作業檢視器
可查看 Cloud Build 主機連線
cloudbuild.integrations.get
cloudbuild.integrations.list
resourcemanager.projects.get
resourcemanager.projects.list
名稱 :roles/cloudbuild.integrationsEditor
職稱 :Cloud Build 整合作業編輯者
編輯 Cloud Build 控制項 主機連線
cloudbuild.integrations.get
cloudbuild.integrations.list
cloudbuild.integrations.update
resourcemanager.projects.get
resourcemanager.projects.list
姓名 :roles/cloudbuild.integrationsOwner
職稱 :Cloud Build 整合作業擁有者
具備 Cloud Build 的完整控管權限 主機連線
cloudbuild.integrations.create
cloudbuild.integrations.delete
cloudbuild.integrations.get
cloudbuild.integrations.list
cloudbuild.integrations.update
compute.firewalls.create
compute.firewalls.get
compute.firewalls.list
compute.networks.get
compute.networks.updatePolicy
compute.regions.get
compute.subnetworks.get
compute.subnetworks.list
resourcemanager.projects.get
resourcemanager.projects.list
名稱 :roles/cloudbuild.connectionViewer
標題 :Cloud Build 連線檢視器
可查看及列出連線 和存放區
resourcemanager.projects.get
resourcemanager.projects.list
cloudbuild.connections.get
cloudbuild.connections.fetchLinkableRepositories
cloudbuild.connections.list
cloudbuild.connections.getIamPolicy
cloudbuild.repositories.get
cloudbuild.repositories.list
名稱 :roles/cloudbuild.connectionAdmin
職稱 :Cloud Build 連線管理員
可管理連線 和存放區
resourcemanager.projects.get
resourcemanager.projects.list
cloudbuild.connections.get
cloudbuild.connections.fetchLinkableRepositories
cloudbuild.connections.list
cloudbuild.connections.create
cloudbuild.connections.update
cloudbuild.connections.delete
cloudbuild.connections.getIamPolicy
cloudbuild.connections.setIamPolicy
cloudbuild.repositories.get
cloudbuild.repositories.list
cloudbuild.repositories.create
cloudbuild.repositories.delete
名稱 :roles/cloudbuild.readTokenAccessor
標題 :Cloud Build 唯讀權杖存取者
可查看連線、其存放區和 並存取其唯讀權杖
cloudbuild.connections.get
cloudbuild.repositories.get
cloudbuild.repositories.accessReadToken
名稱 :roles/cloudbuild.tokenAccessor
標題 :Cloud Build 權杖存取工具
可查看連線、其存放區和 並存取其唯讀和讀取/寫入權杖
cloudbuild.connections.get
cloudbuild.repositories.get
cloudbuild.repositories.accessReadToken
cloudbuild.repositories.accessReadWriteToken
名稱 :roles/cloudbuild.workerPoolOwner
職稱 :Cloud Build 工作站集區擁有者
完全控管私人集區
cloudbuild.workerpools.create
cloudbuild.workerpools.delete
cloudbuild.workerpools.get
cloudbuild.workerpools.list
cloudbuild.workerpools.update
resourcemanager.projects.get
resourcemanager.projects.list
名稱 :roles/cloudbuild.workerPoolEditor
職稱 :Cloud Build 工作站集區編輯者
可以更新私人集區
cloudbuild.workerpools.get
cloudbuild.workerpools.list
cloudbuild.workerpools.update
resourcemanager.projects.get
resourcemanager.projects.list
名稱 :roles/cloudbuild.workerPoolViewer
標題 :Cloud Build 工作站集區檢視器
可查看私人集區
cloudbuild.workerpools.get
cloudbuild.workerpools.list
resourcemanager.projects.get
resourcemanager.projects.list
名稱 :roles/cloudbuild.workerPoolUser
標題 :Cloud Build 工作站集區使用者
可以在私人集區中執行建構作業
cloudbuild.workerpools.use
除了上述 Cloud Build 預先定義的角色外,基本 檢視者、編輯者和擁有者角色也包含與 Cloud Build 相關的權限。不過,建議您盡可能授予預先定義的角色,以符合最低權限安全性原則 。
下表列出基本角色,以及這些角色所具備的 Cloud Build 身分與存取權管理角色。
角色
具備的角色
roles/viewer
roles/cloudbuild.builds.viewer
、roles/cloudbuild.integrations.viewer
roles/editor
roles/cloudbuild.builds.editor
、roles/cloudbuild.integrations.editor
roles/owner
roles/cloudbuild.integrations.owner
注意: 擁有者、編輯者和檢視者具備許多其他 Google Cloud服務的權限。擁有者角色會自動授予原始專案建立者。 權限
下表列出了呼叫者在呼叫每個方法時必須具備的權限:
注意: cloudbuild.builds.create
權限可讓使用者以 Cloud Build 舊版服務帳戶 的身分執行建構作業。Cloud Build 編輯者、專案擁有者和專案編輯者角色都具備這項權限。授予使用者任何這些角色,即可讓他們以 Cloud Build 舊版服務帳戶的身分執行建構作業。視授予使用者的 IAM 權限和 Cloud Build 舊版服務帳戶的權限而定,這可能會為使用者啟用升級的建構時間權限。 查看建構記錄的權限
如要查看版本記錄,您需要具備其他權限,具體取決於您是將版本記錄儲存在預設 Cloud Storage 值區,還是儲存在使用者指定的 Cloud Storage 值區。如要進一步瞭解查看建構記錄所需的權限,請參閱「儲存及查看建構記錄 」。
後續步驟
提供意見
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權 ,程式碼範例則為阿帕契 2.0 授權 。詳情請參閱《Google Developers 網站政策 》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-06-09 (世界標準時間)。
想進一步說明嗎?
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-06-09 (世界標準時間)。"],[[["Cloud Build utilizes Identity and Access Management (IAM) to manage permissions for Google Cloud resources, allowing for granular control and adherence to the principle of least privilege."],["There are several predefined Cloud Build IAM roles, including Viewer, Editor, Approver, and various roles for Integrations and WorkerPools, each with specific permissions to control different aspects of Cloud Build."],["Basic roles like Viewer, Editor, and Owner also include Cloud Build permissions, but using the specific Cloud Build predefined roles is recommended for enhanced security."],["Certain API methods within Cloud Build, such as `builds.create` and `builds.get`, require specific permissions, which are associated with particular Cloud Build roles like Editor or Viewer."],["The Cloud Build legacy service account is automatically created when the API is enabled and is given permissions to run builds, and granting users roles with `cloudbuild.builds.create` permission will enable them to run builds as the service account."]]],[]]