בדף הזה מוסבר איך ליצור, להגדיר ולנהל אילוצים בהתאמה אישית במכונות של Cloud SQL. סקירה כללית של מדיניות ארגונית מותאמת אישית זמינה במאמר מדיניות ארגונית מותאמת אישית.
משאבים נתמכים ב-Cloud SQL
בדף הזה מוסבר איך להשתמש באילוצים בהתאמה אישית של שירות מדיניות הארגון כדי להגביל פעולות ספציפיות במשאבים הבאים של Google Cloud :
sqladmin.googleapis.com/Instancesqladmin.googleapis.com/BackupRun
מידע נוסף על מדיניות הארגון בהתאמה אישית
מידע על כללי מדיניות ואילוצים של הארגון
שירות Google Cloud מדיניות הארגון מאפשר לכם לקבל שליטה מרוכזת ופרוגרמטית על המשאבים של הארגון. אדמינים של מדיניות הארגון יכולים להגדיר מדיניות ארגונית, שהיא קבוצה של הגבלות שנקראות אילוצים, שחלות על משאבים ב-Google Cloud ועל משאבי צאצא של המשאבים האלה בGoogle Cloud היררכיית המשאבים. אפשר לאכוף את מדיניות הארגון ברמת הארגון, התיקייה או הפרויקט.
מדיניות הארגון מספקת אילוצים מנוהלים מובְנים לשירותים שונים של Google Cloud . עם זאת, אם אתם רוצים שליטה מפורטת יותר ומותאמת אישית בשדות הספציפיים שמוגבלים במדיניות הארגון, אתם יכולים גם ליצור אילוצים מותאמים אישית ולהשתמש בהם במדיניות הארגון.
העברת מדיניות בירושה
כברירת מחדל, מדיניות הארגון עוברת בירושה לצאצאים של המשאבים שעליהם אתם אוכפים את המדיניות. לדוגמה, אם אוכפים מדיניות בתיקייה, Google Cloud המדיניות נאכפת בכל הפרויקטים בתיקייה. כאן אפשר לקרוא מידע נוסף על ההתנהגות הזו ועל שינוי שלה.
לפני שמתחילים
- נכנסים לחשבון 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 - מוודאים שאתם יודעים מהו מזהה הארגון.
התפקידים הנדרשים
כדי לקבל את ההרשאות שדרושות לניהול מדיניות ארגונית בהתאמה אישית, צריך לבקש מהאדמין להקצות לכם את תפקיד ה-IAM Organization Policy Administrator (אדמין של מדיניות ארגונית) (roles/orgpolicy.policyAdmin) במשאב הארגון.
כדי לקרוא הסבר על מתן תפקידים, ראו איך מנהלים את הגישה ברמת הפרויקט, התיקייה והארגון.
יכול להיות שאפשר לקבל את ההרשאות הנדרשות גם באמצעות תפקידים בהתאמה אישית או תפקידים מוגדרים מראש.
משאבים נתמכים ב-Cloud SQL ל-MySQL
בטבלה הבאה מפורטים המשאבים של Cloud SQL ל-MySQL שאפשר להפנות אליהם באילוצים מותאמים אישית.| משאב | שדה |
|---|---|
| sqladmin.googleapis.com/BackupRun |
resource.description
|
resource.location
| |
| sqladmin.googleapis.com/Instance |
resource.databaseVersion
|
resource.diskEncryptionConfiguration.kmsKeyName
| |
resource.diskEncryptionStatus.kmsKeyVersionName
| |
resource.failoverReplica.name
| |
resource.masterInstanceName
| |
resource.name
| |
resource.nodeCount
| |
resource.project
| |
resource.region
| |
resource.replicaConfiguration.cascadableReplica
| |
resource.replicaConfiguration.failoverTarget
| |
resource.settings.activationPolicy
| |
resource.settings.activeDirectoryConfig.domain
| |
resource.settings.advancedMachineFeatures.threadsPerCore
| |
resource.settings.availabilityType
| |
resource.settings.backupConfiguration.backupRetentionSettings.retainedBackups
| |
resource.settings.backupConfiguration.backupRetentionSettings.retentionUnit
| |
resource.settings.backupConfiguration.binaryLogEnabled
| |
resource.settings.backupConfiguration.enabled
| |
resource.settings.backupConfiguration.location
| |
resource.settings.backupConfiguration.pointInTimeRecoveryEnabled
| |
resource.settings.backupConfiguration.startTime
| |
resource.settings.backupConfiguration.transactionLogRetentionDays
| |
resource.settings.collation
| |
resource.settings.connectionPoolConfig.connectionPoolingEnabled
| |
resource.settings.connectionPoolConfig.flags.name
| |
resource.settings.connectionPoolConfig.flags.value
| |
resource.settings.connectorEnforcement
| |
resource.settings.databaseFlags.name
| |
resource.settings.databaseFlags.value
| |
resource.settings.dataCacheConfig.dataCacheEnabled
| |
resource.settings.dataDiskProvisionedIops
| |
resource.settings.dataDiskProvisionedThroughput
| |
resource.settings.dataDiskSizeGb
| |
resource.settings.dataDiskType
| |
resource.settings.deletionProtectionEnabled
| |
resource.settings.denyMaintenancePeriods.endDate
| |
resource.settings.denyMaintenancePeriods.startDate
| |
resource.settings.denyMaintenancePeriods.time
| |
resource.settings.edition
| |
resource.settings.enableDataplexIntegration
| |
resource.settings.enableGoogleMlIntegration
| |
resource.settings.insightsConfig.queryInsightsEnabled
| |
resource.settings.insightsConfig.queryPlansPerMinute
| |
resource.settings.insightsConfig.queryStringLength
| |
resource.settings.insightsConfig.recordApplicationTags
| |
resource.settings.insightsConfig.recordClientAddress
| |
resource.settings.ipConfiguration.authorizedNetworks.name
| |
resource.settings.ipConfiguration.authorizedNetworks.value
| |
resource.settings.ipConfiguration.customSubjectAlternativeNames
| |
resource.settings.ipConfiguration.enablePrivatePathForGoogleCloudServices
| |
resource.settings.ipConfiguration.ipv4Enabled
| |
resource.settings.ipConfiguration.privateNetwork
| |
resource.settings.ipConfiguration.pscConfig.allowedConsumerProjects
| |
resource.settings.ipConfiguration.pscConfig.pscAutoConnections.consumerNetwork
| |
resource.settings.ipConfiguration.pscConfig.pscAutoConnections.consumerProject
| |
resource.settings.ipConfiguration.pscConfig.pscEnabled
| |
resource.settings.ipConfiguration.serverCaMode
| |
resource.settings.ipConfiguration.serverCaPool
| |
resource.settings.ipConfiguration.sslMode
| |
resource.settings.locationPreference.secondaryZone
| |
resource.settings.locationPreference.zone
| |
resource.settings.maintenanceWindow.day
| |
resource.settings.maintenanceWindow.hour
| |
resource.settings.maintenanceWindow.updateTrack
| |
resource.settings.passwordValidationPolicy.complexity
| |
resource.settings.passwordValidationPolicy.disallowUsernameSubstring
| |
resource.settings.passwordValidationPolicy.enablePasswordPolicy
| |
resource.settings.passwordValidationPolicy.minLength
| |
resource.settings.passwordValidationPolicy.passwordChangeInterval
| |
resource.settings.passwordValidationPolicy.reuseInterval
| |
resource.settings.replicationLagMaxSeconds
| |
resource.settings.retainBackupsOnDelete
| |
resource.settings.sqlServerAuditConfig.bucket
| |
resource.settings.sqlServerAuditConfig.retentionInterval
| |
resource.settings.sqlServerAuditConfig.uploadInterval
| |
resource.settings.storageAutoResize
| |
resource.settings.tier
| |
resource.settings.timeZone
|
הגדרת אילוץ בהתאמה אישית
אילוץ בהתאמה אישית מוגדר בקובץ YAML לפי המשאבים, השיטות, התנאים והפעולות שנתמכים בשירות שבו אתם אוכפים את מדיניות הארגון. התנאים של האילוצים המותאמים אישית מוגדרים באמצעות Common Expression Language (CEL). מידע נוסף על יצירת תנאים באילוצים מותאמים אישית באמצעות CEL זמין בקטע בנושא CEL במאמר יצירה וניהול של אילוצים מותאמים אישית.
המסוף
כדי ליצור אילוץ בהתאמה אישית:
- במסוף Google Cloud , נכנסים לדף מדיניות הארגון.
- בכלי לבחירת פרויקטים, בוחרים את הפרויקט שרוצים להגדיר לו את מדיניות הארגון.
- לוחצים על Custom constraint.
- בתיבה Display name, מזינים שם לאילוץ שיהיה קריא לאנשים. השם הזה מופיע בהודעות שגיאה ואפשר להשתמש בו לזיהוי ולניפוי באגים. אל תשתמשו בפרטים אישיים מזהים (PII) או בנתונים רגישים בשמות לתצוגה, כי השם הזה עלול להיחשף בהודעות שגיאה. השדה הזה יכול להכיל עד 200 תווים.
-
בתיבה Constraint ID, מזינים את המזהה שרוצים לתת לאילוץ החדש בהתאמה אישית. אילוץ בהתאמה אישית יכול להכיל רק אותיות (כולל אותיות גדולות וקטנות) או מספרים, למשל
custom.region. השדה הזה יכול להכיל עד 70 תווים, לא כולל הקידומת (custom.), לדוגמה,organizations/123456789/customConstraints/custom. אל תכללו פרטים אישיים מזהים או מידע אישי רגיש במזהה האילוץ, כי הם עלולים להיחשף בהודעות שגיאה. - בתיבה Description, מזינים תיאור של האילוץ שקריא לאנשים. התיאור הזה משמש כהודעת שגיאה כשיש הפרה של המדיניות. צריך לכלול פרטים על הסיבה להפרת המדיניות ועל האופן שבו אפשר לפתור את הבעיה. אל תכללו פרטים אישיים מזהים או מידע אישי רגיש בתיאור, כי הם עלולים להיחשף בהודעות שגיאה. בשדה הזה אפשר להזין עד 2,000 תווים.
-
בתיבה Resource type, בוחרים את השם של משאב ה- Google Cloud REST שמכיל את האובייקט והשדה שרוצים להגביל, לדוגמה
container.googleapis.com/NodePool. רוב סוגי המשאבים תומכים בעד 20 אילוצים בהתאמה אישית. אם תנסו ליצור יותר אילוצים בהתאמה אישית, הפעולה תיכשל. -
בקטע שיטת אכיפה, בוחרים אם לאכוף את האילוץ על שיטת REST
CREATEאו על שיטותCREATEו-UPDATE. אם אוכפים את האילוץ באמצעות השיטהUPDATEבמשאב שמפר את האילוץ, מדיניות הארגון חוסמת את השינויים במשאב הזה, אלא אם השינוי פותר את ההפרה. - כדי להגדיר תנאי, לוחצים על עריכת התנאי.
-
בחלונית Add condition, יוצרים תנאי CEL שמתייחס למשאב שירות נתמך, לדוגמה
resource.management.autoUpgrade == false. השדה הזה יכול לכלול עד 1,000 תווים. למידע נוסף על השימוש ב-CEL, ראו Common Expression Language. למידע נוסף על משאבי השירות שאפשר להשתמש בהם באילוצים בהתאמה אישית, קראו את המאמר שירותים שנתמכים באילוצים בהתאמה אישית. - לוחצים על Save.
- בקטע Action, בוחרים אם לאשר או לדחות את השיטה שנבדקה אם התנאי מתקיים.
- לוחצים על Create constraint.
כדי לראות את השיטות הנתמכות לכל שירות, מחפשים את השירות בקטע שירותים שתומכים באילוצים מותאמים אישית.
הפעולה deny (דחייה) פירושה שהפעולה ליצירה או לעדכון של המשאב נחסמת אם התנאי מחזיר את הערך true.
פעולת ההרשאה מאפשרת ליצור או לעדכן את המשאב רק אם התנאי מתקיים. כל מקרה אחר, מלבד אלה שרשומים במפורש בתנאי, נחסם.
אחרי שמזינים ערך בכל שדה, הגדרת ה-YAML המקבילה לאילוץ המותאם אישית הזה מופיעה בצד שמאל.
gcloud
- כדי ליצור אילוץ בהתאמה אישית, יוצרים קובץ YAML בפורמט הבא:
-
ORGANIZATION_ID: מזהה הארגון, למשל123456789. -
CONSTRAINT_NAME: השם שרוצים לתת לאילוץ המותאם אישית החדש. אילוץ בהתאמה אישית יכול להכיל רק אותיות (כולל אותיות רישיות וקטנות) או מספרים, לדוגמה,custom.region. השדה הזה יכול להכיל עד 70 תווים, לא כולל הקידומת (custom.) – לדוגמה,organizations/123456789/customConstraints/custom. אל תכללו פרטים אישיים מזהים או מידע אישי רגיש במזהה האילוץ, כי הם עלולים להיחשף בהודעות שגיאה. -
RESOURCE_NAME: השם מוגדר במלואו של המשאב Google Cloudשמכיל את האובייקט והשדה שרוצים להגביל. לדוגמה,sqladmin.googleapis.com/Instance. רוב סוגי המשאבים תומכים בעד 20 אילוצים בהתאמה אישית. אם תנסו ליצור יותר אילוצים בהתאמה אישית, הפעולה תיכשל. -
methodTypes: שיטות ה-REST שבהן האילוץ נאכף. יכול להיותCREATEאו גםCREATEוגםUPDATE. אם אוכפים את האילוץ באמצעות השיטהUPDATEבמשאב שמפר את האילוץ, מדיניות הארגון חוסמת את השינויים במשאב הזה, אלא אם השינוי פותר את ההפרה. -
CONDITION: תנאי CEL שנכתב כנגד ייצוג של משאב שירות נתמך. השדה הזה יכול להכיל עד 1,000 תווים. לדוגמה,"resource.region == "us-central1"". -
ACTION: הפעולה שתתבצע אם התנאיconditionיתקיים. הערכים האפשריים הםALLOWו-DENY. -
DISPLAY_NAME: שם קריא לאנשים של האילוץ. השם הזה מופיע בהודעות שגיאה ואפשר להשתמש בו לזיהוי ולניפוי באגים. אל תשתמשו בפרטים אישיים מזהים (PII) או במידע אישי רגיש בשמות המוצגים, כי השם הזה עלול להיחשף בהודעות שגיאה. השדה הזה יכול להכיל עד 200 תווים. -
DESCRIPTION: תיאור קריא של האילוץ שיוצג כהודעת שגיאה במקרה של הפרת המדיניות. בשדה הזה אפשר להזין עד 2,000 תווים. -
אחרי שיוצרים את קובץ ה-YAML לאילוץ חדש בהתאמה אישית, צריך להגדיר אותו כדי שיהיה זמין למדיניות הארגון. כדי להגדיר אילוץ בהתאמה אישית, משתמשים בפקודה
gcloud org-policies set-custom-constraint: -
כדי לוודא שהאילוץ המותאם אישית קיים, משתמשים בפקודה
gcloud org-policies list-custom-constraints:
name: organizations/ORGANIZATION_ID/customConstraints/CONSTRAINT_NAME resourceTypes: RESOURCE_NAME methodTypes: - CREATE
- UPDATE condition: "CONDITION" actionType: ACTION displayName: DISPLAY_NAME description: DESCRIPTION
מחליפים את מה שכתוב בשדות הבאים:
כדי לראות את השיטות הנתמכות לכל שירות, צריך לחפש את השירות בקטע שירותים שתומכים באילוצים בהתאמה אישית.
במאמר הזה מפורטים המשאבים שאפשר לכתוב תנאים לגביהם.
הפעולה allow פירושה שאם התנאי מקבל את הערך true, מותר ליצור או לעדכן את המשאב. זה גם אומר שכל מקרה אחר, מלבד המקרה שמופיע במפורש בתנאי, חסום.
פעולת הדחייה פירושה שאם התנאי מקבל את הערך True, הפעולה ליצירה או לעדכון של המשאב נחסמת.
gcloud org-policies set-custom-constraint CONSTRAINT_PATH
מחליפים את CONSTRAINT_PATH בנתיב המלא לקובץ האילוצים המותאמים אישית. לדוגמה, /home/user/customconstraint.yaml.
אחרי שהפעולה הזו תושלם, האילוצים המותאמים אישית יהיו זמינים כמדיניות ארגונית ברשימת Google Cloud מדיניות הארגון.
gcloud org-policies list-custom-constraints --organization=ORGANIZATION_ID
מחליפים את ORGANIZATION_ID במזהה של משאב הארגון.
אכיפה של מדיניות ארגון בהתאמה אישית
כדי לאכוף אילוץ, אפשר ליצור מדיניות ארגון שמפנה אליו, ואז להחיל את מדיניות הארגון על משאב ב- Google Cloud .המסוף
- במסוף Google Cloud , נכנסים לדף מדיניות הארגון.
- בכלי לבחירת פרויקטים, בוחרים את הפרויקט שרוצים להגדיר לו את מדיניות הארגון.
- ברשימה שבדף מדיניות הארגון, בוחרים את האילוץ כדי להציג את הדף Policy details של אותו אילוץ.
- כדי להגדיר את מדיניות הארגון למשאב הזה, לוחצים על Manage policy.
- בדף עריכת המדיניות, בוחרים באפשרות במקום המדיניות של המשאב הראשי.
- לוחצים על Add a rule.
- בקטע Enforcement (אכיפה), בוחרים אם מדיניות הארגון הזו נאכפת או לא.
- אופציונלי: כדי להגדיר את מדיניות הארגון כתלויה בתג, לוחצים על הוספת תנאי. הערה: אם מוסיפים כלל מותנה למדיניות ארגון, צריך להוסיף לפחות כלל לא מותנה אחד, אחרת אי אפשר לשמור את המדיניות. מידע נוסף זמין במאמר בנושא הגדרת היקף של מדיניות הארגון באמצעות תגים.
- לוחצים על Test changes כדי לדמות את ההשפעה של מדיניות הארגון. מידע נוסף מופיע במאמר בדיקת שינויים במדיניות הארגון באמצעות סימולטור המדיניות.
- כדי לאכוף את מדיניות הארגון במצב פרימטר לבדיקות, לוחצים על הגדרת המדיניות להרצת בדיקה. למידע נוסף, קראו את המאמר בדיקת מדיניות הארגון.
- אחרי שמוודאים שמדיניות הארגון במצב הרצה יבשה פועלת כמו שרוצים, מגדירים את המדיניות הפעילה על ידי לחיצה על הגדרת מדיניות.
gcloud
- כדי ליצור מדיניות ארגונית עם כללים בוליאניים, יוצרים קובץ YAML של מדיניות שמפנה לאילוץ:
-
PROJECT_ID: הפרויקט שבו רוצים לאכוף את האילוץ. -
CONSTRAINT_NAME: השם שהגדרתם לאילוץ המותאם אישית. לדוגמה,custom.region. -
כדי לאכוף את מדיניות הארגון במצב פרימטר לבדיקות, מריצים את הפקודה הבאה עם הדגל
dryRunSpec: -
אחרי שמוודאים שמדיניות הארגון במצב פרימטר לבדיקות פועלת כמו שצריך, מגדירים את המדיניות הפעילה באמצעות הפקודה
org-policies set-policyוהדגלspec:
name: projects/PROJECT_ID/policies/CONSTRAINT_NAME spec: rules: - enforce: true dryRunSpec: rules: - enforce: true
מחליפים את מה שכתוב בשדות הבאים:
gcloud org-policies set-policy POLICY_PATH --update-mask=dryRunSpec
מחליפים את POLICY_PATH בנתיב המלא לקובץ ה-YAML של מדיניות הארגון. המדיניות תיכנס לתוקף תוך 15 דקות לכל היותר.
gcloud org-policies set-policy POLICY_PATH --update-mask=spec
מחליפים את POLICY_PATH בנתיב המלא לקובץ ה-YAML של מדיניות הארגון. המדיניות תיכנס לתוקף תוך 15 דקות לכל היותר.
דוגמאות למדיניות ארגונית מותאמת אישית לתרחישים נפוצים
בטבלה הבאה מופיעות דוגמאות לתחביר של כמה אילוצים נפוצים בהתאמה אישית.
| תיאור | תחביר של אילוצים |
|---|---|
| מוודאים שהמכונות הן Enterprise Plus |
name: organizations/ORGANIZATION_ID/customConstraints/custom.edition resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.edition == 'ENTERPRISE_PLUS'" actionType: ALLOW displayName: Instances must be Enterprise Plus. description: Cloud SQL instances must be Enterprise Plus. |
| איך מוודאים שהמכונות יהיו עם זמינות גבוהה |
name: organizations/ORGANIZATION_ID/customConstraints/custom.availability resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.availabilityType == 'REGIONAL'" actionType: ALLOW displayName: Instances must be regional. description: Cloud SQL instances must be highly available. To do this, make them regional. |
| מוודאים שלמופעים יש מדיניות סיסמאות. |
name: organizations/ORGANIZATION_ID/customConstraints/custom.enforcePassword resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.passwordValidationPolicy.enablePasswordPolicy == true" actionType: ALLOW displayName: The password policy must be enabled for Cloud SQL instances. description: Cloud SQL instances must have a password policy. |
| מוודאים שמוגדר אורך מינימלי למדיניות הסיסמאות של המכונות |
name: organizations/ORGANIZATION_ID/customConstraints/custom.passwordMinLength resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.passwordValidationPolicy.minLength >= 6" actionType: ALLOW displayName: The password policy must have a minimum length of six characters. description: Cloud SQL instances must have a password policy that has a minimum length of six characters. |
| מוודאים שבמכונות מופעלת מדיניות סיסמאות מורכבת. |
name: organizations/ORGANIZATION_ID/customConstraints/custom.passwordComplexity resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.passwordValidationPolicy.complexity == 'COMPLEXITY_DEFAULT'" actionType: ALLOW displayName: The password policy complexity must be enabled. description: Cloud SQL instances must have a password policy with complex passwords. |
| הגדרת דרישה להפעלת מצב SSL עם חיבורים מוצפנים בלבד. |
name: organizations/ORGANIZATION_ID/customConstraints/custom.sslMode resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.ipConfiguration.sslMode == 'ENCRYPTED_ONLY'" actionType: ALLOW displayName: Only allow connections that are encrypted with SSL/TLS. description: Cloud SQL instances must only allow connections that are encrypted with SSL/TLS. |
| לחסום את הגישה למסד הנתונים מכל מקום באינטרנט הציבורי. |
name: organizations/ORGANIZATION_ID/customConstraints/custom.authorizedNetworks resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.ipConfiguration.authorizedNetworks.exists(network, network.value == '0.0.0.0/0')" actionType: DENY displayName: The list of authorized networks can't contain 0.0.0.0/0 description: Authorized networks for Cloud SQL instances can't contain 0.0.0.0/0. This allows users to access the database from any IP address. |
| מוודאים שלא נוצרות מכונות עם כתובת IP חיצונית. |
name: organizations/ORGANIZATION_ID/customConstraints/custom.ipv4Enabled resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.ipConfiguration.ipv4Enabled == false" actionType: ALLOW displayName: ipv4Enabled must be set to false. description: Cloud SQL instances can't have an external IP address. |
| מוודאים שהמופעים מוצפנים באמצעות מפתח KMS. |
name: organizations/ORGANIZATION_ID/customConstraints/custom.encrypted resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.diskEncryptionConfiguration.kmsKeyName.size() > 0" actionType: ALLOW displayName: Instances must be encrypted with a KMS key. description: Cloud SQL instances must be disk-encrypted with a KMS key. |
| בדיקה שהמכונות הווירטואליות נמצאות באזור us-central1 |
name: organizations/ORGANIZATION_ID/customConstraints/custom.region resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.region == 'us-central1'" actionType: ALLOW displayName: Instances must be in the us-central1 region. description: Cloud SQL instances must be in the us-central1 region. |
| מוודאים שהפעלתם את מטמון הנתונים במופעים. |
name: organizations/ORGANIZATION_ID/customConstraints/custom.dataCache resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.dataCacheConfig.dataCacheEnabled == true" actionType: ALLOW displayName: Instances must have data cache enabled. description: Cloud SQL instances must have data cache enabled. |
| אכיפת גיבויים אוטומטיים. |
name: organizations/ORGANIZATION_ID/customConstraints/custom.enableBackups resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.backupConfiguration.enabled == true" actionType: ALLOW displayName: Automated backups must be enabled. description: Cloud SQL instances must have automated backups enabled. |
| להגביל את המיקום של הגיבויים האוטומטיים. |
name: organizations/ORGANIZATION_ID/customConstraints/custom.automatedBackupLocation resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "resource.settings.backupConfiguration.location == 'us-central1'" actionType: ALLOW displayName: The location of automated backups must be in the us-central1 region. description: The location of automated backups for Cloud SQL instances must be in the us-central1 region. |
| הגבלת המיקום של גיבויים על פי דרישה ל-us-central1 |
name: organizations/ORGANIZATION_ID/customConstraints/custom.onDemandBackupLocation resourceTypes: - sqladmin.googleapis.com/BackupRun methodTypes: - CREATE - UPDATE condition: "condition: resource.location == 'us-central1'" actionType: ALLOW displayName: The location of on-demand backups must be in the us-central1 region. description: On-demand backups are restricted to the us-central1. |
| אכיפת גיבוי סופי בזמן מחיקת המכונה |
name: organizations/ORGANIZATION_ID/customConstraints/custom.retainBackupsOnDelete resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "condition: resource.settings.finalBackupConfig.enabled == true" actionType: ALLOW displayName: Final backup is enabled and must be taken at instance deletion. description: Final backups are enabled for instance. |
| אכיפת גיבוי סופי בתקופת השמירה של מחיקת המכונה |
name: organizations/ORGANIZATION_ID/customConstraints/custom.retainBackupsOnDelete resourceTypes: - sqladmin.googleapis.com/Instance methodTypes: - CREATE - UPDATE condition: "condition: resource.settings.finalBackupConfig.enabled == true && resource.settings.finalBackupConfig.retentionDays == 20" actionType: ALLOW displayName: Final backup is enabled and must be retained for 20 days after instance deletion. description: Final backups is retained for 20 days after instance deletion. |
המאמרים הבאים
- מידע נוסף על שירות מדיניות הארגון
- מידע נוסף על יצירה וניהול של מדיניות הארגון
- רשימה מלאה של אילוצים של מדיניות הארגון