איך פועלת Workload Identity מנוהלת
Managed Workload Identity נותן לעומסי העבודה ב-Compute Engine וב-GKE זהות מאומתת, יחד עם אישור וישויות עוגן אמינות שעומסי העבודה משתמשים בהם כדי לאמת זה את זה באמצעות Mutual TLS (mTLS). זהויות מנוהלות של Workload Identity מקובצות במאגר זהויות של עומסי עבודה, שמשמש כגבול האמון של הזהויות שבו.
כשמקשרים מאגר זהויות של עומסי עבודה למאגר של שירות CA, המערכת מנפיקה ומחדשת באופן אוטומטי אישורים לעומסי העבודה שלכם ב-Google Cloud . האוטומציה הזו מבטלת את הצורך בניהול ידני של פרטי הכניסה ומונעת הפסקות בשירות.
לפני שמתחילים
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Compute Engine, Certificate Manager, Certificate Authority Service APIs, if any are not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.- מוודאים שיש לכם מאגר זהויות של עומסי עבודה עם Workload Identity מנוהלות. מידע נוסף זמין במאמרים הגדרת אימות מנוהל של Workload Identity ב-Compute Engine או הגדרת אימות מנוהל של Workload Identity ב-GKE.
- מוודאים שיש לכם מאגר קיים של שירות CA שיכול להנפיק אישורים לעומסי העבודה שלכם. מידע נוסף זמין במאמר יצירת מאגר CA.
התפקידים הנדרשים
כדי לקבל את ההרשאות שדרושות להגדרת ניהול מחזור החיים, בקשו מהאדמין לתת לכם את התפקידים הבאים ב-IAM ברמת הפרויקט:
- עריכה ב-Certificate Manager (
roles/certificatemanager.editor) - מנהל האישורים של שירות CA (
roles/privateca.certificateManager) - אדמין במאגר זהויות של עומסי עבודה (
roles/iam.workloadIdentityPoolAdmin)
להסבר על מתן תפקידים, ראו איך מנהלים את הגישה ברמת הפרויקט, התיקייה והארגון.
יכול להיות שאפשר לקבל את ההרשאות הנדרשות גם באמצעות תפקידים בהתאמה אישית או תפקידים מוגדרים מראש.
הגדרת מחזור החיים של עומסי עבודה מנוהלים
מגדירים מאגר זהויות של עומסי עבודה מנוהל כדי לציין איך עומסי העבודה המשויכים מקבלים ומחדשים אישורים מהמאגר הקיים של שירות ה-CA.
- נכנסים לדף Certificate Manager (2nd gen) במסוף Google Cloud .
- בחלונית הניווט, לוחצים על Manage Lifecycle.
- לוחצים על הכרטיסייה Managed Workload Identity.
- מאתרים את מאגר הזהויות של עומסי העבודה שרוצים להגדיר ולוחצים על Configure lifecycle management.
- בוחרים את האזור (Region) ואת מאגר ה-CA (CA pool) של האזור.
- בשדה Certificate lifetime, מציינים את משך התוקף של האישור שהונפק. הערך צריך להיות בין 21 ל-30 ימים.
- מגדירים את חלון הרוטציה לערך בין 50 ל-80. זהו אחוז משך החיים של האישור שמפעיל את החידוש.
- בשדה Key algorithm, בוחרים את אלגוריתם ההצפנה שבו רוצים להשתמש כדי ליצור את המפתח הפרטי.
- לוחצים על עדכון.