---
title: SQL database instances should enforce SSL for all incoming connections
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > SQL database instances should enforce
  SSL for all incoming connections
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# SQL database instances should enforce SSL for all incoming connections
 
## Description{% #description %}

This control ensures that SSL encryption is enabled for SQL database connections, which include PostgreSQL, MySQL (generation 1 and 2), and SQL Server 2017 instances. Using SSL encryption protects sensitive data such as credentials, database queries, and query outputs from being intercepted through a Man-in-the-Middle (MITM) attack. Enforcing SSL encryption enhances the security of database connections by ensuring that all data exchanged between clients and the Cloud SQL database instance is securely transmitted. An instance passes when its SSL mode is `ENCRYPTED_ONLY` or `TRUSTED_CLIENT_CERTIFICATE_REQUIRED`. On-premises instances (`ON_PREMISES_INSTANCE`), which represent external replication sources that Cloud SQL does not manage, are skipped. An instance with a missing or unspecified instance type fails, because its scope cannot be determined.

## Remediation{% #remediation %}

To enforce SSL encryption for your database connections, follow the instructions for your database engine: [MySQL](https://docs.cloud.google.com/sql/docs/mysql/configure-ssl-instance#enforce-ssl), [PostgreSQL](https://docs.cloud.google.com/sql/docs/postgres/configure-ssl-instance#enforce-ssl), or [SQL Server](https://docs.cloud.google.com/sql/docs/sqlserver/configure-ssl-instance#enforce-ssl).
