Other Articles

Cosmos DB – Enforce Minimum TLS Version

Secure Configuration Checks > Azure

This check ensures that an Azure Cosmos DB account 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 account still accepts them, an attacker can force a weak connection and read or change the data in transit.

Check Details

  • Resource: Azure Cosmos DB account
  • Check: Enforce Cosmos DB minimum TLS version (MinimumTLSVersion)
  • Risk: Connections that use weak protocol versions can be decrypted or tampered with

Remediation via Azure Portal

  1. Sign in to the Azure portal and open Azure Cosmos DB.

  2. Select the affected Cosmos DB account. Azure Cosmos DB accounts
  3. In the left menu, under Settings, click Networking.Find the Minimum TLS version setting.

    Networking setting of a Cosmos DB account
  4. Set Minimum TLS version to TLS 1.2. Minimum TLS version setting of a Cosmos DB account
  5. Click Save. Wait until the update completes.
  6. Repeat steps 2 to 5 for every Cosmos DB account that allows an older version.

Remediation via Azure CLI

  1. Sign in to the Azure portal and click the Cloud Shell icon (>_) in the top bar. Choose Bash.

    Azure Cloud Shell
  2. List the Cosmos DB accounts that do not require TLS 1.2. The output shows the account name, the resource group and the current minimum TLS version:

    az cosmosdb list \
    --query "[?minimalTlsVersion!='Tls12'].{Name:name, ResourceGroup:resourceGroup, MinimumTls:minimalTlsVersion}" \
    --output table
    

    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.2:

    az resource update \
    --resource-group <resource-group> \
    --name <account-name> \
    --resource-type "Microsoft.DocumentDB/databaseAccounts" \
    --api-version 2024-05-15 \
    --set properties.minimalTlsVersion=Tls12
    
  4. Verify the setting:

    az cosmosdb show \
    --resource-group <resource-group> \
    --name <account-name> \
    --query "{Name:name, MinimumTls:minimalTlsVersion}" \
    --output table
    

    The minimum TLS version must be Tls12.

Replace <resource-group> with the resource group of the account, for example rg-prod-data. Replace <account-name> with the name of the Cosmos DB account, for example prod-cosmos-account. Repeat steps 3 and 4 for each account that step 2 lists.

Updated on 05 November, 2026