Setting Up Azure Wildcard SSL Certificate for Secure Web Traffic

Author

Reads 371

Security Logo
Credit: pexels.com, Security Logo

To set up an Azure wildcard SSL certificate, you'll need to create a certificate signing request (CSR) in your Azure portal. The CSR is a text file that contains your domain information and public key.

Azure supports both DigiCert and GlobalSign as certificate authorities (CAs) for wildcard SSL certificates. These CAs issue SSL certificates that are trusted by most web browsers.

To create a CSR, you'll need to provide your domain name and organizational information. This information will be used to verify your identity and issue the SSL certificate.

Prerequisites

To get started with setting up an Azure wildcard SSL certificate, you'll need to meet a few prerequisites.

You'll need an Azure subscription with one or more App Service plans. This will give you the necessary infrastructure to host your certificate.

Make sure your local machine has the Windows Subsystem for Linux (WSL) installed. This will allow you to work with Linux files and commands on your Windows machine.

A public domain name is required, configured with a wildcard A record (e.g. *.example.com). This will enable you to use a single certificate for multiple subdomains.

For your interest: Windows Azure down

Configuring

Credit: youtube.com, Secure a custom DNS name with a TLS SSL binding in Azure App Service

You can upload the certificate files to your Azure Storage account.

First, navigate to your App Service app in the Azure Portal and access the TLS/SSL settings.

Click on “Custom domain SSL (upload certificate)” and select the certificate files from storage, including the private key file.

Your app will be set up to use SSL and serve content over HTTPS using the new wildcard certificate once uploaded.

Repeat this process for any other apps under the same domain.

Azure DNS supports wildcard records, which can be used for adding a wildcard domain.

You can't purge the Azure Front Door cache for a wildcard domain, so you must specify a subdomain when doing so.

To enable HTTPS traffic on your wildcard domain, you must use a wildcard certificate with the subject name matching the wildcard domain.

You can choose to use the same wildcard certificate from Azure Key Vault or from Azure Front Door managed certificates for subdomains.

If this caught your attention, see: Azure Ssl Cert

Credit: youtube.com, How to use Azure App Service managed certificates | Azure Tips and Tricks

Here are some key considerations for adding wildcard domains:

  • Azure Front Door (classic) validates that there's a CNAME record mapping for your wildcard domain.
  • Azure DNS supports wildcard records.
  • You can add as many single-level subdomains of the wildcard domain in front-end hosts as the limit allows.
  • Wildcard domains can't be used for other Azure Front Door (classic) profiles if a subdomain of the wildcard domain is already added.
  • Wildcard domains can't be added to either of the profiles if two profiles have various subdomains of a root domain.

Azure Services

Azure Front Door is a globally distributed application acceleration service provided by Microsoft.

It operates at Layer 7 (HTTP/HTTPS) and can handle SSL/TLS encryption/decryption on behalf of your application, offloading compute overhead from your backend servers.

Azure Front Door supports custom domain and certificate management, which is particularly useful when working with HTTPS.

You can generate the certificate at AFD, upload your own, or sync the one from AKV, but you still need to grant AFD permission to AKV to access the certificate.

This approach allows you to select which version of the secret to rely on, and an updated cert will be in play once issued.

Azure Front Door

Azure Front Door is a globally distributed application acceleration service provided by Microsoft. It acts as a cloud-based entry point for applications, allowing you to optimize and secure the delivery of your web applications, APIs, and content to users around the world.

Credit: youtube.com, Microsoft Azure Front Door Deep Dive

Azure Front Door operates at Layer 7 (HTTP/HTTPS) and can handle SSL/TLS encryption/decryption on behalf of your application, offloading the compute overhead from your backend servers. This means you don't have to worry about the security of your application, as Azure Front Door takes care of it.

You can configure Azure Front Door to use a custom domain and certificate, which is a great feature for securing your application. You can even generate the certificate at AFD, upload your own, or sync the one from AKV.

Here are the options for managing certificates in Azure Front Door:

  • Generate the certificate at AFD
  • Upload your own certificate
  • Synchronize the certificate from AKV

Note that if you choose to synchronize the certificate from AKV, you still need to grant AFD permission to access the certificate. This way, you can take advantage of auto-upgrading certificates, which ensures that your application is always using the latest and most secure certificate.

Waf Policies

WAF policies can be attached to wildcard domains, similar to other domains.

