Contained database authentication is enabled Affecting Cloud SQL service in Google


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Data/ Access

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-GoogleCSA-CCMHIPAAISO-27001SOC-2
  • Snyk IDSNYK-CC-00358
  • creditSnyk Research Team

Description

Users can connect to a contained database without authenticating at the Database Engine level. Contained databases have some unique security threats mostly related with the USER WITH PASSWORD authentication process, which moves the authentication boundary from the Database Engine level to the database level.

How to fix?

Set settings.database_flags.name attribute to "contained database authentication", and settings.database_flags.value attribute to "off".

Example Configuration

resource "google_sql_database_instance" "allowed" {
  name             = "master-instance"
  database_version = "SQLSERVER_2017_STANDARD"
  region           = "us-central1"

  settings {
    tier = "db-f1-micro"
    database_flags {
      name  = "contained database authentication"
      value = "off"
    }
  }
}