Configure Automatic Storage Increase Limit

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: Medium (should be achieved)

Ensure there is an optimal limit configured for the Automatic Storage Increase feature within your Cloud SQL database instance settings in order to avoid unexpected charges on your Google Cloud bill. Prior to running this conformity rule, the automatic storage increase limit must be defined in the rule settings, on the Trend Micro Cloud One™ – Conformity account console.

Cost
optimisation

Automatic Storage Increase feature prevents your Cloud SQL instances from running out of storage space, become read-only, and disrupting the usual database operations. When automatic storage increase is enabled, you can provide a specific limit on how large the disk storage for your instance can automatically grow. Having this limit set to zero (default), means that there is no limit configured for the storage growth (other than the maximum available storage for the instance tier), therefore a spike in storage requirements can permanently increase storage costs for your instance. Because you cannot decrease storage size on demand, configuring this limit can prevent your instance disk size from growing too large and increase service costs.

Note: Trend Micro Cloud One™ – Conformity assumes that Automatic Storage Increase feature is enabled for your Cloud SQL database instances. If the feature is not already enabled, see this conformity rule to enable automatic storage increase for your database instances.


Audit

To determine if there is an optimal automatic storage increase limit configured for your Cloud SQL database instances, perform the following actions:

Note: Getting automatic storage increase limit for Cloud SQL instances using Google Cloud Platform (GCP) Console is not currently supported.

Using GCP CLI

01 Sign in to your Trend Micro Cloud One™ – Conformity account, access Configure Automatic Storage Increase Limit conformity rule settings and identify the automatic storage increase limit (integer value of GB) defined for the rule.

02 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)"

03 The command output should return the requested GCP project identifiers (IDs):

PROJECT_ID
cc-mobile-project-123123
cc-bigdata-project-123123

04 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)"

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

NAME
cc-prod-sql-db-instance
cc-ad-data-sql-instance

06 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 limit set for the selected database instance:

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

07 The command output should return the storage capacity limit configured for the selected instance (number of GB):

0

If the sql instances describe command output returns 0 (zero), as shown in the example above, there is no limit configured for the Automatic Storage Increase feature (i.e. unlimited increase). If the automatic storage increase limit configured for the selected Google Cloud SQL database instance is different than zero but is higher than the capacity limit identified at step no. 1, the automatic storage increase limit set for the selected database instance is not compliant.

08 Repeat step no. 6 and 7 to verify the storage limit configured for other Cloud SQL instances created for the selected project.

09 Repeat steps no. 4 – 8 for each project available within your Google Cloud Platform (GCP) account.

Remediation / Resolution

To configure automatic storage increase limit for your Google Cloud SQL database instance in accordance with your organization's rules, perform the following actions:

Note: Setting automatic storage increase limit for Cloud SQL instances using Google Cloud Platform (GCP) Console is not currently supported.

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 configure the automatic storage increase limit for the selected database instance by adding the --storage-auto-increase-limit parameter to the command request. This allows you to set a maximum storage capacity, in GB. Automatic increases to your instance storage capacity will stop once this limit has been reached. In the following example, the automatic storage increase limit is set to 500 GB:

gcloud sql instances patch cc-prod-sql-db-instance
	--storage-auto-increase-limit=500

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-sql-db-instance", "project": "cc-mobile-project-123123", "settings": {"storageAutoResizeLimit": "500"}}

Patching Cloud SQL instance...done.

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

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

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

References

Publication date May 4, 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:

Configure Automatic Storage Increase Limit

Risk level: Medium