Other Articles

PostgreSQL Flexible Server – Enforce Minimum TLS Version

Secure Configuration Checks > Azure

This check ensures that an Azure Database for PostgreSQL flexible server requires TLS 1.2 or newer for client connections. Older versions of TLS, such as 1.0 and 1.1, have known weaknesses. If the server still accepts them, an attacker can force a weak connection and read or change the data in transit.

Check Details

  • Resource: Azure Database for PostgreSQL flexible server
  • Check: Enforce PostgreSQL minimum TLS version (MinimumTLSVersion)
  • Risk: Connections that use weak protocol versions can be decrypted or tampered with

Remediation via Azure Portal

  1. Log in to the Azure Portal. Azure Portal dashboard
  2. Navigate to Azure Database for PostgreSQL Flexible Servers and select the affected server. PostgreSQL Flexible Servers list
  3. In the left-hand menu, select Server parameters under Settings. PostgreSQL server parameters
  4. Set the value to TLSv1.3. PostgreSQL TLS version setting
  5. Click Save. If the portal asks for a restart, confirm it in a maintenance window.
  6. Repeat steps 2 to 5 for every server that allows an older version.

Remediation via Azure CLI

  1. Open Azure Cloud Shell or a local terminal with Azure CLI installed.

    Azure Cloud Shell
  2. List the PostgreSQL flexible servers whose minimum TLS version is below 1.2. The output shows the server name and the resource group:

    az postgres flexible-server list \
    --query "[].[name,resourceGroup]" --output tsv | \
    while read name rg; do
      az postgres flexible-server parameter show \
        --resource-group "$rg" --server-name "$name" \
        --name ssl_min_protocol_version \
        --query "value" --output tsv | \
      grep -qixE 'TLSv1.2|TLSv1.3' || echo "$name $rg"
    done
    

    The command covers the current subscription. To check another, run az account set --subscription <subscription-id> first.

  3. Set the minimum TLS version to 1.3:

    az postgres flexible-server parameter set \
    --resource-group <resource-group> \
    --server-name <server-name> \
    --name ssl_min_protocol_version \
    --value TLSv1.3
    
  4. Verify the setting:

    az postgres flexible-server parameter show \
    --resource-group <resource-group> \
    --server-name <server-name> \
    --name ssl_min_protocol_version \
    --query "{Name:name, Value:value}" \
    --output table
    

    The value must be TLSv1.2 or TLSv1.3.

Replace <resource-group> with the resource group of the server, for example rg-prod-data. Replace <server-name> with the name of the PostgreSQL flexible server, for example prod-postgres-server. Use TLSv1.3 instead of TLSv1.2 only if every client supports it. Repeat steps 3 and 4 for each server that step 2 lists.

Updated on 06 November, 2026