Back to Checks
gcp

Cloud SQL database instance has automated backups configured

cloudsql_instance_automated_backups
Service: cloudsqlSeverity: high
OfficialBuilt-inVerified
Categories:resilience
Resource Type:sqladmin.googleapis.com/Instance

Cloud SQL instances are checked for automated backups being configured to run on a schedule and support point-in-time recovery.

Risk

Absent automated backups, unintended deletes, corruption, or ransomware can become irreversible. This degrades data integrity and availability, removes point-in-time recovery options, and widens RPO/RTO, causing prolonged outages and incomplete restoration after incidents or schema changes.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler gcp --checks cloudsql_instance_automated_backups

Recommendation

Enable automated backups on all Cloud SQL instances holding important data. Set retention and schedules to meet RPO/RTO, and enable point-in-time recovery. Apply least privilege to backup access, use separation of duties, consider cross-region resilience, and regularly test restores with monitoring and alerts for failures.

Remediation

CLI

gcloud sql instances patch <INSTANCE_NAME> --backup-start-time <HH:MM>

Terraform

resource "google_sql_database_instance" "<example_resource_name>" {
  name             = "<example_resource_id>"
  database_version = "POSTGRES_14"
  region           = "<REGION>"

  settings {
    tier = "db-custom-1-3840"

    backup_configuration {
      enabled    = true      # Critical: turns on automated backups
      start_time = "02:00"  # Critical: required to enable backups and set start time
    }
  }
}

Other

1In Google Cloud Console, go to Cloud SQL > Instances
2Click your instance name, then click Edit
3In the Backups section, enable Automated backups and set a Start time
4Click Save to apply

Check Code

from prowler.lib.check.models import Check, Check_Report_GCP
from prowler.providers.gcp.services.cloudsql.cloudsql_client import cloudsql_client


class cloudsql_instance_automated_backups(Check):
    def execute(self) -> Check_Report_GCP:
        findings = []
        for instance in cloudsql_client.instances:
            report = Check_Report_GCP(metadata=self.metadata(), resource=instance)
            report.status = "PASS"
            report.status_extended = (
                f"Database Instance {instance.name} has automated backups configured."
            )
            if not instance.automated_backups:
                report.status = "FAIL"
                report.status_extended = f"Database Instance {instance.name} does not have automated backups configured."
            findings.append(report)

        return findings