Other Articles

Cloud SQL – Protect From Internet Access

This check ensures that Cloud SQL instances are protected from direct internet access. Restricting public exposure reduces the risk of unauthorized access, network-based attacks, and data breaches.

Check Details

  • Resource: Cloud SQL
  • Check: Protect from direct internet access
  • Risk: If Cloud SQL instances are directly accessible from the internet, attackers may attempt brute-force attacks, exploit vulnerabilities, or gain unauthorized access to sensitive data.

Remediation via Google Cloud Console

  1. Log in to the Google Cloud Console and navigate to Cloud SQL. Cloud Sql Instance
  2. Click on the affected Cloud SQL instance.
  3. Click Edit to modify the instance configuration. Cloud Sql Instance Edit
  4. Scroll to the Connections section.
  5. Under Public IP, ensure that public IP access is disabled or that no authorized networks are configured. Cloud SQL Public IP Configuration
  6. Click Save to apply the changes.

Remediation via Google Cloud CLI

  1. Open the Google Cloud Console and launch Cloud Shell. GCP Cloud Shell
  2. Disable public IP access for the Cloud SQL instance:
    
    
    gcloud sql instances patch <INSTANCE_NAME> \
    --no-assign-ip
    

Replace <INSTANCE_NAME> with your Cloud SQL instance name. Disabling public IP ensures the instance cannot be accessed directly from the internet.

Default Value

By default, Cloud SQL instances may have public IP enabled, allowing direct internet access unless explicitly restricted during instance configuration.