Check ID: cloudsql_instance_sqlserver_contained_database_authentication_flag
Provider: GCP
Service: cloudsql
Severity: MEDIUM
Categories: identity-access
Resource type: sqladmin.googleapis.com/Instance

What this check verifies

Cloud SQL for SQL Server instances are evaluated for the contained database authentication setting. The check inspects the contained database authentication flag and expects its value to be off.

Risk

Enabling contained authentication moves identity checks to the database, bypassing server-level logins and policies. This weakens centralized controls and auditing, enables password spraying on contained users, and can persist users across copies, increasing unauthorized data access and tampering risk to confidentiality and integrity.

Recommendation

Keep contained database authentication set to off. Centralize authentication and auditing at the server layer or via directory integration, and apply least privilege. Avoid USER WITH PASSWORD contained users. If containment is unavoidable, tightly scope usage, enforce strong credentials, and monitor login activity.

Remediation

gcloud sql instances patch <INSTANCE_NAME> --database-flags="contained database authentication"=off

References

Where this check fires

This check runs on every scheduled scan against your GCP account. Findings appear at Cloud Security → Findings filterable by Check ID = cloudsql_instance_sqlserver_contained_database_authentication_flag. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to GCP checks