Skip to main content

Triage and Remediation

Remediation

Using Console

Below are concise step‑by‑step instructions using only the GCP Console.

1. Create (or identify) a non‑default VPC network

  1. In the Google Cloud console, go to VPC network:
    Navigation menu → Networking → VPC network → VPC networks.
  2. Check if you already have a non‑default VPC (any network that is not named default).
    • If yes, note its Name, Subnets, and Region, then skip to section 2.
  3. To create a new VPC:
    1. Click Create VPC network.
    2. Enter a Name (e.g., vertex-notebooks-vpc).
    3. For Subnet creation mode, select Custom.
    4. Click Add subnet:
      • Name: e.g., vertex-notebooks-subnet
      • Region: choose the same region where you will run Vertex AI notebooks.
      • IP address range: e.g., 10.10.0.0/24 (or per your IP plan).
    5. Configure any Firewall rules as required for your environment (e.g., SSH, HTTPS, internal).
    6. Click Create.

2. Create a new Vertex AI notebook using the non‑default VPC

Network cannot be changed on an existing instance, so you must create a new one and move your work.
  1. In the console, go to Vertex AI Workbench:
    Navigation menu → Vertex AI → Workbench.
  2. Click New notebook (or CreateUser-managed notebooks / Managed notebooks, depending on type).
  3. Choose your Region (match the subnet’s region if possible).
  4. Configure machine type, image, etc.
  5. Expand Advanced options (or Networking section; exact wording may vary by UI version).
  6. Under Network:
    • Network: select your non‑default VPC (e.g., vertex-notebooks-vpc).
    • Subnet: select the custom subnet (e.g., vertex-notebooks-subnet).
  7. Optionally adjust:
    • External IP (decide if you want a public IP or only private).
    • Firewall tags or rules, if exposed.
  8. Click Create.
Migrate your work (e.g., copy notebooks, data) from the old instance to the new one (via Git, Cloud Storage, SCP, etc.).

3. Stop using and remove notebooks on the default VPC

  1. In Vertex AI → Workbench, list all notebook instances.
  2. For each instance:
    1. Click the instance name.
    2. Go to the Details or Networking section and verify the Network:
      • If the Network is default, it is non‑compliant with your requirement.
    3. After you have migrated workloads to a notebook on a custom VPC:
      • Stop the old instance if it is running.
      • Click Delete to remove it.

4. (Optional) Prevent new notebooks from using the default network

If you want to enforce this at the org/project level:
  1. In the console, go to IAM & Admin → Organization policies.
  2. Look for VPC‑related constraints (e.g., constraints that limit use of the default network or enforce custom networks).
  3. Configure policies so that users cannot create resources on the default network (or consider deleting the default network entirely if it’s not needed and safe to do so).

After these steps, all Vertex AI notebook instances you actively use will be attached to non‑default VPC networks.
Below are step‑by‑step GCP CLI instructions to ensure Vertex AI Workbench / Notebook instances no longer use the default VPC network.Assumptions:
  • You have gcloud installed and authenticated.
  • Replace placeholder values (PROJECT_ID, REGION, NETWORK_NAME, etc.) with your own.

1. Identify notebooks using the default VPC

Vertex AI Workbench user‑managed notebooks run on Compute Engine VMs. We’ll inspect those VMs’ networks.
Any instance where gceSetup.network is default (or empty and thus implicitly default) must be remediated.

2. Create a dedicated VPC network and subnet


3. Add minimal firewall rules for notebook access

Example: allow SSH and HTTPS (adjust to your security policy).
If notebooks should be private-only (no external IPs), skip or further restrict these rules and ensure no external IP is assigned when creating instances.

4. Create new Vertex AI notebook instances on the custom VPC

You cannot change the network of an existing underlying VM; you must create a new instance that uses the custom VPC.Example: create a new Workbench user‑managed instance:
Key flags:
  • --network=$NETWORK_NAME ensures it is not using default.
  • --subnet=$SUBNET_NAME pins it to the custom subnet.
  • --no-public-ip (optional but recommended for locked‑down environments).

5. Migrate workloads and delete old instances using the default network

For each old notebook instance on default:
  1. Connect and copy data (e.g., using gsutil to move notebooks to Cloud Storage or scp between instances).
  2. Validate that your workloads run correctly on the new instance.
  3. Delete the old instance:

Option A: Remove/lock down the default network

If no other workloads depend on default, you can delete it:
Only do this if you are sure nothing else requires the default VPC.

Option B: Use org policies

At the org/folder/project level, you can set policies to prevent default network use (requires org admin privileges). Example (conceptual; may need org-level permissions):
Where policy.yaml contains constraints such as:
  • constraints/compute.skipDefaultNetworkCreation
  • constraints/compute.restrictVpcPeering
  • (and any internal policy constraining network choices).

By following these steps, all current and future Vertex AI notebook instances will be created on your custom VPC network instead of the default VPC.
Below is a practical remediation approach using Python:Goal:
No Vertex AI Workbench notebook instance should be attached to the default VPC network. Instead, they should use a dedicated/custom VPC.

1. Prerequisites

Make sure:
  • Your account has permissions: compute.networkAdmin, notebooks.admin (or similar).
  • GOOGLE_CLOUD_PROJECT env var is set, or you’ll pass the project ID into the script.

2. Create / Ensure a Custom VPC and Subnet (Python)

If you don’t already have a non-default VPC, create one. Example uses google-api-python-client for Compute:

3. Identify Notebook Instances Using the Default Network

For Vertex AI Workbench managed notebooks, use google-cloud-notebooks:
If you are also using user-managed notebooks (legacy AI Platform Notebooks), adapt similarly using the same client (they are also exposed via notebooks_v1 but under different resource paths).

4. Recreate Notebooks on the Custom Network

Network configuration is effectively immutable for Workbench notebook instances, so remediation is:
  1. Capture configuration of existing instance.
  2. Create a new instance with the same settings but with network (and optionally subnet) pointing to your custom VPC.
  3. Migrate data (via attached disks, snapshots, Git, or copying files).
  4. Delete the old instance.
Example: clone basic properties and create a replacement instance:
Note: Data migration strategy depends on how notebooks store data (boot disk, extra data disk, Git repos). Automating disk reattachment is possible but more complex; keep that separate if needed.

5. Enforce Going Forward (Prevent New Use of Default VPC)

For future notebooks:
  • Ensure your automation or infra-as-code (Terraform, Deployment Manager, custom scripts) always sets network (and subnet) explicitly to your custom VPC when calling create_instance.
  • Optionally use Organization Policy / security controls to:
    • Restrict use of the default network.
    • Require private IP / specific networks for Vertex AI Workbench.

If you specify whether you use managed vs. user-managed notebooks and whether you want disk migration automated, I can provide a more exact Python script tailored to that.
Changing the network_interface.network / subnetwork of an existing google_notebooks_instance forces replacement of the instance (recreate and potential downtime), so apply carefully.To verify, terraform plan should show either:
  • creation of a new google_notebooks_instance attached to VERTEX_NETWORK, or
  • replacement of the existing instance where the only network change is from projects/PROJECT_ID/global/networks/default (or similar) to your custom VERTEX_NETWORK.