Google Cloud SQL

DB Non-Restorable

Ensures SQL instances can be restored to a recent point.

Risk Level: Low

Description

This plugin ensures that the SQL instances have automated backups and point-in-time recovery features enabled. When automated backups are enabled, you may additionally specify a timeframe for them to occur. Backups take place on a daily basis, depending on the timeframe you select. The oldest backup is erased after seven days by default, but the retention parameters can be modified to any value between 1 to 365 days. You can recover from a backup starting at a certain point in time if point-in-time recovery is enabled.

About the Service

Google Cloud SQL:

Google Cloud SQL is a relational database for MySQL, PostgreSQL, and SQL Server that is fully managed. It automates database provisioning, storage capacity management, replication, and backups while lowering maintenance costs. It can be set up easily using the built-in migration tools and lets you scale your instances effortlessly. To know more about Cloud SQL, read here

Impact

Without automated backups and binary logging enabled, you will not be able to recover from a backup. In addition to this, you will also not be able to create replicas or clone instances. Enabling these features is critical because they aid in data recovery in the event of accidental data deletion, data corruption, or data failure.

Steps to Reproduce

Using GCP Console-

  1. Log In to your GCP Console.
  2. From the top navigation bar, select the GCP project you want to investigate.
  3. From the navigation panel on the left side of the console, go to SQL. You can use this link here to navigate directly if you’re already logged in.
  4. Select the Instance ID of the SQL instance you want to investigate from the list of instances available and click on the BACKUPS tab to check the backup configuration of the selected instance.

  5. Under the Settings section, check the configuration status of Automated backups and Point-in-time recovery. Even if one of them is set to disabled, the selected database is non-restorable.
    (or)
  6. Repeat steps 4 and 5 for all the SQL instances you want to investigate in the selected project.
  7. If you have multiple projects, repeat steps 2 to 6 for each project in your GCP Console. 

Steps for Remediation

Determine whether or not you truly require your SQL instances to be non-restorable. If not, make the necessary changes using the steps below.


Using GCP Console-

  1. Log In to your GCP Console.
  2. From the top navigation bar, select the GCP project you want to investigate.
  3. From the navigation panel on the left side of the console, go to SQL. You can use this link here to navigate directly if you’re already logged in.
  4. Select the ID of the SQL instance you want to reconfigure in the list of instances available and click on the BACKUPS tab. (In case you aren’t sure which SQL instance needs to be configured, follow the steps to reproduce listed above to determine which to choose.)



  5. Click on the EDIT button in the Settings section to enter the edit mode.
  6. Check the Automate backups and Enable point-in-time recovery option and choose your desired time slot for your data to be automatically backed up. Click SAVE to apply all the changes.
  7. Repeat steps 4 to 6 for all the SQL instances you want to reconfigure in the selected project.
  8. If you have multiple projects, repeat steps 2 to 7 for each project in your GCP console.