VPC सर्विस कंट्रोल की मदद से सुरक्षा को बेहतर बनाना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Google Cloud Search, आपके डेटा की सुरक्षा को बेहतर बनाने के लिए, वीपीसी सेवा नियंत्रण के साथ काम करता है. VPC सर्विस कंट्रोल की मदद से, Google Cloud Platform के संसाधनों के लिए एक सर्विस पेरीमीटर तय किया जा सकता है. इससे डेटा को सुरक्षित रखने में मदद मिलती है. साथ ही, डेटा बाहर निकाल जाने के जोखिमों को कम किया जा सकता है.
उस Google Cloud Platform प्रोजेक्ट के प्रोजेक्ट आईडी और प्रोजेक्ट नंबर पाएं जिसका आपको इस्तेमाल करना है. प्रोजेक्ट आईडी और नंबर पाने के लिए, प्रोजेक्ट की पहचान करना लेख पढ़ें.
gcloud का इस्तेमाल करके, अपने Google Cloud Platform संगठन के लिए ऐक्सेस नीति बनाएं:
TITLE, पेरीमीटर का ऐसा टाइटल है जिसे आसानी से पढ़ा जा सकता है.
PROJECTS एक या उससे ज़्यादा प्रोजेक्ट नंबर की कॉमा-सेपरेटेड लिस्ट है. हर प्रोजेक्ट नंबर से पहले projects/ स्ट्रिंग मौजूद होती है. पहले चरण में मिले प्रोजेक्ट नंबर का इस्तेमाल करें. उदाहरण के लिए, अगर आपके पास दो प्रोजेक्ट हैं, प्रोजेक्ट 12345 और 67890, तो आपकी सेटिंग --resource=projects/12345, project/67890 होगी. यह फ़्लैग सिर्फ़ प्रोजेक्ट नंबर के साथ काम करता है. यह नाम या आईडी के साथ काम नहीं करता.
RESTRICTED-SERVICES एक या उससे ज़्यादा सेवाओं की कॉमा से अलग की गई सूची है.
cloudsearch.googleapis.com का इस्तेमाल करें.
POLICY_NAME आपके संगठन की ऐक्सेस नीति का संख्यात्मक नाम है. यह आपको चरण 2c में मिला था.
सेवा पैरामीटर बनाने के तरीके के बारे में ज़्यादा जानने के लिए, सेवा पैरामीटर बनाना लेख पढ़ें.
(ज़रूरी नहीं) अगर आपको आईपी या क्षेत्र के हिसाब से पाबंदियां लागू करनी हैं, तो ऐक्सेस लेवल बनाएं और उन्हें तीसरे चरण में बनाए गए सेवा के दायरे में जोड़ें:
ऐक्सेस लेवल बनाने के लिए, बेसिक ऐक्सेस लेवल बनाना लेख पढ़ें.
ऐक्सेस लेवल की ऐसी शर्त बनाने के तरीके के बारे में उदाहरण देखें जो सिर्फ़ आईपी पतों की किसी खास रेंज से ऐक्सेस करने की अनुमति देती है. जैसे, कॉर्पोरेट नेटवर्क में मौजूद आईपी पते. इसके लिए, कॉर्पोरेट नेटवर्क पर ऐक्सेस सीमित करना लेख पढ़ें.
ऐक्सेस लेवल बनाने के बाद, उसे सेवा के दायरे में जोड़ें.
किसी सेवा के पेरीमीटर में ऐक्सेस लेवल जोड़ने के निर्देशों के लिए, मौजूदा पेरीमीटर में ऐक्सेस लेवल जोड़ना लेख पढ़ें.
इस बदलाव को लागू होने में 30 मिनट लग सकते हैं.
Cloud Search Customer Service REST API का इस्तेमाल करके, ग्राहक की सेटिंग को अपडेट करें. इसके लिए, VPC सर्विस कंट्रोल के पेरीमीटर से सुरक्षित किए गए प्रोजेक्ट का इस्तेमाल करें:
Google Authorization Server से OAuth 2.0 का ऐक्सेस टोकन पाएं.
टोकन पाने के बारे में जानकारी के लिए, OAuth 2.0 का इस्तेमाल करके, Google API को ऐक्सेस करना लेख का दूसरा चरण देखें.
ऐक्सेस टोकन हासिल करते समय, OAuth के इनमें से किसी एक स्कोप का इस्तेमाल करें:
https://www.googleapis.com/auth/cloud_search.settings.indexing,
https://www.googleapis.com/auth/cloud_search.settings,
या https://www.googleapis.com/auth/cloud_search
Google Cloud Search में ग्राहक सेटिंग के तहत, वीपीसी सर्विस कंट्रोल की सेटिंग में प्रोजेक्ट सेट करने के लिए, यह कर्ल कमांड चलाएं:
YOUR_ACCESS_TOKEN, चरण 5a में मिला OAuth 2.0 ऐक्सेस टोकन है.
PROJECT_ID वह प्रोजेक्ट आईडी है जो आपको पहले चरण में मिला था.
अगर अनुरोध पूरा हो जाता है, तो आपको 200 OK रिस्पॉन्स मिलेगा. साथ ही, ग्राहक की अपडेट की गई सेटिंग भी मिलेंगी.
ऊपर दिए गए चरणों को पूरा करने के बाद, सेवा पेरीमीटर में तय की गई वीपीसी सर्विस कंट्रोल की पाबंदियां, Google Cloud Search के सभी एपीआई, cloudsearch.google.com पर की गई खोजों, और Admin console का इस्तेमाल करके कॉन्फ़िगरेशन या रिपोर्ट देखने और बदलने पर लागू होती हैं. Google Cloud Search API के लिए किए गए ऐसे अनुरोधों को PERMISSION_DENIED “Request is prohibited by organization’s policy” गड़बड़ी का मैसेज मिलता है जो ऐक्सेस लेवल के मुताबिक नहीं होते.
[null,null,["आखिरी बार 2025-08-29 (UTC) को अपडेट किया गया."],[],[],null,["# Enhance security with VPC Service Controls\n\nGoogle Cloud Search supports VPC Service Controls\nto enhance the security of your data. VPC Service Controls allows you to define\na service perimeter around Google Cloud Platform resources to constrain data\nand help mitigate data exfiltration risks.\n| **Note:** Cloud Search supports restricted VIP which provides a private network route to make data and resources inaccessible from the internet. For information on setting up restricted VIP, refer to [Setting up private connectivity to Google APIs and services](https://cloud.google.com/vpc-service-controls/docs/set-up-private-connectivity).\n\nPrerequisites\n-------------\n\nBefore you begin,\n[install the gcloud command-line interface](https://cloud.google.com/sdk/gcloud).\n\nEnable VPC Service Controls\n---------------------------\n\nTo enable VPC Service Controls:\n\n1. Obtain the project IDs and project numbers for the Google Cloud Platform\n project you want to use. To obtain the project IDs and numbers, refer to\n [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects).\n\n2. Use gcloud to create an access policy for your Google Cloud Platform\n organization:\n\n 1. [Get your organization ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).\n 2. [Create an access policy](https://cloud.google.com/access-context-manager/docs/create-access-policy).\n 3. [Get the name of your access policy](https://cloud.google.com/access-context-manager/docs/manage-access-policy#gcloud).\n\n | **Note:** Organizations can only have one access policy. If you attempt to create a second access policy for for your organization, an error occurs.\n3. Create a service perimeter with Cloud Search as a restricted service by\n running the following gcloud command:\n\n gcloud access-context-manager perimeters create NAME \\\n --title=TITLE \\\n --resources=PROJECTS \\\n --restricted-services=RESTRICTED-SERVICES \\\n --policy=POLICY_NAME\n\n Where:\n - `NAME` is the name of the perimeter.\n - `TITLE` is the human-readable title of the perimeter.\n - `PROJECTS` is a comma-separated list of one or more project numbers, each preceded by the string `projects/`. Use the project numbers obtained in step 1. For example, if you had two projects, project `12345` and `67890`, your setting would be `--resource=projects/12345, project/67890` .This flag only supports project numbers; it doesn't support names or IDs.\n - `RESTRICTED-SERVICES` is a comma-separated list of one or more services. Use `cloudsearch.googleapis.com`.\n - `POLICY_NAME` is the numeric name of your organization's access policy obtained in step 2c.\n\n For further information on how to create a service perimeter, refer to\n [Creating a service perimeter](https://cloud.google.com/vpc-service-controls/docs/create-service-perimeters).\n4. (optional) If you want to apply IP or region-based restrictions, create\n access levels and add them to the service perimeter created in step 3:\n\n 1. To create an access level, refer to [Creating an basic access level](https://cloud.google.com/access-context-manager/docs/create-basic-access-level). For an example on how to create an access level condition that only allows access from a specific range of IP addresses, such as those within a corporate network, refer to [Limit access on a corporate network](https://cloud.google.com/access-context-manager/docs/create-basic-access-level#corporate-network-example).\n 2. After you have created an access level, add it to the service perimeter. For instructions on adding an access level to a service perimeter, refer to [Adding an access level to an existing perimeter](https://cloud.google.com/vpc-service-controls/docs/manage-service-perimeters#add-access-level). This change can take up to 30 minutes for this change to propagate and take effect.\n5. Use the Cloud Search Customer Service REST API to update the customer\n settings with your VPC Service Controls perimeter-protected project:\n\n| **Note:** Because Cloud Search resources are not stored in a Google Cloud Platform project, you must update the Cloud Search customer settings with the VPC Service Controls perimeter-protected project. The VPC Service Controls project acts as a virtual project container for all your Cloud Search resources. Without building this mapping, VPC Service Controls won't work for the Cloud Search API.\n\n1. Obtain an OAuth 2.0 access token from the Google Authorization Server.\n For information on obtaining the token, refer to step 2 of\n [Using OAuth 2.0 to Access Google APIs](https://developers.google.com/identity/protocols/oauth2).\n When obtaining the access token, use one of the following OAuth scopes:\n `https://www.googleapis.com/auth/cloud_search.settings.indexing`,\n `https://www.googleapis.com/auth/cloud_search.settings`,\n or `https://www.googleapis.com/auth/cloud_search`\n\n2. Run the following curl command to set the project in VPC Service Controls\n settings under Customer settings in Google Cloud Search:\n\n curl --request PATCH \\\n 'https://cloudsearch.googleapis.com/v1/settings/customer' \\\n --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \\\n --header 'Accept: application/json' \\\n --header 'Content-Type: application/json' \\\n --data '{ \"vpc_settings\": { \"project\": \"projects/PROJECT_ID\" } }' \\\n --compressed\n\n Where:\n\n- `YOUR_ACCESS_TOKEN` is OAuth 2.0 access token obtained in step 5a.\n- `PROJECT_ID` is the project ID obtained in step 1.\n\n If successful, you should receive a `200 OK` response accompanied by the\n updated customer settings.\n\nAfter the above steps are completed successfully, the VPC Service Controls\nrestrictions, as defined in the service perimeter, are applied to all Google\nCloud Search APIs, searches at `cloudsearch.google.com`, and viewing and\nchanging configuration or reports using the Admin console. Further requests\nto the Google Cloud Search API that don't follow access levels receive a\n`PERMISSION_DENIED \"Request is prohibited by organization's policy\"` error."]]