Configure cryptographic key auto-rotation in Azure Key Vault (2024)

  • Article

Overview

Automated cryptographic key rotation in Key Vault allows users to configure Key Vault to automatically generate a new key version at a specified frequency. To configure rotation you can use key rotation policy, which can be defined on each individual key.

Our recommendation is to rotate encryption keys at least every two years to meet cryptographic best practices.

For more information about how objects in Key Vault are versioned, see Key Vault objects, identifiers, and versioning.

Integration with Azure services

This feature enables end-to-end zero-touch rotation for encryption at rest for Azure services with customer-managed key (CMK) stored in Azure Key Vault. Please refer to specific Azure service documentation to see if the service covers end-to-end rotation.

For more information about data encryption in Azure, see:

  • Azure Encryption at Rest
  • Azure services data encryption support table

Pricing

There's an additional cost per scheduled key rotation. For more information, see Azure Key Vault pricing page

Permissions required

Key Vault key rotation feature requires key management permissions. You can assign a "Key Vault Crypto Officer" role to manage rotation policy and on-demand rotation.

For more information on how to use Key Vault RBAC permission model and assign Azure roles, see Use an Azure RBAC to control access to keys, certificates and secrets

Note

If you use an access policies permission model, it is required to set 'Rotate', 'Set Rotation Policy', and 'Get Rotation Policy' key permissions to manage rotation policy on keys.

Key rotation policy

The key rotation policy allows users to configure rotation and Event Grid notifications near expiry notification.

Key rotation policy settings:

  • Expiry time: key expiration interval. It's used to set expiration date on newly rotated key. It doesn't affect a current key.
  • Enabled/disabled: flag to enable or disable rotation for the key
  • Rotation types:
    • Automatically renew at a given time after creation (default)
    • Automatically renew at a given time before expiry. It requires 'Expiry Time' set on rotation policy and 'Expiration Date' set on the key.
  • Rotation time: key rotation interval, the minimum value is seven days from creation and seven days from expiration time
  • Notification time: key near expiry event interval for Event Grid notification. It requires 'Expiry Time' set on rotation policy and 'Expiration Date' set on the key.

Important

Key rotation generates a new key version of an existing key with new key material. Target services should use versionless key uri to automatically refresh to latest version of the key. Ensure that your data encryption solution stores versioned key uri with data to point to the same key material for decrypt/unwrap as was used for encrypt/wrap operations to avoid disruption to your services. All Azure services are currently following that pattern for data encryption.

Configure cryptographic key auto-rotation in Azure Key Vault (1)

Configure key rotation policy

Configure key rotation policy during key creation.

Configure cryptographic key auto-rotation in Azure Key Vault (2)

Configure rotation policy on existing keys.

Configure cryptographic key auto-rotation in Azure Key Vault (3)

Azure CLI

Save key rotation policy to a file. Key rotation policy example:

{ "lifetimeActions": [ { "trigger": { "timeAfterCreate": "P18M", "timeBeforeExpiry": null }, "action": { "type": "Rotate" } }, { "trigger": { "timeBeforeExpiry": "P30D" }, "action": { "type": "Notify" } } ], "attributes": { "expiryTime": "P2Y" }}

Set rotation policy on a key passing previously saved file using Azure CLI az keyvault key rotation-policy update command.

az keyvault key rotation-policy update --vault-name <vault-name> --name <key-name> --value </path/to/policy.json>

Azure PowerShell

Set rotation policy using Azure Powershell Set-AzKeyVaultKeyRotationPolicy cmdlet.

Set-AzKeyVaultKeyRotationPolicy -VaultName <vault-name> -KeyName <key-name> -ExpiresIn (New-TimeSpan -Days 720) -KeyRotationLifetimeAction @{Action="Rotate";TimeAfterCreate= (New-TimeSpan -Days 540)}

Rotation on demand

Key rotation can be invoked manually.

Portal

Click 'Rotate Now' to invoke rotation.

Configure cryptographic key auto-rotation in Azure Key Vault (4)

Azure CLI

Use Azure CLI az keyvault key rotate command to rotate key.

az keyvault key rotate --vault-name <vault-name> --name <key-name>

Azure PowerShell

Use Azure PowerShell Invoke-AzKeyVaultKeyRotation cmdlet.

Invoke-AzKeyVaultKeyRotation -VaultName <vault-name> -Name <key-name>

Configure key near expiry notification

Configuration of expiry notification for Event Grid key near expiry event. In case when automated rotation cannot be used, like when a key is imported from local HSM, you can configure near expiry notification as a reminder for manual rotation or as a trigger to custom automated rotation through integration with Event Grid. You can configure notification with days, months and years before expiry to trigger near expiry event.

Configure cryptographic key auto-rotation in Azure Key Vault (5)

For more information about Event Grid notifications in Key Vault, seeAzure Key Vault as Event Grid source

Configure key rotation with ARM template

Key rotation policy can also be configured using ARM templates.

Note

It requires 'Key Vault Contributor' role on Key Vault configured with Azure RBAC to deploy key through management plane.

