Control: 6.7 Ensure that Cloud SQL database instances are configured with automated backups
It is recommended to have all SQL database instances set to enable automated backups.
Backups provide a way to restore a Cloud SQL instance to recover lost data or recover from a problem with that instance. Automated backups need to be set for any instance that contains data that should be protected from loss or damage.
This recommendation is applicable for SQL Server, PostgreSQL, MySQL generation 1 and MySQL generation 2 instances.
- Login in to Cloud SQL Instances
- Select the instance where the backups need to be configured.
- Click Edit.
- In the
Enable automated backups, and choose a backup window.
- Click Save
From Command Line
- List all Cloud SQL database instances using the following command:
gcloud sql instances list
- Enable Automated backups for every Cloud SQL database instance using the below command:
gcloud sql instances patch INSTANCE_NAME --backup-start-time [HH:MM]
Note: By default, automated backups are not configured for Cloud SQL instances. Data backup is not possible on any Cloud SQL instance unless Automated Backup is configured.
steampipe check gcp_compliance.control.cis_v120_6_7
This control uses a named query:sql_instance_automated_backups_enabled