Azure / azure-policy

Repository for Azure Resource Policy built-in definitions and samples
MIT License
1.49k stars 1.08k forks source link

Sample Custom policy to deny any secret creation without expiration date which is 180 days more/less than creation date #1365

Open khushbu985 opened 1 month ago

khushbu985 commented 1 month ago

The existing policy in keyvault enforces that expiration dates are set. But it does not limit the date to today+180days.

Therefore various secrets+keys+certificates today have lifetimes with one or more years, which is not compliant.

We need to enforce the date for each secrets+keys to be maximum “today”+180days.