בקרת גישה באמצעות IAM

‫Cloud Tasks משתמש בניהול זהויות והרשאות גישה (IAM) לבקרת גישה. סקירה כללית על IAM במאמר ניהול הגישה לפרויקטים, לתיקיות ולארגונים מוסבר איך מעניקים ומבטלים גישה.

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

כדי להפעיל כל method ב-Cloud Tasks, צריך את ההרשאות הנדרשות. בדף הזה מוסבר על ההרשאות והתפקידים שנתמכים ב-Cloud Tasks. ההרשאות נבדקות גם כשמעדכנים את queue.yaml (או את קובץ queue.xml מדור קודם) או כשמשתמשים במסוף Google Cloud .

הפעלת Cloud Tasks API

כדי להציג ולהקצות תפקידי IAM ל-Cloud Tasks, צריך להפעיל את Cloud Tasks API בפרויקט. לא תוכלו לראות את התפקידים של Cloud Tasks במסוף Google Cloud עד שתפעילו את ה-API.

המסוף

מפעילים את Cloud Tasks API.

תפקידים שנדרשים להפעלת ממשקי API

כדי להפעיל ממשקי API, צריך את תפקיד ה-IAM 'אדמין של Service Usage' (roles/serviceusage.serviceUsageAdmin), שכולל את ההרשאה serviceusage.services.enable. איך מקצים תפקידים

להפעלת ה-API

gcloud

מפעילים את Cloud Tasks API:

תפקידים שנדרשים להפעלת ממשקי API

כדי להפעיל ממשקי API, צריך את תפקיד ה-IAM 'אדמין של Service Usage' (roles/serviceusage.serviceUsageAdmin), שכולל את ההרשאה serviceusage.services.enable. איך מקצים תפקידים

gcloud services enable cloudtasks.googleapis.com

תפקידים מוגדרים מראש

בטבלה הבאה מפורטים התפקידים המוגדרים מראש ב-IAM של Cloud Tasks וההרשאות התואמות שלהם.

התפקידים שמוגדרים מראש מתאימים לרוב התרחישים הנפוצים. אם התפקידים המוגדרים מראש לא מתאימים לתרחיש השימוש שלכם, תוכלו ליצור תפקיד IAM בהתאמה אישית.

Role Permissions

(roles/cloudtasks.admin)

Full access to queues and tasks.

cloudtasks.*

  • cloudtasks.cmekConfig.get
  • cloudtasks.cmekConfig.update
  • cloudtasks.locations.get
  • cloudtasks.locations.list
  • cloudtasks.queues.create
  • cloudtasks.queues.delete
  • cloudtasks.queues.get
  • cloudtasks.queues.getIamPolicy
  • cloudtasks.queues.list
  • cloudtasks.queues.pause
  • cloudtasks.queues.purge
  • cloudtasks.queues.resume
  • cloudtasks.queues.setIamPolicy
  • cloudtasks.queues.update
  • cloudtasks.tasks.create
  • cloudtasks.tasks.delete
  • cloudtasks.tasks.fullView
  • cloudtasks.tasks.get
  • cloudtasks.tasks.list
  • cloudtasks.tasks.run

monitoring.timeSeries.list

resourcemanager.projects.get

resourcemanager.projects.list

(roles/cloudtasks.editor)

Editor role for cloudtasks

cloudtasks.cmekConfig.get

cloudtasks.locations.*

  • cloudtasks.locations.get
  • cloudtasks.locations.list

cloudtasks.queues.create

cloudtasks.queues.delete

cloudtasks.queues.get

cloudtasks.queues.list

cloudtasks.queues.pause

cloudtasks.queues.purge

cloudtasks.queues.resume

cloudtasks.queues.update

cloudtasks.tasks.*

  • cloudtasks.tasks.create
  • cloudtasks.tasks.delete
  • cloudtasks.tasks.fullView
  • cloudtasks.tasks.get
  • cloudtasks.tasks.list
  • cloudtasks.tasks.run

monitoring.timeSeries.list

resourcemanager.projects.get

resourcemanager.projects.list

(roles/cloudtasks.viewer)

Get and list access to tasks, queues, and locations.

cloudtasks.cmekConfig.get

cloudtasks.locations.*

  • cloudtasks.locations.get
  • cloudtasks.locations.list

cloudtasks.queues.get

cloudtasks.queues.list

cloudtasks.tasks.fullView

cloudtasks.tasks.get

cloudtasks.tasks.list

monitoring.timeSeries.list

resourcemanager.projects.get

resourcemanager.projects.list

(roles/cloudtasks.enqueuer)

Access to create tasks.

cloudtasks.tasks.create

cloudtasks.tasks.fullView

resourcemanager.projects.get

resourcemanager.projects.list

(roles/cloudtasks.queueAdmin)

Admin access to queues.

cloudtasks.locations.*

  • cloudtasks.locations.get
  • cloudtasks.locations.list

cloudtasks.queues.*

  • cloudtasks.queues.create
  • cloudtasks.queues.delete
  • cloudtasks.queues.get
  • cloudtasks.queues.getIamPolicy
  • cloudtasks.queues.list
  • cloudtasks.queues.pause
  • cloudtasks.queues.purge
  • cloudtasks.queues.resume
  • cloudtasks.queues.setIamPolicy
  • cloudtasks.queues.update

resourcemanager.projects.get

resourcemanager.projects.list

(roles/cloudtasks.taskDeleter)

Access to delete tasks.

cloudtasks.tasks.delete

resourcemanager.projects.get

resourcemanager.projects.list

(roles/cloudtasks.taskRunner)

Access to run tasks.

cloudtasks.tasks.fullView

cloudtasks.tasks.run

resourcemanager.projects.get

resourcemanager.projects.list

Service agent roles

Service agent roles should only be granted to service agents.

Role Permissions

(roles/cloudtasks.serviceAgent)

Grants Cloud Tasks Service Account access to manage resources.

iam.serviceAccounts.getAccessToken

iam.serviceAccounts.getOpenIdToken

logging.logEntries.create

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