| name | cis-azure-foundations-8.3.4 |
| description | Ensure that the Expiration Date is set for all Secrets in Non-RBAC Key Vaults |
| category | cis-azure-foundations |
| version | 5.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","security","key-vault","secrets","expiration"] |
| cis_id | 8.3.4 |
| cis_benchmark | CIS Microsoft Azure Foundations Benchmark v5.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
8.3.4 Ensure that the Expiration Date is set for all Secrets in Non-RBAC Key Vaults (Automated)
Description
Ensure that all secrets stored in Azure Key Vaults using Vault Access Policy authorization (non-RBAC) have an expiration date configured.
Rationale
Secrets in non-RBAC Key Vaults follow the same security principles as those in RBAC-enabled vaults. Secrets without expiration dates remain valid indefinitely, increasing the risk that compromised credentials can be abused for extended periods. Setting expiration dates enforces regular rotation cycles and ensures that stale or potentially compromised secrets are automatically invalidated. This is essential for maintaining a strong credential hygiene posture.
Impact
Expired secrets will cause applications relying on them to fail. Organizations must establish secret rotation procedures and set up notifications (via Azure Event Grid) to alert administrators before secrets expire. Automation through Azure Automation or Azure Functions can help streamline the rotation process.
Audit Procedure
From Azure Portal:
- Go to
Key vaults.
- For each Key Vault with RBAC authorization disabled (using Access Policies), click the vault name.
- Under
Objects, click Secrets.
- For each secret, verify that the
Expiration date column shows a date (not blank or 'Not set').
From Azure CLI:
az keyvault list --query "[?properties.enableRbacAuthorization!=\`true\`].name" -o tsv
For each non-RBAC Key Vault:
az keyvault secret list --vault-name {vaultName} --query "[].{Name:name, Expires:attributes.expires}" -o table
Ensure Expires is set for all secrets.
From PowerShell:
$vaults = Get-AzKeyVault | Where-Object { $_.EnableRbacAuthorization -ne $true }
foreach ($vault in $vaults) {
Get-AzKeyVaultSecret -VaultName $vault.VaultName | Select-Object Name, Expires
}
Ensure Expires is populated for all secrets.
Expected Result
All secrets in non-RBAC Key Vaults should have an expiration date set.
Remediation
From Azure Portal:
- Go to
Key vaults.
- Click the name of a Key Vault.
- Under
Objects, click Secrets.
- Click the secret that needs an expiration date.