Skip to main content

More Info:

Ensure that Private Service Connect endpoints are configured for your Vertex AI resources

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS GCP

Triage and Remediation

Remediation

Using Console

Below are step‑by‑step instructions to configure Private Service Connect (PSC) endpoints for Vertex AI using the Google Cloud Console.

1. Prerequisites

  1. Make sure the following APIs are enabled in your project:
    • Vertex AI API (aiplatform.googleapis.com)
    • Compute Engine API (compute.googleapis.com)
    • Service Networking API (servicenetworking.googleapis.com)
  2. You must have:
    • A VPC network and subnet in the region where your Vertex AI workloads run.
    • Permissions: compute.admin or equivalent, and DNS admin if you manage Cloud DNS.

2. Create a PSC endpoint for Google APIs (Vertex AI)

  1. In the console, go to:
    Navigation menu → VPC network → Private Service Connect.
  2. Click Create endpoint.
  3. Under Endpoint type, select:
    • “Access Google APIs” (or similar wording like “Connect to Google APIs”).
  4. Configure the endpoint:
    • Project: your project.
    • Network: choose the VPC network your workloads use.
    • Subnet: choose the subnet your workloads are in (must have free IPs).
    • Region: same region where your Vertex AI resources run (e.g., us-central1).
    • Endpoint IP address: either let Google assign automatically or choose a specific internal IP from the subnet.
  5. In Target Google APIs:
    • Choose “All Google APIs” or “Selected APIs”.
    • If selecting, make sure the Vertex AI endpoint is included (aiplatform.googleapis.com or regional endpoint like us-central1-aiplatform.googleapis.com depending on UI).
  6. Click Create and wait for the endpoint state to become Ready.

3. Configure private DNS for Vertex AI

You must route the Vertex AI API hostname(s) to your PSC endpoint’s internal IP.
  1. In the console, go to:
    Navigation menu → Network services → Cloud DNS.
  2. Click Create zone.
  3. Create a private DNS zone:
    • Zone type: Private.
    • Name: e.g., vertex-ai-private-zone.
    • DNS name (pick one of these depending on how you access Vertex AI):
      • For regional endpoints: e.g., us-central1-aiplatform.googleapis.com.
      • Or for global: aiplatform.googleapis.com.
        (Match how your clients call the API.)
    • Network: attach the same VPC network as your workloads.
  4. After the zone is created, click into it and create an A record:
    • DNS name: @ (root of the zone, or leave empty in UI).
    • Record type: A.
    • TTL: e.g., 300.
    • IPv4 address: the internal IP of your PSC endpoint (from step 2).
  5. Save the record.
Repeat with additional zones/records if you use multiple regional Vertex AI endpoints.

4. Verify that traffic uses PSC

From a VM or GKE Pod in the same VPC/subnet:
  1. Run a DNS lookup:
    • nslookup us-central1-aiplatform.googleapis.com (or your chosen hostname)
      Ensure it resolves to your PSC endpoint’s internal IP.
  2. Call the Vertex AI API from inside the VPC:
    • If DNS is correct, the call is routed via the PSC endpoint (private IP), not over the public internet.

5. Use Vertex AI resources with PSC

Once DNS is in place, no extra setting is needed in the Vertex AI resource itself. Any client (VM, GKE, Cloud Run with Serverless VPC Access connector, etc.) in that VPC that calls the Vertex AI endpoint hostname will automatically go through the PSC endpoint.If you use custom code or SDKs, ensure:
  • You call the same hostname for which you created the DNS zone (e.g., us-central1-aiplatform.googleapis.com).
  • You do not hardcode public IPs or bypass DNS.

Following these steps ensures your Vertex AI traffic is routed privately via Private Service Connect.
Below is a concise, CLI‑only, step‑by‑step way to set up a Private Service Connect (PSC) endpoint so your Vertex AI traffic stays on your VPC.Assumptions (adapt as needed):
  • Project ID: PROJECT_ID
  • VPC network: VPC_NETWORK
  • PSC IP: 10.10.0.5 (must be unused and in a subnet range routed in your VPC)
  • Vertex region: REGION (e.g. us-central1)

