Check ID:
Provider: Azure
Service:
Severity: MEDIUM
Categories:
Resource type:
keyvault_non_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 (non-RBAC) is assessed to confirm it has an explicit expiration date (expires attribute) defined.
Risk
Secrets without expiration persist indefinitely, widening the window for misuse. If leaked or forgotten, they allow long-term, covert access to services and data, undermining confidentiality and integrity, and complicating incident response and revocation.Recommendation
Set an expiration on every secret and enforce a rotation policy aligned with risk and compliance. Automate rotation and alerts, disable or purge stale versions, and apply least privilege. Where possible, use managed identities to reduce secret sprawl.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_non_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