Enable Automatic Storage Increase

Trend Micro Cloud One™ – Conformity is a continuous assurance tool that provides peace of mind for your cloud infrastructure, delivering over 750 automated best practice checks.

Risk level: High (not acceptable risk)

Ensure that Automatic Storage Increase feature is enabled for your production Google Cloud SQL database instances. The feature prevents your Cloud SQL database servers from running out of storage space and become read-only, disrupting the usual database operations. If a database instance runs out of available space, it can drop existing connections and cause downtime, and Google Cloud SQL Service Level Agreement (SLA) might not cover the outage.

Reliability

When working with production databases and the automatic storage increase is enabled, the disk storage grows incrementally (and permanently), without impacting the workload. Once the Automatic Storage Increase feature is enabled, Cloud SQL service checks the available storage space on your database instance every 30 seconds. If the available storage falls below the threshold size, the cloud service automatically adds additional storage capacity. The threshold size depends on the amount of storage currently available on your instance. For database instances provisioned with 500 GB of storage or more, the threshold is always 25 GB. For database instances provisioned with less than 500 GB of storage, the following formula is used to calculate the threshold: 5 + (provisioned storage)/25. The amount of storage added to the impacted instance is equal to the threshold size.


Audit

To determine if automatic storage increase is enabled for your Google Cloud SQL database instances, perform the following operations:

Using GCP Console

01 Sign in to Google Cloud Management Console.

02 Select the Google Cloud Platform (GCP) project that you want to access from the console top navigation bar.

03 Navigate to Cloud SQL Instances dashboard at https://console.cloud.google.com/sql/instances.

04 Click on the name (ID) of the database instance that you want to examine.

05 In the Configuration section, under database version, check the Automatic Storage Increase feature status. If the feature status is set to Auto storage increase is disabled, automatic storage increase is not enabled for the selected Google Cloud SQL database instance.

06 In the navigation panel, select Overview to access the configuration details of the selected instance.

07 Repeat step no. 4 – 6 to check the Automatic Storage Increase feature status for other Cloud SQL instances available within the selected project.

08 Repeat steps no. 2 – 7 for each project deployed in your Google Cloud account.

Using GCP CLI

01 Run projects list command (Windows/macOS/Linux) using custom query filters to list the IDs of all the Google Cloud Platform (GCP) projects available in your Google Cloud account:

gcloud projects list
	--format="table(projectId)"

02 The command output should return the requested GCP project identifiers:

PROJECT_ID
cc-mobile-project-123123
cc-ml-app-project-123123

03 Run sql instances list command (Windows/macOS/Linux) using custom filtering to describe the name of each Cloud SQL database instance provisioned for the selected Google Cloud project:

gcloud sql instances list
	--project cc-mobile-project-123123
	--format="(NAME)"

04 The command output should return the requested database instance name(s):

NAME
cc-prod-db-instance
cc-web-int-db-instance

05 Run sql instances describe command (Windows/macOS/Linux) using the name of the Cloud SQL database instance that you want to examine as identifier parameter and custom query filters to describe the Automatic Storage Increase feature set for the selected database instance:

gcloud sql instances describe cc-prod-db-instance
	--format="value(settings.storageAutoResize)"

06 The command output should return the requested configuration status (True for enabled, False for disabled):

False

If the sql instances describe command output returns False, automatic storage increase is disabled for the selected Google Cloud SQL database instance.

07 Repeat step no. 5 and 6 to verify the Automatic Storage Increase feature status for other Cloud SQL instances created for the selected project.

08 Repeat steps no. 3 – 7 for each project available within your Google Cloud account.

Remediation / Resolution

To enable automatic storage increase for your production or business-critical Google Cloud SQL database instance, perform the following operations:

Using GCP Console

01 Sign in to Google Cloud Management Console.

02 Select the Google Cloud Platform (GCP) project that you want to access from the console top navigation bar.

03 Navigate to Cloud SQL Instances dashboard at https://console.cloud.google.com/sql/instances.

04 Click on the ID of the database instance that you want to reconfigure.

05 Click on the Edit button from the dashboard top menu to access the instance edit mode.

06 In the navigation panel, select Overview to access the configuration details of the selected instance.

07 In the Configuration options section, click on Machine type and storage to expand the panel with the compute capacity and storage type configured for the selected instance.

08 Under Storage capacity, select Enable automatic storage increases checkbox to enable the Automatic Storage Increase feature for the selected Cloud SQL database instance. Click Close to close the panel.

09 Click Save to apply the configuration changes.

10 Repeat step no. 4 – 9 to enable automatic storage increase for other Cloud SQL instances available within the selected project.

11 Repeat steps no. 2 – 10 for each project deployed in your Google Cloud account.

Using GCP CLI

01 Run sql instances patch command (Windows/macOS/Linux) using the name of the Cloud SQL database instance that you want to reconfigure as identifier parameter, to enable automatic storage increase for the selected database instance by adding the --storage-auto-increase parameter to the command request:

gcloud sql instances patch cc-mobile-db-instance
	--storage-auto-increase

02 The output should return the sql instances patch command request status:

The following message will be used for the patch API method.

{"name": "cc-prod-db-instance", "project": "cc-mobile-project-123123", "settings": {"storageAutoResize": true}}

Patching Cloud SQL instance...done.
Updated [https://sqladmin.googleapis.com/sql/v1beta4/projects/cc-mobile-project-123123/instances/cc-prod-db-instance].

03 Repeat step no. 1 and 2 to enable automatic storage increase for other Cloud SQL instances provisioned for the selected project.

04 Repeat steps no. 1 – 3 for each project created within your Google Cloud account.

References

Publication date Apr 21, 2021

Unlock the Remediation Steps


Gain free unlimited access
to our full Knowledge Base


Over 750 rules & best practices
for AWS and Azure

You are auditing:

Enable Automatic Storage Increase

Risk level: High