Database resources with SSL enforcement disabled allow unencrypted connections, which can expose sensitive data during transmission. This security vulnerability falls under CWE-319: Cleartext Transmission of Sensitive Information.
When sslEnforcement is set to "Disabled", database connections can be established without SSL/TLS encryption. This creates several security risks:
- Data Exposure: Database credentials, queries, and results are transmitted in plain text
- Man-in-the-Middle Attacks: Attackers can intercept and modify database communications
- Credential Theft: Database usernames and passwords can be captured by network sniffers
- Data Integrity: Unencrypted data can be tampered with during transmission
- Compliance Violations: Many regulations require encryption of data in transit
This vulnerability affects all database types including:
- Azure SQL Database and Managed Instance
- Azure Database for PostgreSQL
- Azure Database for MySQL
- Azure Database for MariaDB
Always enable SSL enforcement by setting sslEnforcement to "Enabled" in the database properties. Additionally:
- Configure TLS Version: Use
minimalTlsVersionto enforce strong TLS versions (1.2 or higher) - Client Configuration: Ensure client applications are configured to use SSL connections
- Certificate Validation: Configure clients to validate server certificates
- Connection Strings: Update connection strings to require SSL/TLS
resource insecurePostgreSQLServer 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = {
name: 'insecure-postgresql'
location: 'eastus'
properties: {
sslEnforcement: 'Disabled' // Vulnerable: Allows unencrypted connections
administratorLogin: 'pgadmin'
administratorLoginPassword: password
}
}
resource insecureMySQLServer 'Microsoft.DBforMySQL/servers@2017-12-01' = {
name: 'insecure-mysql'
location: 'eastus'
properties: {
sslEnforcement: 'Disabled' // Vulnerable: Allows unencrypted connections
administratorLogin: 'mysqladmin'
administratorLoginPassword: password
}
}resource securePostgreSQLServer 'Microsoft.DBforPostgreSQL/servers@2017-12-01' = {
name: 'secure-postgresql'
location: 'eastus'
properties: {
sslEnforcement: 'Enabled' // Secure: Requires SSL/TLS encryption
minimalTlsVersion: '1.2' // Secure: Enforces strong TLS version
administratorLogin: 'pgadmin'
administratorLoginPassword: password
}
}
resource secureMySQLServer 'Microsoft.DBforMySQL/servers@2017-12-01' = {
name: 'secure-mysql'
location: 'eastus'
properties: {
sslEnforcement: 'Enabled' // Secure: Requires SSL/TLS encryption
minimalTlsVersion: 'TLS1_2' // Secure: Enforces strong TLS version
administratorLogin: 'mysqladmin'
administratorLoginPassword: password
}
}