{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "vaultName": { "type": "String", "metadata": { "description": "The name of the key vault to be created." } }, "keyName": { "type": "String", "metadata": { "description": "The name of the key to be created." } }, "rotatationTimeAfterCreate": { "defaultValue": "P18M", "type": "String", "metadata": { "description": "Time duration to trigger key rotation. i.e. P30D, P1M, P2Y" } }, "expiryTime": { "defaultValue": "P2Y", "type": "String", "metadata": { "description": "The expiry time for new key version. i.e. P90D, P2M, P3Y" } }, "notifyTime": { "defaultValue": "P30D", "type": "String", "metadata": { "description": "Near expiry Event Grid notification. i.e. P30D" } } }, "resources": [ { "type": "Microsoft.KeyVault/vaults/keys", "apiVersion": "2021-06-01-preview", "name": "[concat(parameters('vaultName'), '/', parameters('keyName'))]", "location": "[resourceGroup().location]", "properties": { "vaultName": "[parameters('vaultName')]", "kty": "RSA", "rotationPolicy": { "lifetimeActions": [ { "trigger": { "timeAfterCreate": "[parameters('rotatationTimeAfterCreate')]", "timeBeforeExpiry": "" }, "action": { "type": "Rotate" } }, { "trigger": { "timeBeforeExpiry": "[parameters('notifyTime')]" }, "action": { "type": "Notify" } } ], "attributes": { "expiryTime": "[parameters('expiryTime')]" } } } } ]}

Configure key rotation policy governance

Using the Azure Policy service, you can govern the key lifecycle and ensure that all keys are configured to rotate within a specified number of days.

Create and assign policy definition

  1. Navigate to Policy resource
  2. Select Assignments under Authoring on the left side of the Azure Policy page.
  3. Select Assign policy at the top of the page. This button opens to the Policy assignment page.
  4. Enter the following information:
  5. Fill out any additional fields. Navigate the tabs clicking on Previous and Next buttons at the bottom of the page.
  6. Select Review + create
  7. Select Create

Once the built-in policy is assigned, it can take up to 24 hours to complete the scan. After the scan is completed, you can see compliance results like below.

Resources

  • Monitoring Key Vault with Azure Event Grid
  • Use an Azure RBAC to control access to keys, certificates and secrets
  • Azure Data Encryption At Rest
  • Azure Storage Encryption
  • Azure Disk Encryption
  • Automatic key rotation for transparent data encryption
Configure cryptographic key auto-rotation in Azure Key Vault (2024)

FAQs

How often should cryptographic keys be rotated? ›

Automatic key rotation at a defined period, such as every 90 days, increases security with minimal administrative complexity. You should also manually rotate a key if you suspect that it has been compromised, or when security guidelines require you to migrate an application to a stronger key algorithm.

How often does Azure rotate encryption keys? ›

You can set a rotation policy to configure rotation for each individual key and optionally rotate keys on demand. Our recommendation is to rotate encryption keys at least every two years to meet cryptographic best practices.

What is the best practice for key rotation? ›

As a best practice, you should rotate API keys at least every 90 days. If you have a strong automated process for rotating keys, you could rotate much more often than that. We will get into automation later, though. Important events may require you to rotate keys as well.

How do I auto rotate access keys in Azure? ›

In the Azure portal, go to your storage account. Under Security + networking, select Access keys. Your account access keys appear, as well as the complete connection string for each key. Select the Set rotation reminder button.

What is automatic key rotation? ›

Automatic key rotation helps reduce risk with the following features: Limits the impact of a compromised key: The potential damage is contained to data encrypted with that specific key version. Newer data can't be decrypted because it's using a different key.

When should vault keys be rotated? ›

Periodic rotation of the encryption keys is recommended, even in the absence of compromise. Due to the nature of the AES-256-GCM encryption used, keys should be rotated before approximately 232 encryptions have been performed, following the guidelines of NIST publication 800-38D.

How to implement encryption key rotation? ›

Implementing Key Rotation
  1. Step 1: Generate a new symmetric key. As the starting point, generate a new symmetric key with a cryptographically secure random number generator using os. ...
  2. Step 2: Encrypt the new key. ...
  3. Step 3: Securely distribute the encrypted new key. ...
  4. Step 4: Decrypt the new key.
May 26, 2023

What is the risk of not rotating encryption keys? ›

Non-rotation of keys

If a key is over-used (e.g. used to encrypt too much data), then it makes the key more vulnerable to cracking, especially when using older symmetric algorithms; it also means that a high volume of data could be exposed in the event of key compromise.

Should Azure key vault keys have an expiration date? ›

keyvault/managedhsms). Cryptographic keys should have a defined expiration date and not be permanent. Keys that are valid forever provide a potential attacker with more time to compromise the key. It is a recommended security practice to set expiration dates on cryptographic keys.

How many key vaults should you use Azure? ›

Our recommendation is to use a vault per application per environment (development, preproduction, and production), per region. Granular isolation helps you not share secrets across applications, environments and regions, and it also reduce the threat if there is a breach.

What is the standard key rotation? ›