1. Set project and variables


2. Enable required APIs


3. Reserve a global PSC address in your VPC


4. Create the PSC forwarding rule for Google APIs / Vertex AI

Option A – only Vertex AI via PSC (recommended if you want to scope it):
Option B – all Google APIs via PSC (Vertex AI included):
Use only one of the options.

5. Create a private DNS zone for googleapis.com


6. Create DNS records for Vertex AI endpoint

Vertex AI regional endpoint format:
REGION-aiplatform.googleapis.com
(e.g. us-central1-aiplatform.googleapis.com)
If you also call the global endpoint aiplatform.googleapis.com (no region), add:

7. Verify from a VM in the VPC

From a VM in VPC_NETWORK:
You should see:
  • DNS resolving to 10.10.0.5
  • HTTP status 200 or 401 (unauthorized is fine; it proves connectivity via PSC)
Once this is in place, your Vertex AI traffic from that VPC will use the Private Service Connect endpoint instead of the public internet, remediating the misconfiguration.
Below is a practical, step‑by‑step approach to ensure your Vertex AI traffic goes over a Private Service Connect (PSC) endpoint, with Python examples where the API supports it. Some PSC steps are still usually done with gcloud/Terraform, but I’ll show the Python API equivalents where possible.

1. Prerequisites

  1. A VPC network and subnet where your workloads run.
  2. google-cloud-compute and google-cloud-aiplatform libraries installed:
  1. Vertex AI and Compute Engine APIs enabled for the project.

2. Identify the Vertex AI PSC Service Attachment

Vertex AI exposes regional service attachments in the producer project service-<PROJECT_NUMBER>@gcp-sa-aiplatform.iam.gserviceaccount.com, but you don’t need to create them; Google manages them.For PSC to Google APIs (including Vertex AI), you typically use the Google‑managed producer:
  • servicenetworking.googleapis.com for private services access, or
  • regional service attachments exposed for Vertex AI in your region (e.g., aiplatform.googleapis.com via PSC).
The PSC “endpoint” in your VPC is a forwarding rule pointing to a service attachment managed by Google.

3. Create a PSC Endpoint in Your VPC (Python)

You create:
  1. An internal IP address.
  2. A PSC forwarding rule that points to the service attachment for Vertex AI in your region.
Notes:
  • You must use the correct service attachment name for Vertex AI in your region. Get it via gcloud compute service-attachments list --project=<producer> or from Vertex AI PSC docs.
  • The endpoint is created in your consumer project’s VPC.

4. Configure DNS to Route Vertex AI Traffic to the PSC Endpoint

Create a private DNS zone so REGION-aiplatform.googleapis.com (or the host you use) resolves to the PSC IP.You can do this with the Cloud DNS API, but it’s typically easier with gcloud. Python equivalent (simplified):
Important:
  • Use the exact hostname that your Vertex AI client will call (e.g. us-central1-aiplatform.googleapis.com).
  • Ensure this is a private zone linked to your VPC (Cloud DNS managed zone with appropriate privateVisibilityConfig if using REST/infra as code).

5. Use Vertex AI Over PSC from Python

Once DNS is in place, your workloads in the VPC will resolve the Vertex AI regional endpoint to the PSC IP and route privately.Use the regional endpoint as usual:
If DNS is correctly configured, no extra PSC-specific flags are required in the Vertex AI client; it simply resolves to the private IP and uses PSC.

6. Verification

From a VM or container in the VPC:
  1. Check DNS resolution:
It should return the PSC IP you created.
  1. Run a simple Vertex AI call (like the Model.list() above) and confirm:
    • The call succeeds.
    • In VPC Flow Logs (if enabled), traffic to the PSC IP (TCP/443) is visible, not to public IPs.

If you share your region and whether you want the exact service‑attachment name lookup shown via gcloud, I can tailor the service_attachment field precisely for your case.