בדף הזה מוסבר איך להוסיף כללי מדיניות של הארגון למכונות Cloud SQL, כדי להגביל את Cloud SQL ברמת הפרויקט, התיקייה או הארגון. לסקירה כללית, ראו מדיניות הארגון ב-Cloud SQL.
לפני שמתחילים
- נכנסים לחשבון Google Cloud . אנחנו ממליצים למשתמשים חדשים ב- Google Cloudליצור חשבון כדי שיוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
-
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.
-
Verify that billing is enabled for your Google Cloud project.
-
Install the gcloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init -
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.
-
Verify that billing is enabled for your Google Cloud project.
-
Install the gcloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init - מוסיפים את התפקיד אדמין של מדיניות הארגון (
roles/orgpolicy.policyAdmin) לחשבון המשתמש או לחשבון השירות בדף IAM וניהול. - לפני ביצוע התהליך, קראו את המגבלות.
הוספת מדיניות הארגון של החיבור
לסקירה כללית, ראו כללי מדיניות של הארגון לגבי חיבורים.
כדי להוסיף מדיניות ארגון לחיבור:
נכנסים לדף Organization policies.
לוחצים על התפריט הנפתח של הפרויקטים בכרטיסייה העליונה, ובוחרים את הפרויקט, התיקייה או הארגון שצריך להגדיר להם את מדיניות הארגון. בדף Organization policies מוצגת רשימה של אילוצים זמינים במדיניות הארגון.
מסננים לפי המגבלה
nameאוdisplay_name.כדי להשבית את הגישה לאינטרנט או ממנו:
name: "constraints/sql.restrictPublicIp" display_name: "Restrict Public IP access on Cloud SQL instances"כדי להשבית את הגישה מהאינטרנט כשאין אימות IAM (זה לא משפיע על הגישה באמצעות כתובת IP פרטית):
name: "constraints/sql.restrictAuthorizedNetworks" display_name: "Restrict Authorized Networks on Cloud SQL instances"
בוחרים את שם המדיניות מהרשימה.
לוחצים על Edit.
לוחצים על התאמה אישית.
לוחצים על הוספת כלל.
בקטע אכיפה, לוחצים על מופעל.
לוחצים על Save.
הוספת מדיניות הארגון של CMEK
לסקירה כללית, ראו כללי מדיניות של הארגון בנושא מפתחות הצפנה בניהול הלקוח.
כדי להוסיף מדיניות ארגון לגבי CMEK:
נכנסים לדף Organization policies.
לוחצים על התפריט הנפתח של הפרויקטים בכרטיסייה העליונה, ובוחרים את הפרויקט, התיקייה או הארגון שצריך להגדיר להם את מדיניות הארגון. בדף Organization policies מוצגת רשימה של אילוצים זמינים במדיניות הארגון.
מסננים לפי המגבלה
nameאוdisplay_name.כדי להוסיף שמות של שירותים לרשימת דחייה, כדי לוודא שנעשה שימוש ב-CMEK במשאבים של השירות הזה:
name: "constraints/gcp.restrictNonCmekServices" display_name: "Restrict which services may create resources without CMEK"צריך להוסיף את
sqladmin.googleapis.comלרשימת השירותים המוגבלים עם Deny.כדי להוסיף מזהי פרויקטים לרשימת היתרים, כדי לוודא שרק מפתחות ממכונה של Cloud KMS באותו פרויקט ישמשו ל-CMEK.
name: "constraints/gcp.restrictCmekCryptoKeyProjects" display_name: "Restrict which projects may supply KMS CryptoKeys for CMEK"
בוחרים את שם המדיניות מהרשימה.
לוחצים על Edit.
לוחצים על התאמה אישית.
לוחצים על הוספת כלל.
בקטע ערכי מדיניות, לוחצים על בהתאמה אישית.
ב
constraints/gcp.restrictNonCmekServices: א. בקטע Policy types, בוחרים באפשרות Deny. ב. בקטע ערכים בהתאמה אישית, מזינים אתsqladmin.googleapis.com.ב
constraints/gcp.restrictCmekCryptoKeyProjects: א. בקטע סוגי מדיניות, בוחרים באפשרות אישור. ב. בקטע Custom values, מזינים את המשאב בפורמט הבא:under:organizations/ORGANIZATION_ID,under:folders/FOLDER_IDאוprojects/PROJECT_ID.לוחצים על סיום.
לוחצים על Save.
המאמרים הבאים
- מידע על מדיניות הארגון
- מידע ולמידה על איך כתובת IP פרטית פועלת עם Cloud SQL.
- איך מגדירים כתובת IP פרטית ב-Cloud SQL
- מידע ולמידה על שירות מדיניות הארגון
- מידע ולמידה על אילוצים של מדיניות הארגון