MEDIUM
Source
Trivy
ID
AVD-GCP-0019

Cross-database ownership chaining should be disabled

Cross-database ownership chaining, also known as cross-database chaining, is a security feature of SQL Server that allows users of databases access to other databases besides the one they are currently using.

Impact

Unintended access to sensitive data

Follow the appropriate remediation steps below to resolve the issue.

Disable cross database ownership chaining

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 resource "google_sql_database_instance" "db" {
 	name             = "db"
 	database_version = "SQLSERVER_2017_STANDARD"
 	region           = "us-central1"
 	settings {
 	    database_flags {
 		    name  = "cross db ownership chaining"
 		    value = "off"
 		}
 	}
 }