Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “Databases should have SSL” for GCP using GCP console, follow the below steps:
  1. Open the GCP Console and navigate to the Cloud SQL Instances page.
  2. Select the instance that you want to configure SSL for.
  3. Click on the “Edit” button at the top of the page.
  4. Scroll down to the “SSL” section and click on the “Show Configuration Options” button.
  5. Select the option “Server-ca.pem” for “Server Certificate” and “Client-cert.pem” for “Client Certificate”.
  6. Click on the “Save” button to apply the changes.
After following the above steps, SSL will be enabled for the selected instance in GCP.

To remediate the misconfiguration “Databases Should Have SSL” for GCP using GCP CLI, follow these steps:
  1. Open the Cloud Shell in the GCP Console.
  2. Run the following command to list all the Cloud SQL instances in your project:
  1. Identify the instance that needs to be remediated and note down its name.
  2. Run the following command to enable SSL for the Cloud SQL instance:
Replace [INSTANCE_NAME] with the name of your Cloud SQL instance.
  1. Verify that SSL is enabled for the Cloud SQL instance by running the following command:
Replace [INSTANCE_NAME] with the name of your Cloud SQL instance.
  1. If the output of the above command shows “requireSsl: true”, then SSL has been successfully enabled for the Cloud SQL instance.
  2. Repeat the above steps for all the Cloud SQL instances in your project that need to have SSL enabled.
By following the above steps, you can remediate the misconfiguration “Databases Should Have SSL” for GCP using GCP CLI.
To remediate the misconfiguration of databases not having SSL in GCP using Python, you can follow the below steps:
  1. First, connect to the Cloud SQL instance using the Cloud SQL Admin API and authenticate using the Google Application Default Credentials (ADC).
  1. Next, retrieve the current instance settings using the instances().get() method.
  1. Check if SSL is enabled for the instance. If not, enable it using the settings().update() method.
  1. Finally, verify that SSL is enabled by checking the requireSsl property of the instance settings.
By following the above steps, you can remediate the misconfiguration of databases not having SSL in GCP using Python.
Changing require_ssl from false to true is an in‑place update and does not force replacement of the instance, though existing non‑SSL clients will start failing to connect and must switch to SSL.To verify, terraform plan should show an in‑place update on google_sql_database_instance.PRIMARY_INSTANCE with settings.0.ip_configuration.0.require_ssl changing from false (or null) to true.