תפקידים והרשאות של IAM

בקרת הגישה ב-Cloud Build מבוססת על ניהול זהויות והרשאות גישה (IAM). בעזרת IAM אפשר ליצור ולנהל הרשאות למשאבים של Google Cloud . שירות Cloud Build מספק קבוצה ספציפית של תפקידי IAM מוגדרים מראש, שכל אחד מהם מכיל קבוצה של הרשאות. אתם יכולים להשתמש בתפקידים האלה כדי לתת גישה פרטנית יותר למשאבים ספציפיים ב- Google Cloud ולמנוע גישה לא רצויה למשאבים אחרים. בעזרת IAM תוכלו לשמור על עקרון האבטחה של הרשאות מינימליות, וכך לתת רק למי שצריך את רמת הגישה שצריך למשאבים השונים.

בדף הזה מוסבר על התפקידים וההרשאות ב-Cloud Build.

תפקידים מוגדרים מראש ב-Cloud Build

באמצעות IAM, כל method ב-Cloud Build API דורשת שלזהות שממנה הגיעה בקשת ה-API יהיו ההרשאות המתאימות לשימוש במשאב. ההרשאות ניתנות על ידי הגדרת מדיניות שמעניקה תפקידים לחשבון (משתמש, קבוצה או חשבון שירות). אתם יכולים להקצות לאותו חשבון משתמש כמה תפקידים באותו משאב.

בטבלה הבאה מפורטים תפקידי IAM ב-Cloud Build וההרשאות שכלולים בהם:

תפקיד תיאור הרשאות
שם: roles/cloudbuild.builds.viewer
שם התפקיד: Cloud Build Viewer
יכול להציג את Cloud Build

משאבים

cloudbuild.builds.get

cloudbuild.builds.list

cloudbuild.locations.get

cloudbuild.locations.list

cloudbuild.operations.get

cloudbuild.operations.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 Integrations Viewer
יכול להציג את 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 Integrations Owner
שליטה מלאה ב-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 Connection Viewer
אפשרות לראות את החיבורים וליצור רשימה שלהם

ומאגרי נתונים

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 Connection Admin
הרשאה לנהל חיבורים

ומאגרי נתונים

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 Read Only Token Accessor
יכולים לראות את החיבור, את המאגרים שלו,

ולגשת לטוקן לקריאה בלבד

cloudbuild.connections.get

cloudbuild.repositories.get

cloudbuild.repositories.accessReadToken

שם:roles/cloudbuild.tokenAccessor
שם: Cloud Build Token Accessor
יכולים לראות את החיבור, את המאגרים שלו,

ולגשת לטוקן לקריאה בלבד ולטוקן לקריאה ולכתיבה

cloudbuild.connections.get

cloudbuild.repositories.get

cloudbuild.repositories.accessReadToken

cloudbuild.repositories.accessReadWriteToken

שם: roles/cloudbuild.workerPoolOwner
שם: Cloud Build WorkerPool Owner
שליטה מלאה בבריכה הפרטית 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 WorkerPool
אפשר לעדכן את המידע על בריכות פרטיות cloudbuild.workerpools.get

cloudbuild.workerpools.list

cloudbuild.workerpools.update

resourcemanager.projects.get

resourcemanager.projects.list

שם: roles/cloudbuild.workerPoolViewer
שם תצוגה: Cloud Build WorkerPool Viewer
אפשר לצפות בבריכות פרטיות cloudbuild.workerpools.get

cloudbuild.workerpools.list

resourcemanager.projects.get

resourcemanager.projects.list

שם: roles/cloudbuild.workerPoolUser
שם תפקיד: Cloud Build WorkerPool User
יכול להריץ בנייה במאגר הפרטי cloudbuild.workerpools.use

בנוסף לתפקידים המוגדרים מראש של Cloud Build שצוינו למעלה, התפקידים הבסיסיים Viewer,‏ Editor ו-Owner כוללים גם הרשאות שקשורות ל-Cloud Build. עם זאת, מומלץ להקצות תפקידים מוגדרים מראש ככל האפשר כדי לעמוד בדרישות עקרון האבטחה של הרשאות מינימליות.

בטבלה הבאה מפורטים התפקידים הבסיסיים ותפקידי ה-IAM ב-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

הרשאות

בטבלה הבאה מפורטות ההרשאות שנדרשות למבצע הקריאה החוזרת (caller) כדי להפעיל קריאה לכל method:

שיטת ה-API ההרשאה שנדרשת שם התפקיד
builds.create()
triggers.create()
triggers.patch()
triggers.delete()
triggers.run()
cloudbuild.builds.create עריכה ב-Cloud Build
builds.cancel() cloudbuild.builds.update עריכה ב-Cloud Build
builds.get()
triggers.get()
cloudbuild.builds.get עריכה ב-Cloud Build, צפייה ב-Cloud Build
builds.list()
triggers.list()
cloudbuild.builds.list עריכה ב-Cloud Build, צפייה ב-Cloud Build

הרשאות לצפייה ביומני בנייה

כדי לצפות ביומני בנייה, נדרשות הרשאות נוספות בהתאם למיקום שבו מאוחסנים יומני הבנייה: בקטגוריה של Cloud Storage שמוגדרת כברירת מחדל או בקטגוריה של Cloud Storage שמוגדרת על ידי המשתמש. מידע נוסף על ההרשאות שנדרשות כדי לצפות ביומני build זמין במאמר אחסון וצפייה ביומני build.

המאמרים הבאים