More Info:

Ensures the total number of VM instances does not exceed a set threshold. The number of running VM instances should be carefully audited, especially in unused regions, to ensure only approved applications are consuming compute resources. Many compromised Google accounts see large numbers of VM instances launched.

Risk Level

Low

Address

Operational Maturity

Compliance Standards

CBP

Triage and Remediation

Remediation

To remediate the misconfiguration “Total VMs Should Not Exceed Threshold” for GCP using GCP console, follow these steps:

  1. Log in to the GCP console (https://console.cloud.google.com/).
  2. Navigate to the “Compute Engine” section from the left-hand menu.
  3. Click on the “VM instances” tab.
  4. Identify the VM instances that are exceeding the threshold limit.
  5. Select the VM instance that needs to be remediated.
  6. Click on the “Delete” button to delete the instance.
  7. Repeat steps 5 and 6 for all the VM instances that are exceeding the threshold limit.
  8. Once all the VM instances have been deleted, create new instances as needed to meet your requirements, ensuring that the total number of VM instances does not exceed the threshold limit.

Alternatively, you can also set up quotas for the number of VM instances that can be created in your GCP project. This can be done by following these steps:

  1. Go to the “IAM & Admin” section from the left-hand menu.
  2. Click on “Quotas” from the submenu.
  3. Select the quota that needs to be modified (in this case, the quota for the number of VM instances).
  4. Click on the “Edit Quotas” button.
  5. Enter the new quota limit and click on the “Submit Request” button.
  6. Wait for the request to be approved by the GCP team.

Once the new quota limit is approved, you can create new VM instances within the new limit.

Additional Reading: