By default, GCP SQL instances offer encryption in transit, with support for TLS, but insecure connections are still accepted. On an unsecured network, such as a public network, the risk of traffic being intercepted is high. When the data isn't encrypted, an attacker can intercept it and read confidential information.
When creating a GCP SQL instance, a public IP address is automatically assigned to it and connections to the SQL instance from public networks can be authorized.
TLS is automatically used when connecting to SQL instances through:
* The https://cloud.google.com/sql/docs/mysql/connect-admin-proxy[Cloud SQL Auth proxy].
* The https://cloud.google.com/sql/docs/mysql/connect-overview#languages[Java Socket Library].
* The built-in mechanisms in the https://cloud.google.com/appengine/docs[App Engine] environments.
== Ask Yourself Whether
Connections are not already automatically encrypted by GCP (eg: SQL Auth proxy) and
* Connections to the SQL instance are performed on untrusted networks.
* The data stored in the SQL instance is confidential.
There is a risk if you answered yes to any of those questions.
== Recommended Secure Coding Practices
It's recommended to encrypt all connections to the SQL instance, whether using public or private IP addresses. However, since private networks can be considered trusted, requiring TLS in this situation is usually a lower priority task.