Not able to enforce azure policy for for keyvault

nimishmehta8779 1 Reputation point
2020-09-12T09:40:26.45+00:00

I am trying to implement azure custom policy for key vault where I want to enforce user to enable nbf and exp, without that it shouldn't be allowed. It directly comes as compliance without showing any resource validation. There is also no reference of activity logs and event in azure policy and Keyvault.

"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.KeyVault/vaults"
},
{
"anyOf": [
{
"field": "Microsoft.KeyVault/vaults/secrets/attributes.enabled",
"notEquals": "true"
},

        {
          "field": "Microsoft.KeyVault/vaults/secrets/attributes.nbf",
          "equals": "null"
        },

        {
          "field": "Microsoft.KeyVault/vaults/secrets/attributes.exp",
          "equals": "null"
        },

     ]

    }
  ]
},
"then": {
  "effect": "Deny"
}
Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
799 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Kenieva-MSFT 161 Reputation points Microsoft Employee
    2020-09-17T16:55:50.263+00:00

    Key Vault keys and secrets are current not available for enforcement. Built-in policies will be available in the next month or so. Custom policies don't have an ETA at the moment.

    1 person found this answer helpful.
    0 comments No comments