π Google Cloud SQL Instance Automated Backups are not configured π’
- Contextual name: π SQL Instance Automated Backups are not configured π’
- ID:
/ce/ca/google/sql/sql-instance-backup
- Located in: π Google Cloud SQL
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
RELIABILITY
Similar Policiesβ
- Cloud Conformity
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
It is recommended to have all SQL database instances set to enable automated backups.
Rationaleβ
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.
Impactβ
Automated Backups will increase required size of storage and costs associated with it.
Auditβ
From Google Cloud Consoleβ
- Go to the Cloud SQL Instances page in the Google Cloud Console by visiting https://console.cloud.google.com/sql/instances.
- Click the instance name to open its instance details page.
- Go to the
Backups
menu.- Ensure that
Automated backups
is set toEnabled
andBackup time
is mentioned.From Google Cloud CLIβ
- List all Cloud SQL database instances using the following command:
gcloud sql instances list --format=json | jq '. | map(select(.instanceType != "READ_REPLICA_INSTANCE")) | .[].name'
... [see more](description.md)
Remediationβ
Remediationβ
From Google Cloud Consoleβ
- Go to the Cloud SQL Instances page in the Google Cloud Console by visiting https://console.cloud.google.com/sql/instances.
- Select the instance where the backups need to be configured.
- Click
Edit
.- In the
Backups
section, checkEnable automated backups
, and choose a backup window.- Click
Save
.From Google Cloud CLIβ
List all Cloud SQL database instances using the following command:
gcloud sql instances list --format=json | jq '. | map(select(.instanceType != "READ_REPLICA_INSTANCE")) | .[].name'
NOTE: gcloud command has been added with the filter to exclude read-replicas instances, as GCP do not provide Automated Backups for read-replica instances. 2. Enable Automated backups for every Cloud SQL database instance using the below command:
gcloud sql instances patch <INSTANCE_NAME> --backup-start-time <[HH:MM]>
The
backup-start-time
parameter is specified in 24-hour time, in the UTCΒ±00 time zone, and specifies the start of a 4-hour backup window. Backups can start any time during the backup window.
policy.yamlβ
Linked Framework Sectionsβ
Section | Sub Sections | Internal Rules | Policies | Flags |
---|---|---|---|---|
πΌ CIS GCP v3.0.0 β πΌ 6.7 Ensure That Cloud SQL Database Instances Are Configured With Automated Backups - Level 1 (Automated) | 1 | |||
πΌ Cloudaware Framework β πΌ System Configuration | 24 |