Google Compute Engine

Instance Automatic Restart Disabled

Ensure that Virtual Machine instances have automatic restart feature enabled.

Risk Level: Low

Description

This plugin ensures that Virtual Machine instances have the automatic restart feature enabled. This feature helps in automatically restarting the instance anytime it is set to stop due to any maintenance issue or in the event of an instance crash due to an underlying hardware issue.

About the Service

Google Cloud Compute Engine:

Google Cloud Compute Engine is a service that allows you to create Virtual Machines based on your preferences and run them on Google’s infrastructure. You can either use their predefined machines with certain default configurations or create your own custom Virtual Machine to meet your exact requirements. To know more, read here

Impact

If the Google Cloud Compute Engine instance’s automatic restart feature is disabled,  the server will shut down and not resume by default whenever an instance crashes or stops for any reason. Without this feature, if the server goes down then your instance remains halted. This reduces the performance of your instances and creates complications.

Steps to Reproduce

Using GCP Console-

  1. Log In to your GCP Console.
  2. From the top navigation bar, select the GCP project you want to investigate.
  3. From the navigation panel on the left side of the console, go to Compute Engine and select VM Instances. You can click this link here to navigate directly if you’re already logged in.
  4. Select the VM instance you want to investigate from the list of instances and go to the Details tab to examine the details of the VM instance selected.
  5. Scroll down to the Availability policies section and check the Automatic restart status. If it is set to Off, then automatic restart is disabled. This means that the virtual machine will not automatically restart in case it crashes or stops.
  6. Repeat steps 4 and 5 for all the VM instances you want to investigate in the selected project.
  7. If you have multiple projects that you want to investigate, repeat steps 2 to 6 for each project in your GCP console.

Steps for Remediation

Determine whether or not you truly require an automatic restart to be disabled. If not, make the necessary changes to enable the automatic restart of your VM instances.

The steps to enable automatic restart are-
Using GCP Console-

  1. Log In to your GCP Console.
  2. From the top navigation bar, select the GCP project you want to investigate.
  3. From the navigation panel on the left side of the console, go to Compute Engine and select VM Instances. You can use this link here to navigate directly if you’re already logged in.
  4. From the list of instances, choose the VM instance you want to reconfigure. (In case you aren’t sure which instance needs to be configured, follow the steps to reproduce listed above to determine which instance to choose.)
  5. Select the Edit option from the top navigation bar of the VM instance details page.
  6. Scroll down to the Availability policies section and select On option from the dropdown list of Automatic restart to enable automatic restart for the VM instance.
  7. Repeat steps 4 to 6 for all the VM instances you want to reconfigure in the selected project.
  8. If you have multiple projects, repeat steps 2 to 7 for each project in your GCP console.