Cross DB ownership chaining 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-00356
  • creditSnyk Research Team

Description

The SQL Server database instance flag 'cross db ownership chaining' allows you to control cross-database ownership chaining at the database level or to allow cross-database ownership chaining for all databases. This flag should be set to off unless all of the databases hosted on this instance must participate in cross-database ownership chaining and you are aware of the security implications of doing this.

How to fix?

Set settings.database_flags.name attribute to "cross db ownership chaining", 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  = "cross db ownership chaining"
      value = "off"
    }
  }
}