Credit: youtube.com, Azure Application Gateway Policies (WAF) Configuration | Geo Filters | Custom Rules

You can apply a different WAF policy to a subdomain of a wildcard domain, giving you more control over security settings.

Subdomains automatically inherit the WAF policy from the wildcard domain if there's no explicit WAF policy associated with the subdomain.

However, if a subdomain is added to a different profile from the wildcard domain profile, it can't inherit the WAF policy associated with the wildcard domain.

To use the same WAF policy for a subdomain as the wildcard domain, you must specify it explicitly.

If you don't want a WAF policy to run for a subdomain, you can create an empty WAF policy with no managed or custom rulesets.

For more insights, see: Azure Waf

Certificate Management

Certificate management is a crucial aspect of using an Azure wildcard SSL certificate. You can store your certificates at Azure Key Vault, which benefits from an auto-update of certificates.

To use a certificate from Azure Key Vault in Kubernetes, you need to grant permissions by obtaining the identityProfile.kubeletidentity.objectId of the cluster. This ID is required to provide permission to secrets.

Expand your knowledge: Managed Certificates Azure

Credit: youtube.com, Azure Key Vault Certificate Management

Azure Key Vault can automatically synchronize certificates with Secrets in Kubernetes. However, you need to install akv2k8s, a tool that takes care of Azure Key Vault secrets, certificates, and keys available in Kubernetes and/or your application.

Here are the common certificate management options in Azure:

  • Upload certificate files to Azure Storage account
  • Use Azure Key Vault for certificate storage and auto-update
  • Sync certificate from Azure Key Vault to Secret in Kubernetes
  • Grant permissions to Azure Key Vault in Kubernetes

Note that when exporting a PFX certificate from Key Vault, the server certificate appears at the end of a chain, rather than at the beginning. Specifying chainOrder: ensurer serverfirst can resolve this issue by placing the server certificate first in the chain.

Azure Key Vault

Azure Key Vault is a secure store for sensitive data like certificates. You can store your certificates here and get auto-updates, which is a huge benefit.

To use a certificate in Kubernetes, you need to grant permissions, starting by obtaining the identityProfile.kubeletidentity.objectId of your cluster. This ID is required to grant permission to secrets.

A tool called akv2k8s can help manage Azure Key Vault secrets, certificates, and keys in a simple and secure way. You can install it using Helm.

Credit: youtube.com, AZ-900 Episode 27 | Azure Key Vault | Secret, Key and Certificate Management

To synchronize the certificate from Azure Key Vault to Secret, follow the official documentation. Be aware that the server certificate might be at the end of the chain when exporting a PFX certificate from Key Vault, which can cause issues.

Here's a common order of certificates in a chain:

  1. Intermediate
  2. Root
  3. Server

Specifying chainOrder: ensurereserverfirst can resolve this issue by placing the server certificate first in the chain.

Wildcard Certificates

Wildcard certificates are a convenient option for securing multiple subdomains with a single certificate. They cover one level down, but not two or more, so *.domain.com is not equal to *.*.domain.com.

Azure provides wildcard certificates directly, but with limitations. You can purchase a wildcard certificate from Azure, but it's served by GoDaddy, and it only covers one level down, not two or more.

Wildcard certificates have some limitations, but they're a good option for securing multiple subdomains. For example, you can use a wildcard certificate to secure all subdomains of a domain, like *.example.com.

Credit: youtube.com, Wildcard SSL Certificates

To use a wildcard certificate with Azure Apps, you need to upload the certificate files to Azure Storage and configure the App Service app to use the certificate.

Here are some key differences between wildcard certificates and SAN records:

Wildcard certificates are convenient, but they have limitations. If you need to secure multiple levels of subdomains, you may need to use SAN records or a different type of certificate.

Azure Key Vault supports wildcard certificates, and you can use them to secure multiple subdomains. However, you need to grant permissions to the Key Vault to use the certificate.

Wildcard certificates are a good option for securing multiple subdomains, but they're not the only option. You can also use SAN records or a different type of certificate to secure multiple levels of subdomains.

Rosemary Boyer

Writer

Rosemary Boyer is a skilled writer with a passion for crafting engaging and informative content. With a focus on technical and educational topics, she has established herself as a reliable voice in the industry. Her writing has been featured in a variety of publications, covering subjects such as CSS Precedence, where she breaks down complex concepts into clear and concise language.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.