How-To: Automate Azure Key Vault Certificate Rotation with EZCA

This guide will walk you through the steps required to give EZCA access to your Azure Key Vault(s) to enable automated certificate rotation without manual intervention.

EZCA can automate the process of rotating certificates stored in Azure Key Vault. This ensures that your applications always have access to valid certificates without manual intervention. In order to enable this feature, you need to grant EZCA access to your Azure Key Vault(s) via Azure RBAC and/or Key Vault Access Policies.

Required Access for Automated Certificate Rotation

Azure Key Vault automatic certificate rotation requires EZCA to have access to your Key Vaults via two sets of permissions:

  1. Permission to read authorized users
    • EZCA requires an RBAC Reader role to verify the user requesting the certificate has access to the Key Vault.
  2. Permission to manage certificates
    • EZCA also requires either an Access Policy with Get, Update, and Create, or an RBAC Key Vault Certificates Officer role to manage the certificates in the Key Vault.

This guide will walk you through the steps required to give EZCA access to your Azure Key Vaults to enable automated certificate rotation.

Prerequisites

Add RBAC Reader Role to Key Vault

The first step is to give EZCA the Reader role on the Key Vault. This will allow EZCA to read the list of authorized users for the Key Vault to verify that the user requesting the certificate has access to the Key Vault.

  1. Login to https://portal.azure.com

  2. Navigate to the Key Vault you want EZCA to manage.

  3. Click on the Access control (IAM) menu option

    Azure Key Vault overview page with Access control IAM menu item in left navigation

  4. Click on + Add

    Azure Key Vault Access control IAM page with Add button highlighted to add role assignment

  5. Select the Add Role Assignment Option

  6. Select the Reader role

    Azure Add Role Assignment page showing Reader role selected in the role list

  7. Click on Members

    Azure Add Role Assignment Members tab with Select members highlighted for user principal search

  8. Click on + Select members

    Azure Add Role Assignment Members tab showing Select members panel with no members selected

  9. Search for “keytos” and select the Keytos application

    Azure Select members panel showing Keytos application highlighted in search results

  10. Click the Select button

    Azure Add Role Assignment Members tab with Keytos application selected and Select button highlighted

  11. Click the Review + assign button

    Azure Add Role Assignment review showing Reader role assigned to Keytos application with Review and assign button

  12. Click the Review + assign button

    Azure Add Role Assignment final review confirmation showing Reader role scope and Keytos member

Add Certificate Management Access to Key Vault

There are two ways to give EZCA access to manage certificates in your Key Vault. You can either use Key Vault Access Policies or Azure RBAC, depending on your Key Vault configuration. If you have previously disabled Access Policies on your Key Vault, you must use Azure RBAC to grant access.

Option 1: Azure RBAC

If your Key Vault has RBAC enabled, you will need to add the “Key Vault Certificates Officer” Key Vault RBAC permission to allow EZCA to manage the certificates in the Key Vault.

  1. Login to https://portal.azure.com

  2. Navigate to the Key Vault you want EZCA to manage.

  3. Click on the Access control (IAM) menu option

    Azure Key Vault overview page with Access control IAM menu item in left navigation

  4. Click on + Add

    Azure Key Vault Access control IAM page with Add button highlighted to add role assignment

  5. Select the Key Vault Certificates Officer Role

    Give azure key vault certificates officer permission

  6. Click on Members

    Azure Add Role Assignment Members tab with Select members highlighted for user principal search

  7. Click on Select Members

    Azure Add Role Assignment Members tab showing Select members panel with no members selected

  8. Search for “keytos” and select the Keytos application

    Azure Select members panel showing Keytos application highlighted in search results

  9. Click the Select button

    Azure Add Role Assignment Members tab with Keytos application selected and Select button highlighted

  10. Click the Review + assign button

    Azure Add role assignment Members tab showing Keytos app with Key Vault Certificates Officer role assigned

  11. Click the Review + assign button

    Azure Add role assignment Review page showing Keytos app Key Vault Certificates Officer assignment with Review and assign button

Option 2: Key Vault Access Policies

To get the most granular control over the permissions that EZCA has to your Key Vault, you can add an access policy to the Key Vault. This will allow you to specify the exact permissions that EZCA has to the Key Vault.

  1. Login to https://portal.azure.com

  2. Navigate to the Key Vault you want EZCA to manage.

  3. Click on the Access policies menu option

    Azure Key Vault Access policies page with Add Access Policy button highlighted

  4. Click on + Add Access Policy

    Azure Key Vault Access policies page showing current access policies list with Add Access Policy button

  5. Under Certificate permissions select: Get, Update, and Create.

    Azure Add Access Policy page showing Get, Update, and Create certificate permissions selected

  6. Click on the None selected link to the right of Select Principal

    Azure Add Access Policy page with None selected highlighted next to Select Principal field

  7. Click on the None selected link to the right of Select Principal

    Azure Add Access Policy page with None selected highlighted next to Select Principal field

  8. Search for “keytos” and select the Keytos application

    Azure Key Vault Principal search panel showing Keytos application highlighted in search results

  9. Click the Select button

    Azure Add Access Policy with Keytos application selected as principal and Select button highlighted

  10. Click the Add button

    Azure Add Access Policy completed form with Add button to save the policy

  11. Click the Save button

    Azure Key Vault Access policies page with Save button highlighted to apply new EZCA access policy

  12. Your Azure Key Vault is ready to be managed by EZCA!

How to Lock Down Access to Key Vault for Certificate Rotation

Add the EZCA IP addresses to Azure Key Vault Firewall

If your Key Vault has a firewall enabled, you will need to add the EZCA IP address to the Key Vault firewall to allow EZCA to manage the certificates in the Key Vault.

Retrieve the EZCA IP Addresses

To find the EZCA IP addresses, please go to the EZCA portal status of your instance for example: https://portal.ezca.io/status and copy the IP addresses from the Outbound IP Addresses section.

Get EZCA Outbound IP addresses

Add the EZCA IP Addresses to the Key Vault Firewall

You can now add the IP addresses to the Key Vault firewall. Since the EZCA IP addresses are subject to change, we recommend adding the entire IP range to the Key Vault firewall. To do this, you can use the following PowerShell script to add the IP range to the Key Vault firewall. Replace the $ipRange variable with the IP range from the EZCA portal status page:

Connect-AzAccount
$ipRange = ""
$resourceGroupName = "" # Replace with your resource group name
$keyVaultName = "" # Replace with your Key Vault name
$ipArr = $ipRange.Split(",")
Add-AzKeyVaultNetworkRule -VaultName $keyVaultName -ResourceGroupName $resourceGroupName -IpAddressRange $ipArr 

Does EZCA Support Key Vaults Without Public Access?

EZCA supports Key Vaults without public access enabled only in our self-hosted tier due to restrictions on Private Link Endpoints. If you are interested in using EZCA with Key Vault Private Link, please contact our sales team at sales@keytos.io to discuss your use case and options.

If you wish to lock down access to your Key Vault from only trusted IP addresses, you can add the EZCA IP addresses to the Key Vault firewall as described in the section above.

How-To: Troubleshoot Azure Key Vault Certificate Issues

Learn how to troubleshoot common problems when issuing and managing certificates in Azure Key Vault, such as pending CSRs or merging certificates.