Other Articles

Cloud SQL – Enforce Password Validation

This check ensures that a password validation policy is enforced for Cloud SQL instances. Enforcing strong password policies helps protect databases from unauthorized access and credential-based attacks.

Check Details

  • Resource: Cloud SQL
  • Check: Enforce password validation policy
  • Risk: Without a password validation policy, weak or easily guessable passwords may be used, increasing the risk of unauthorized database access and data compromise.

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 Password Policy section.
  5. Enable all the checks related to Password Policy. Cloud SQL Instance Password Policy
  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. Update the Cloud SQL instance to enforce password validation flags:
    
    
    gcloud sql instances patch <INSTANCE_NAME> \
    --database-flags validate_password.policy=STRONG,validate_password.length=8
    

Replace <INSTANCE_NAME> with your Cloud SQL instance name. Available flags and values may vary based on the database engine (MySQL, PostgreSQL, or SQL Server).

Default Value

By default, password validation policies are not enforced for Cloud SQL instances. Weak passwords may be allowed unless explicit validation rules are configured.