Description
It is recommended to set cross db ownership chaining
database flag for Cloud SQL SQL Server instance to off
.
This flag is deprecated for all SQL Server versions in CGP. Going forward, you can't set its value to on. However, if you have this flag enabled, we strongly recommend that you either remove the flag from your database or set it to off. For cross-database access, use the Microsoft tutorial for signing stored procedures with a certificate (https://learn.microsoft.com/en-us/sql/relational-databases/tutorial-signing-stored-procedures-with-a-certificate?view=sql-server-ver16).
Rationaleβ
Use the cross db ownership
for chaining option to configure cross-database ownership chaining for an instance of Microsoft SQL Server. This server option allows you to control cross-database ownership chaining at the database level or to allow cross-database ownership chaining for all databases. Enabling cross db ownership
is not recommended unless all of the databases hosted by the instance of SQL Server must participate in cross-database ownership chaining and you are aware of the security implications of this setting. This recommendation is applicable to SQL Server database instances.
Impactβ
Updating flags may cause the database to restart. This may cause it to unavailable for a short amount of time, so this is best done at a time of low usage. You should also determine if the tables in your databases reference another table without using credentials for that database, as turning off cross database ownership will break this relationship.
Auditβ
NOTE: This flag is deprecated for all SQL Server versions. Going forward, you can't set its value to on. However, if you have this flag enabled it should be removed from your database or set to off.
From Google Cloud Consoleβ
- Go to the Cloud SQL Instances page in the Google Cloud Console.
- Select the instance to open its
Instance Overview
page - Ensure the database flag
cross db ownership chaining
that has been set is listed under theDatabase flags
section.
From Google Cloud CLIβ
-
Ensure the below command returns
off
for every Cloud SQL SQL Server database instance:gcloud sql instances describe <INSTANCE_NAME> --format=json | jq '.settings.databaseFlags[] | select(.name=="cross db ownership chaining")|.value'
In the output, database flags are listed under the settings
as the collection databaseFlags
.
Default Valueβ
This flag is deprecated for all SQL Server versions. Going forward, you can't set its value to on.
Referencesβ
- https://cloud.google.com/sql/docs/sqlserver/flags
- https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option?view=sql-server-ver15
Additional Informationβ
WARNING: This patch modifies database flag values, which may require your instance to be restarted. Check the list of supported flags - https://cloud.google.com/sql/docs/sqlserver/flags - to see if your instance will be restarted when this patch is submitted.
Note: Some database flag settings can affect instance availability or stability, and remove the instance from the Cloud SQL SLA. For information about these flags, see Operational Guidelines.
Note: Configuring the above flag does not restart the Cloud SQL instance.