Check provider logo

VM instance attached disks have auto-delete disabled

compute_instance_disk_auto_delete_disabled

Severitymedium
Servicecompute
by Prowler

This check verifies whether GCP Compute Engine VM instances have auto-delete disabled for their attached persistent disks.

When auto-delete is enabled, persistent disks are automatically removed when the associated VM instance is deleted, which can lead to unintended data loss.

Risk

With auto-delete enabled, persistent disks are automatically deleted when the associated VM instance is terminated.

This could result in:

  • Permanent data loss if the instance is accidentally or intentionally deleted
  • Recovery challenges for mission-critical workloads
  • Compliance violations where data retention is required
Run this check with Prowler CLI

prowler gcp --checks compute_instance_disk_auto_delete_disabled

Recommendation

Disable auto-delete for all persistent disks attached to production and business-critical VM instances to prevent accidental data loss. Regularly review disk configurations to ensure data retention requirements are met.

Remediation

CLI

gcloud compute instances set-disk-auto-delete INSTANCE_NAME --zone=ZONE --no-auto-delete --disk=DISK_NAME

Terraform
Other
  1. Open the Google Cloud Console
  2. Navigate to Compute Engine > VM instances
  3. Click the target VM instance name
  4. Click Edit
  5. In the Boot disk section, select 'Keep disk' from the 'When deleting instance' dropdown
  6. For Additional disks, click each disk and select 'Keep disk' under 'Deletion rule'
  7. Click Save

Source Code

Resource Type

compute.googleapis.com/Instance

References