A key in Azure Key Vault has no expiration time set



Azure Key Vault enables users to store and use cryptographic keys within the Microsoft Azure environment. The exp (expiration time) attribute identifies the expiration time on or after which the key must not be used for a cryptographic operation. By default, keys never expire. Datadog recommends that keys be rotated in the key vault and set an explicit expiration time for all keys. This ensures that the keys cannot be used beyond their assigned lifetimes.


From the console

  1. Go to Key vaults
  2. For each Key vault, click on Keys
  3. Under the Settings section, Make sure Enabled? is set to Yes
  4. Set an appropriate expiration date on all keys. Using the Azure Command Line Interface, update the expiration date for the key using below command:
az keyvault key set-attributes --name <keyName> --vault-name <vaultName> --expires Y-m-d''T''H:M:S''Z''

Note: To access expiration time on all keys in Azure Key Vault using Microsoft API requires “List” Key permission. To provide required access follow below steps:

  1. Go to Key Vaults
  2. For each Key Vault, click on Access Policy
  3. Add access policy with Key permission as List