Check ID:
Provider: Azure
Service:
Severity: MEDIUM
Categories:
Resource type:
keyvault_rbac_secret_expiration_setProvider: Azure
Service:
keyvaultSeverity: MEDIUM
Categories:
secretsResource type:
microsoft.keyvault/vaults/secretsWhat this check verifies
Each enabled secret in an Azure Key Vault (RBAC) is assessed to confirm it has anexp (expiration) date configured.
Risk
Without an expiration, secrets become perpetual credentials. Leaked or abandoned values can grant persistent access, undermining confidentiality and integrity. Attackers can reuse old secrets to maintain footholds, perform unauthorized API calls, and exfiltrate data.Recommendation
Set an expiration on all enabled secrets and enforce a regular rotation policy. Prefer short-lived, identity-based access to reduce secret usage. Apply least privilege for secret access, alert on upcoming expirations, and automate rotation and version cleanup to minimize exposure.Remediation
- CLI
- Terraform
- Native IaC
- Dashboard steps
az keyvault secret set-attributes —vault-name <vaultName> —name <secretName> —expires <YYYY-MM-DDTHH:MM:SSZ>
References
- https://learn.microsoft.com/en-us/azure/key-vault/general/basic-concepts
- https://learn.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#key-vault-secrets
Where this check fires
This check runs on every scheduled scan against your Azure account. Findings appear at Cloud Security → Findings filterable byCheck ID = keyvault_rbac_secret_expiration_set. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to Azure checks