Azure Redis allows unencrypted connections

Disable the non-TLS port and configure applications to use TLS connections.

Description

Enabling the non-TLS port on Azure Cache for Redis allows plaintext connections alongside TLS connections.

Potential impact

Cache data, session tokens and credentials sent to that port can be exposed in transit.

Remediation

Move apps and administrative tools to the TLS port with server certificate and hostname verification enabled. Test an authenticated connection, turn off the non-TLS port, then check that plaintext connections fail. Keep the cache’s authentication and network restrictions in place.

Examples

Both examples retain a TLS 1.2 minimum on the same Standard cache. Supply the referenced resource group. Use enable_non_ssl_port = false in AzureRM 3.117.1 or non_ssl_port_enabled = false in 5.6.0.

Before

hcl
resource "azurerm_redis_cache" "example" {
  name                = "example-cache"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  capacity            = 2
  family              = "C"
  sku_name            = "Standard"
  enable_non_ssl_port = true
  minimum_tls_version = "1.2"

  redis_configuration {
  }
}

After

hcl
resource "azurerm_redis_cache" "example" {
  name                = "example-cache"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  capacity            = 2
  family              = "C"
  sku_name            = "Standard"
  enable_non_ssl_port = false
  minimum_tls_version = "1.2"

  redis_configuration {
  }
}

References