Description
Enable require_secure_transport on PostgreSQL flexible servers.
Rationaleβ
SSL connectivity provides an additional layer of security by connecting the database server to client applications using Secure Sockets Layer (SSL). Enforcing SSL connections between the database server and client applications helps protect against "man in the middle" attacks by encrypting the data stream between the server and application.
Auditβ
From Azure Portalβ
- Log in to Azure Portal using https://portal.azure.com.
- Go to
Azure Database for PostgreSQL flexible servers. - For each database, under
Settings, clickServer parameters. - In the filter bar, type
require_secure_transport. - Ensure that the
VALUEforrequire_secure_transportis set toON.
From Azure CLIβ
Ensure the following command returns a value of on:
az postgres flexible-server parameter show \
--resource-group {{resource-group-name}} \
--server-name {{server-name}} \
--name require_secure_transport
From PowerShellβ
Ensure the following command returns a value of on:
Get-AzPostgreSqlFlexibleServerConfiguration `
-ResourceGroupName {{resource-group-name}} `
-ServerName {{server-name}} `
-Name require_secure_transport
From Azure Policyβ
If referencing a digital copy of this Benchmark, clicking a Policy ID will open a link to the associated Policy definition in Azure.
- Policy ID: c29c38cb-74a7-4505-9a06-e588ab86620a - Name:
Enforce SSL connection should be enabled for PostgreSQL flexible servers
Default Valueβ
By default, secure connectivity is enforced, but some application frameworks may not enable it during deployment.
Referencesβ
- https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-networking-ssl-tls
- https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-connect-tls-ssl
- https://learn.microsoft.com/en-us/powershell/module/az.postgresql/get-azpostgresqlflexibleserverconfiguration?view=azps-12.2.0#example-1-get-specified-postgresql-configuration-by-name
- https://learn.microsoft.com/en-us/powershell/module/az.postgresql/update-azpostgresqlflexibleserverconfiguration?view=azps-12.2.0#example-1-updatae-specified-postgresql-configuration-by-name
- https://learn.microsoft.com/en-us/security/benchmark/