שליטה בגישה לרשת ל-Gemini Code Assist באמצעות הגבלות על דומיינים של משתמשים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
במסמך הזה מפורטות הוראות לאדמינים של רשתות, שמאפשרות להם להגדיר את הרשתות שלהם כך שיגבילו את הגישה ל-Gemini Code Assist על סמך דומיינים של משתמשים. התכונה הזו מאפשרת לארגונים לקבוע אילו משתמשים ברשת שלהם יוכלו להשתמש ב-Gemini Code Assist, וכך לשפר את האבטחה ולמנוע גישה לא מורשית.
סקירה כללית
אפשר להגדיר את Gemini Code Assist לאכוף הגבלות על דומיינים של משתמשים באמצעות שרת proxy מסוג אדם בתווך (PITM). לשם כך, צריך להחדיר כותרת HTTP מותאמת אישית, X-GeminiCodeAssist-Allowed-Domains, לבקשות שנשלחות אל Gemini Code Assist. הכותרת מציינת רשימה של דומיינים מותרים, והקצה העורפי של Gemini Code Assist מעבד רק בקשות ממשתמשים שהדומיין המאומת שלהם תואם לאחד מהדומיינים המותרים.
הגדרת שרת proxy בסביבת הפיתוח המשולבת (IDE)
כדי להגדיר שרת proxy בסביבת הפיתוח המשולבת:
VS Code
עוברים אל קובץ>הגדרות (ב-Windows), או אל קוד>הגדרות>הגדרות (ב-macOS).
בכרטיסייה User, עוברים אל Application>Proxy.
בתיבה שמתחת לProxy, מזינים את הכתובת של שרת ה-proxy. לדוגמה, http://localhost:3128.
אופציונלי: כדי להגדיר ל-Gemini Code Assist להתעלם משגיאות אישור, בקטע Proxy Strict SSL מסמנים או מבטלים את הסימון בתיבה. ההגדרה הזו חלה על כל הפרופילים.
IntelliJ
עוברים אל File (קובץ) >Settings (הגדרות) (ב-Windows) או IntelliJ IDEA>Settings (הגדרות) (ב-macOS).
עוברים אל מראה והתנהגות>הגדרות מערכת>שרת proxy ל-HTTP.
בוחרים באפשרות Manual proxy configuration (הגדרה ידנית של שרת proxy) ואז באפשרות HTTP.
בשדה Host name, מזינים את שם המארח של שרת ה-proxy.
בשדה Port number, מזינים את מספר היציאה של שרת ה-proxy.
אופציונלי: כדי להגדיר ל-Gemini Code Assist להתעלם משגיאות אישור, לוחצים על Tools (כלים) >Server Certificates (אישורי שרת) בסרגל הצד, ובוחרים באפשרות Accept non-trusted certificates automatically (קבלת אישורים לא מהימנים באופן אוטומטי) או מבטלים את הבחירה בה.
הגדרת שרת proxy של PITM
כדי להגדיר את שרת ה-proxy של PITM:
חשוב לוודא שהרשת משתמשת בשרתי proxy מסוג PITM שיכולים ליירט ולשנות את תעבורת ה-HTTPS.
מגדירים את שרת ה-proxy כך שיחטוף את כל הבקשות היוצאות לנקודת הקצה של Gemini Code Assist (https://cloudcode-pa.googleapis.com). אין להשתמש בתווים כלליים (*) כשמציינים את נקודת הקצה של Gemini Code Assist.
מגדירים את שרת ה-proxy להחדרת הכותרת X-GeminiCodeAssist-Allowed-Domains לכל בקשה. הכותרת צריכה להכיל רשימה של דומיינים מותרים, מופרדים בפסיקים (למשל, example.com, yourcompany.net). חשוב לוודא ששמות הדומיינים מופרדים בפסיקים ושהם לא כוללים את הסמל @.
אם המערכת לא תצליח לפתור את הכותרות לפחות לדומיין חוקי אחד, ההגבלות לא יחולו. לדוגמה, כותרת ריקה לא תחול הגבלות.
לא יחולו הגבלות על domain כי זה לא שם דומיין חוקי.
כשמשתמש מנסה לגשת ל-Gemini Code Assist מדומיין שלא נכלל ברשימת הכותרות, מוצגת לו הודעה על כך שהאדמין שלו הגביל את השימוש שלו ב-Gemini Code Assist בדומיין.
יירוט SSL/TLS
אם שרת ה-proxy צריך לפענח תנועה ב-HTTPS כדי להחדיר את הכותרת, צריך לוודא שהוא מוגדר ליירט נתוני SSL/TLS. בדרך כלל, התהליך כולל:
יצירת אישור לשרת ה-proxy.
התקנת האישור של שרת ה-proxy במכשירי המשתמשים כדי ליצור אמון ולהימנע משגיאות אישור.
אימות כותרות
Gemini Code Assist מאמת באופן אוטומטי את הכותרת X-GeminiCodeAssist-Allowed-Domains ואוכף את ההגבלות.
אם הכותרת לא מנותבת לדומיין תקין אחד לפחות, האימות לא יתבצע.
אם הדומיין של המשתמש לא מופיע ברשימת ההיתרים, הבקשה נדחית.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["התוכן קשה להבנה","hardToUnderstand","thumb-down"],["שגיאות בקוד לדוגמה או במידע","incorrectInformationOrSampleCode","thumb-down"],["חסרים לי פרטים או דוגמאות","missingTheInformationSamplesINeed","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-06-11 (שעון UTC)."],[[["\u003cp\u003eNetwork administrators can restrict access to Gemini Code Assist by user domain, enhancing security and controlling who can use the tool.\u003c/p\u003e\n"],["\u003cp\u003eA Person-in-the-Middle (PITM) proxy is used to inject an \u003ccode\u003eX-GeminiCodeAssist-Allowed-Domains\u003c/code\u003e header into requests, specifying allowed domains.\u003c/p\u003e\n"],["\u003cp\u003eConfiguring the proxy within IDEs like VS Code and IntelliJ involves setting the proxy server address and optionally managing certificate error settings.\u003c/p\u003e\n"],["\u003cp\u003eThe PITM proxy must intercept HTTPS traffic to Gemini Code Assist endpoints, injecting the header with a comma-separated list of valid domains, such as \u003ccode\u003eexample.com\u003c/code\u003e, \u003ccode\u003eyourcompany.net\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eGemini Code Assist automatically validates the header to ensure that users are coming from an allowed domain, rejecting the request if not.\u003c/p\u003e\n"]]],[],null,["# Control Network Access to Gemini Code Assist with User Domain Restrictions\n\nThis document provides instructions for network administrators to configure\ntheir networks to restrict access to Gemini Code Assist based on\nuser domains. This feature allows organizations to control which users within\ntheir network can utilize Gemini Code Assist, enhancing security\nand preventing unauthorized access.\n\nOverview\n--------\n\nYou can configure Gemini Code Assist to enforce user domain\nrestrictions using a Person-in-the-Middle (PITM) proxy approach. This involves\ninjecting a custom HTTP header,\n`X-GeminiCodeAssist-Allowed-Domains`, into requests made to\nGemini Code Assist. The header specifies a list of allowed\ndomains, and the Gemini Code Assist backend only processes\nrequests from users whose authenticated domain matches one of the allowed\ndomains.\n\nConfigure a proxy in your IDE\n-----------------------------\n\nTo configure a proxy in your IDE, follow these steps: \n\n### VS Code\n\n1. Navigate to **File** \\\u003e **Settings** (for Windows), or **Code**\n \\\u003e **Settings** \\\u003e **Settings** (for macOS).\n\n2. In the **User** tab, navigate to **Application** \\\u003e **Proxy**.\n\n3. In the box under **Proxy** , enter the address of your proxy server. For\n example `http://localhost:3128`.\n\n4. Optional: To configure Gemini Code Assist to ignore\n certificate errors, under **Proxy Strict SSL**, select or deselect the\n checkbox. This setting applies to all profiles.\n\n### IntelliJ\n\n1. Navigate to **File** \\\u003e **Settings** (for Windows) or **IntelliJ\n IDEA** \\\u003e **Settings** (for macOS).\n\n2. Navigate to **Appearance \\& Behavior** \\\u003e **System Settings**\n \\\u003e **HTTP Proxy**.\n\n3. Select **Manual proxy configuration** , and then select **HTTP**.\n\n4. In the **Host name** field, enter the hostname of your proxy server.\n\n5. In the **Port number** field, enter the port number of your proxy server.\n\n6. Optional: To configure Gemini Code Assist to ignore\n certificate errors, in the sidebar, click **Tools** \\\u003e **Server\n Certificates** and then select or deselect **Accept non-trusted certificates\n automatically**.\n\nConfigure PITM proxy\n--------------------\n\nTo configure your PITM proxy, follow these steps:\n\n1. Make sure your network utilizes a PITM proxy capable of intercepting and\n modifying HTTPS traffic.\n\n2. Configure the proxy to intercept all outgoing requests to the\n Gemini Code Assist endpoint\n (`https://cloudcode-pa.googleapis.com`). Don't use wildcards (`*`) when you\n specify the Gemini Code Assist endpoint.\n\n3. Configure the proxy to inject the `X-GeminiCodeAssist-Allowed-Domains`\n header into each request. The header should contain a comma-separated list\n of allowed domains (e.g., `example.com`, `yourcompany.net`).\n Make sure that domain names are separated by commas and\n don't include the `@` symbol.\n\n If headers aren't resolved into at least one valid domain, restrictions\n won't apply. For example, an empty header won't apply any restrictions.\n `domain` won't apply any restrictions as it isn't a valid domain name.\n\nWhen a user tries to access Gemini Code Assist from a domain not\nincluded in the header list, they see a message telling them that they're\nrestricted from using Gemini Code Assist on their domain by their\nadministrator.\n\nSSL/TLS interception\n--------------------\n\nIf your proxy needs to decrypt HTTPS traffic to inject the header, make sure\nit's configured for SSL/TLS interception. This typically involves:\n\n- Generating a certificate for the proxy.\n\n- Installing the proxy's certificate on user devices to establish trust and\n avoid certificate errors.\n\nHeader validation\n-----------------\n\n- Gemini Code Assist automatically validates the\n `X-GeminiCodeAssist-Allowed-Domains` header and enforces the restrictions.\n\n- If the header doesn't resolve to at least one valid domain, the validation\n won't be performed.\n\n- If the domain associated with the user's authentication isn't in the allowed\n list, the request is rejected. For example if the user logs in with a gmail\n account and only example.com is on the allowed list, the request is rejected.\n\nWhat's next\n-----------\n\nTo learn more about blocking access to consumer accounts, see\n[Block access to consumer accounts](https://support.google.com/a/answer/1668854)."]]