6.4 Ensure That the Cloud SQL Database Instance Requires All Incoming Connections To Use SSL

Information

It is recommended to enforce all incoming connections to SQL database instance to use SSL.

Rationale:

SQL database connections if successfully trapped (MITM); can reveal sensitive data like credentials, database queries, query outputs etc. For security, it is recommended to always use SSL encryption when connecting to your instance. This recommendation is applicable for Postgresql, MySql generation 1, MySql generation 2 and SQL Server 2017 instances.

Impact:

After enforcing SSL requirement for connections, existing client will not be able to communicate with Cloud SQL database instance unless they use SSL encrypted connections to communicate to Cloud SQL database instance.

Solution

From Google Cloud Console

Go to https://console.cloud.google.com/sql/instances.

Click on an instance name to see its configuration overview.

In the left-side panel, select Connections.

In the security section, select SSL mode as Allow only SSL connections.

Under Configure SSL server certificates click Create new certificate and save the setting

From Google Cloud CLI
To enforce SSL encryption for an instance run the command:

gcloud sql instances patch INSTANCE_NAME --ssl-mode= ENCRYPTED_ONLY

Note:
RESTART is required for type MySQL Generation 1 Instances (backendType: FIRST_GEN) to get this configuration in effect.

Default Value:

By default parameter settings: ipConfiguration: sslMode is not set which is equivalent to sslMode:ALLOW_UNENCRYPTED_AND_ENCRYPTED.

See Also

https://workbench.cisecurity.org/benchmarks/11843

Item Details

Category: ACCESS CONTROL, IDENTIFICATION AND AUTHENTICATION, SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|AC-17(2), 800-53|IA-5, 800-53|IA-5(1), 800-53|SC-8, 800-53|SC-8(1), CSCv7|14.4, CSCv7|16.5

Plugin: GCP

Control ID: 09e7d2844ecb913ca04f46a8ed422f2ccdb071b4b250621c714ec668c7726ab9