Check ID:
Provider: GCP
Service:
Severity: HIGH
Categories:
Resource type:
cloudsql_instance_sqlserver_external_scripts_enabled_flagProvider: GCP
Service:
cloudsqlSeverity: HIGH
Categories:
vulnerabilitiesResource type:
sqladmin.googleapis.com/InstanceWhat this check verifies
Cloud SQL for SQL Server instances have theexternal scripts enabled database flag set to off
Risk
Allowing external scripts lets SQL invoke language extensions (e.g., R/Python), enabling arbitrary code execution. This can cause data exfiltration (confidentiality), tampered query results (integrity), and resource exhaustion or service degradation (availability), and may facilitate lateral movement from the database layer.Recommendation
Keepexternal scripts enabled set to off. Apply least privilege and defense in depth by disabling code-execution features in the database. If analytics are required, use isolated instances, restrict outbound network access, and enforce change control and auditing to prevent misuse.
Remediation
- CLI
- Terraform
- Dashboard steps
References
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudSQL/disable-external-scripts-enabled-flag.html
- https://cloud.google.com/sql/docs/sqlserver/flags
Where this check fires
This check runs on every scheduled scan against your GCP account. Findings appear at Cloud Security → Findings filterable byCheck ID = cloudsql_instance_sqlserver_external_scripts_enabled_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