Key rotation is when a signing key is retired and replaced by generating a new cryptographic key. Rotating keys regularly is an industry standard and follows cryptographic best practices. Note: The current Okta key rotation schedule is four times a year, but can change without notice.

How often should RSA keys be rotated? ›

Rotate keys: Companies should establish a regular schedule for rotating SSH keys to limit the exposure time if a key is compromised. This can be done on a quarterly or yearly basis, depending on the organization's security requirements.

How often should access keys be rotated? ›

This policy validates that AWS IAM account access keys are rotated every 90 days. Regularly rotating access keys is considered security best practice as it reduces the amount of time a compromised key can be used to access an account.

How often should API keys be rotated? ›

The frequency of API key rotation may vary based on factors such as the level of security required, industry best practices, and organizational policies. Typically, API keys are rotated at regular intervals, such a quarterly or annually, depending on the specific requirements and risk tolerance in your company.

How to automate password rotation? ›

The best way to implement automated password rotation and protect privileged accounts is by using a PAM solution. A PAM solution includes a password manager that can automatically rotate passwords, creating strong and unique passwords for privileged accounts, and securely storing them in a digital vault.

How do I automate deployment process in Azure? ›

Configure an automated deployment

In the Azure portal, navigate to the resource group containing the AKS cluster you want to deploy the application to. Select your AKS cluster, and then select Automated deployments on the left blade. Upon selecting Create, you'll be presented with two options.

How often does KMS automate key rotation occur? ›

AWS KMS automatically rotates AWS managed keys every year (approximately 365 days).

How do I enable automatic tuning in Azure? ›

To enable automatic tuning on a server in Azure SQL Database, navigate to the server in the Azure portal and then select Automatic tuning in the menu. Select the automatic tuning options you want to enable and select Apply. Automatic tuning options on a server are applied to all databases on this server.

Top Articles
What Is a Mortgage Broker?
How To Run A Successful Affiliate Program: 10 Practical Tips From Experts
Scheelzien, volwassenen - Alrijne Ziekenhuis
Diario Las Americas Rentas Hialeah
Edina Omni Portal
Voordelige mode in topkwaliteit shoppen
Shs Games 1V1 Lol
Mama's Kitchen Waynesboro Tennessee
Dr Klabzuba Okc
Richard Sambade Obituary
Mikayla Campino Video Twitter: Unveiling the Viral Sensation and Its Impact on Social Media
Bill Devane Obituary
Danielle Longet
Mercy MyPay (Online Pay Stubs) / mercy-mypay-online-pay-stubs.pdf / PDF4PRO
Ssefth1203
The Binding of Isaac
Lenscrafters Huebner Oaks
Best Food Near Detroit Airport
Ostateillustrated Com Message Boards
Katherine Croan Ewald
Grandview Outlet Westwood Ky
Ubg98.Github.io Unblocked
Healthier Homes | Coronavirus Protocol | Stanley Steemer - Stanley Steemer | The Steem Team
Promiseb Discontinued
LCS Saturday: Both Phillies and Astros one game from World Series
Discord Nuker Bot Invite
4 Methods to Fix “Vortex Mods Cannot Be Deployed” Issue - MiniTool Partition Wizard
Pioneer Library Overdrive
Nurofen 400mg Tabletten (24 stuks) | De Online Drogist
La Qua Brothers Funeral Home
Grand Teton Pellet Stove Control Board
Fbsm Greenville Sc
NIST Special Publication (SP) 800-37 Rev. 2 (Withdrawn), Risk Management Framework for Information Systems and Organizations: A System Life Cycle Approach for Security and Privacy
How to Draw a Bubble Letter M in 5 Easy Steps
M3Gan Showtimes Near Cinemark North Hills And Xd
oklahoma city community "puppies" - craigslist
Page 5662 – Christianity Today
Kazwire
Walgreens Agrees to Pay $106.8M to Resolve Allegations It Billed the Government for Prescriptions Never Dispensed
Taylor University Baseball Roster
Ross Dress For Less Hiring Near Me
[Teen Titans] Starfire In Heat - Chapter 1 - Umbrelloid - Teen Titans
Sechrest Davis Funeral Home High Point Nc
Television Archive News Search Service
10 Types of Funeral Services, Ceremonies, and Events » US Urns Online
Amateur Lesbian Spanking
Bbwcumdreams
18443168434
Craigs List Sarasota
Tamilyogi Cc
Lagrone Funeral Chapel & Crematory Obituaries
Latest Posts
Article information

Author: Rev. Leonie Wyman

Last Updated:

Views: 6543

Rating: 4.9 / 5 (59 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Rev. Leonie Wyman

Birthday: 1993-07-01

Address: Suite 763 6272 Lang Bypass, New Xochitlport, VT 72704-3308

Phone: +22014484519944

Job: Banking Officer

Hobby: Sailing, Gaming, Basketball, Calligraphy, Mycology, Astronomy, Juggling

Introduction: My name is Rev. Leonie Wyman, I am a colorful, tasty, splendid, fair, witty, gorgeous, splendid person who loves writing and wants to share my knowledge and understanding with you.