Missing Tls on Azure
How Missing TLS Manifests in Azure
Missing TLS in Azure environments often appears in subtle ways that developers might overlook. One common scenario involves Azure App Service configuration where developers accidentally deploy with HTTP only, bypassing the platform's built-in TLS termination. Azure's App Service automatically terminates TLS at the load balancer level, but if your application isn't configured to redirect HTTP to HTTPS, you create a window where data can be intercepted.
Another Azure-specific manifestation occurs with Azure Functions. When configuring function app settings, developers sometimes forget to enable the requireHttps property in the host.json file. This oversight allows unauthenticated HTTP requests to reach your function endpoints, potentially exposing sensitive operations or data.
Azure Storage accounts present another vector. When you create a storage account with the default settings, it may allow HTTP access to blob storage. Attackers can exploit this by intercepting data transfers or manipulating objects during transit. The risk increases when storage accounts are used for sensitive data like configuration files, backups, or user-generated content.
Service-to-service communication within Azure also creates TLS vulnerabilities. Many developers assume that internal Azure network traffic is inherently secure, but without proper TLS validation, man-in-the-middle attacks can still occur. This is particularly problematic when services communicate across different Azure regions or when using hybrid cloud setups that connect to on-premises infrastructure.
Azure API Management instances can inadvertently expose endpoints if TLS settings aren't properly configured. The gateway might accept HTTP requests even when HTTPS is enabled, creating a downgrade attack vector. Attackers can force clients to use the less secure HTTP channel, bypassing authentication and authorization mechanisms.
Azure Kubernetes Service (AKS) deployments often suffer from missing TLS in service-to-service communication. When pods communicate without proper certificate validation, attackers with cluster access can intercept and modify traffic between services. This becomes critical in microservices architectures where sensitive data flows between multiple services.
Azure Key Vault integration can also introduce TLS issues. When applications retrieve secrets over HTTP instead of HTTPS, they expose API keys, connection strings, and other credentials to interception. This is especially dangerous because Key Vault credentials often have broad permissions across your Azure subscription.
Azure Event Grid and Service Bus configurations sometimes miss TLS enforcement. When subscribers or clients connect without verifying certificates, attackers can inject malicious events or intercept message content. This becomes particularly concerning when these services handle financial transactions, personal data, or system commands.
Azure DevOps pipelines can inadvertently expose secrets if they use HTTP endpoints for package downloads or artifact retrieval. Attackers can inject malicious code into the pipeline execution by intercepting these downloads, leading to supply chain compromises.
Azure Active Directory applications configured with mixed authentication modes can create TLS bypass opportunities. If an application accepts both authenticated and unauthenticated requests, attackers can exploit the unauthenticated channel to gather information about the authentication mechanisms or attempt brute force attacks.
Azure SQL Database connections sometimes miss TLS enforcement at the application level. While Azure SQL enforces TLS at the database level, applications that don't validate server certificates are vulnerable to connection hijacking, especially when connecting from on-premises or hybrid environments.
Azure Cosmos DB clients configured without TLS validation can expose data to interception. The database enforces encryption in transit, but applications that disable certificate validation during development often forget to re-enable it in production, creating a persistent vulnerability.
Azure-Specific Detection
Detecting missing TLS in Azure requires both manual inspection and automated scanning. Start with Azure Resource Manager (ARM) templates and Bicep files. Look for properties like requireSecureTransport in storage accounts, requireHttps in function apps, and minTlsVersion in App Service configurations. These properties should be explicitly set to enforce TLS.
Azure CLI provides several commands for TLS verification. Use az webapp show to check App Service TLS settings, az storage account show for storage account configurations, and az functionapp show for function app settings. The output will reveal whether secure transport is required.
az webapp show --name myapp --resource-group mygroup --query properties.siteConfig.minTlsVersion
az storage account show --name mystorage --resource-group mygroup --query enableHttpsTrafficOnly
az functionapp show --name myfunc --resource-group mygroup --query properties.httpsOnlyAzure Policy can enforce TLS requirements across your subscription. Create policies that audit for HTTP-enabled resources and deny deployment of resources without TLS enforcement. This provides continuous monitoring and prevents new vulnerabilities from being introduced.
middleBrick's Azure-specific scanning detects missing TLS across all Azure resource types. The scanner tests API endpoints hosted on Azure services, checking whether they accept HTTP connections and whether TLS certificates are properly configured. It identifies Azure-specific misconfigurations like storage accounts allowing HTTP access or function apps missing HTTPS requirements.
Network Security Groups (NSGs) in Azure can inadvertently allow HTTP traffic. Review NSG rules to ensure they don't permit HTTP access to services that should only be available over HTTPS. Pay special attention to rules that allow traffic from Internet or specific IP ranges that might include untrusted networks.
Azure Application Gateway configurations should be examined for TLS settings. Check whether listeners are configured for HTTPS only and whether backend pools require TLS from backend servers. Missing TLS here can expose internal services to external interception.
Azure Front Door configurations need TLS verification at both the frontend and backend. Ensure that the frontend host only accepts HTTPS and that backend pools communicate with origin servers over TLS. Missing TLS at either end creates a vulnerability.
Azure Monitor and Log Analytics can help detect TLS-related issues through log analysis. Look for HTTP requests to endpoints that should only accept HTTPS, certificate validation failures, and connections from unexpected IP ranges. Set up alerts for these conditions to catch issues early.
middleBrick's continuous monitoring for Azure environments automatically scans your APIs on a configurable schedule, detecting when TLS configurations change or when new endpoints are deployed without proper TLS enforcement. This is particularly valuable in dynamic Azure environments where infrastructure changes frequently.
Azure Key Vault audit logs can reveal when applications retrieve secrets over insecure channels. Monitor these logs for any HTTP connections to Key Vault endpoints, which should only be accessible over HTTPS with proper certificate validation.
Azure Security Center provides recommendations for TLS enforcement across your resources. Review the security recommendations regularly and address any findings related to missing TLS or weak TLS versions. The security center integrates with Azure Policy to provide automated remediation options.
Azure-Specific Remediation
Remediating missing TLS in Azure environments requires a systematic approach. Start with Azure App Service configuration. Modify your application settings to force HTTPS and set the minimum TLS version:
az webapp update --name myapp --resource-group mygroup --https-only true --min-tls-version 1.2For Azure Functions, update the host.json file to require HTTPS:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.*, 4.0.0)",
"requireHttps": true
}
}Azure Storage accounts need explicit HTTPS enforcement:
az storage account update --name mystorage --resource-group mygroup --https-only trueFor Azure Kubernetes Service, implement service mesh solutions like Istio that provide automatic TLS encryption between pods. Configure Istio with mutual TLS (mTLS) to ensure all service-to-service communication is encrypted and authenticated:
apiVersion: networking.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: default
namespace: default
spec:
mtls:
mode: STRICTAzure API Management requires TLS configuration at multiple levels. Configure the gateway to only accept HTTPS requests and enforce TLS for backend communications:
az apim update --name myapim --resource-group mygroup --hostname-configurations https-only=trueFor Azure Cosmos DB, ensure your SDK configurations enforce TLS validation:
// C# example for Cosmos DB client with TLS validation
using (CosmosClient client = new CosmosClient(
accountEndpoint: "https://myaccount.documents.azure.com:443/",
accountKey: "mykey",
serializerOptions: new CosmosSerializationOptions { IgnoreNullValues = true },
clientOptions: new CosmosClientOptions
{
ConnectionMode = ConnectionMode.Gateway,
GatewayModeMaxConnectionLimit = 10,
ApplicationRegion = "East US",
ConsistencyLevel = ConsistencyLevel.Session,
MaxRetryAttemptsOnRateLimitedRequests = 9,
MaxRetryWaitTimeOnRateLimitedRequests = TimeSpan.FromSeconds(30),
RequestTimeout = TimeSpan.FromSeconds(60),
EnableTcpConnectionEndpointRediscovery = true,
// Ensure TLS validation is enabled
ConnectionProtocol = Protocol.Https,
AllowBulkExecution = false
}))Azure Key Vault integration requires TLS enforcement in your application code:
// Python example for Key Vault with TLS validation
from azure.identity import DefaultAzureCredential
from azure.keyvault.secrets import SecretClient
import ssl
# Create a context that enforces TLS validation
context = ssl.create_default_context()
context.check_hostname = True
context.verify_mode = ssl.CERT_REQUIRED
# Initialize Key Vault client with TLS validation
credential = DefaultAzureCredential()
client = SecretClient(vault_url="https://myvault.vault.azure.net", credential=credential, connection_verify=context)Azure SQL Database connections from applications must enforce TLS:
// C# ADO.NET with TLS enforcement
using (SqlConnection connection = new SqlConnection(
"Server=tcp:myazureserver.database.windows.net,1433;Initial Catalog=mydatabase;Persist Security Info=False;User ID=myuser;Password=mypassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"))
{
connection.Open();
// Your database operations here
}Azure Event Grid subscribers should use HTTPS endpoints and validate incoming HTTPS connections. Configure your webhook subscribers to only accept HTTPS requests and verify the Event Grid signature:
// Node.js example for Event Grid validation
const crypto = require('crypto');
function validateEventGridRequest(signature, body, webhookUrl) {
const decodedSignature = Buffer.from(signature, 'base64');
const expectedSignature = crypto
.createHmac('sha256', webhookUrl)
.update(body)
.digest();
return crypto.timingSafeEqual(decodedSignature, expectedSignature);
}Azure DevOps pipelines should use HTTPS for all package downloads and artifact retrieval. Configure package managers and build tools to verify SSL certificates:
# Azure DevOps YAML pipeline with secure package downloads
steps:
- script: |
npm config set strict-ssl true
npm config set cafile /etc/ssl/certs/ca-certificates.crt
npm installAzure Active Directory applications should be configured to only use secure protocols. Review the manifest file and ensure that oauth2AllowImplicitFlow is disabled and that redirect URIs use HTTPS:
// Azure AD app manifest snippet
{
"appId": "your-app-id",
"appRoles": [],
"oauth2AllowImplicitFlow": false,
"replyUrls": ["https://yourapp.com/callback"],
"requiredResourceAccess": []
}Azure Front Door configurations need TLS enforcement at both the edge and backend. Configure frontend hosts to only accept HTTPS and backend pools to require TLS from origin servers:
az network front-door frontend-endpoint create --front-door-name myfrontdoor \
--resource-group mygroup --host-name yourapp.com \
--session-affinity-enabled false --session-affinity-ttl PT0S \
--waf-policy waf-policyImplement Azure Policy initiatives that enforce TLS requirements across your entire Azure subscription. Create policies that audit for HTTP-enabled resources and deny deployment of resources without TLS enforcement. This provides continuous monitoring and prevents new vulnerabilities from being introduced.
Related CWEs: encryption
| CWE ID | Name | Severity |
|---|---|---|
| CWE-319 | Cleartext Transmission of Sensitive Information | HIGH |
| CWE-295 | Improper Certificate Validation | HIGH |
| CWE-326 | Inadequate Encryption Strength | HIGH |
| CWE-327 | Use of a Broken or Risky Cryptographic Algorithm | HIGH |
| CWE-328 | Use of Weak Hash | HIGH |
| CWE-330 | Use of Insufficiently Random Values | HIGH |
| CWE-338 | Use of Cryptographically Weak PRNG | MEDIUM |
| CWE-693 | Protection Mechanism Failure | MEDIUM |
| CWE-757 | Selection of Less-Secure Algorithm During Negotiation | HIGH |
| CWE-261 | Weak Encoding for Password | HIGH |