Google Compute Engine virtual machine instances are evaluated to ensure that Automatic Restart is enabled. This feature allows the Google Cloud Compute Engine service to automatically restart VM instances when they are terminated due to non-user-initiated reasons such as maintenance events, hardware failures, or software failures.
Risk
VM instances without Automatic Restart enabled will not recover automatically from host maintenance events or unexpected failures, potentially leading to prolonged service downtime and requiring manual intervention to restore services.
prowler gcp --checks compute_instance_automatic_restart_enabled
Recommendation
Enable the Automatic Restart feature for Compute Engine VM instances to enhance system reliability by automatically recovering from crashes or system-initiated terminations. This setting does not interfere with user-initiated shutdowns or stops.
Remediation
gcloud compute instances update <INSTANCE_NAME> --restart-on-failure --zone=<ZONE>
- Open Google Cloud Console → Compute Engine → VM instances
- Click on the instance name to view details
- Click 'Edit' at the top of the page
- Under 'Availability policies', set 'Automatic restart' to 'On (recommended)'
- Click 'Save' at the bottom of the page
Source Code
Resource Type
compute.googleapis.com/Instance