last sync: 2020-Sep-24 14:01:32 UTC

Azure Policy

[Preview]: Certificates should have the specified maximum validity period

Policy DisplayName [Preview]: Certificates should have the specified maximum validity period
Policy Id 0a075868-4c26-42ef-914c-5bc007359560
Policy Category Key Vault
Policy Description Manage your organizational compliance requirements by specifying the maximum amount of time that a certificate can be valid within your key vault.
Policy Mode Microsoft.KeyVault.Data
Policy Type BuiltIn
Policy in Preview True
Policy Deprecated FALSE
Policy Effect Default: audit
Allowed: (audit,deny,disabled)
Roles used none
Policy Changes
Date/Time (UTC ymd) (i) Change Change detail
2020-09-02 14:03:46 change: DisplayName previous DisplayName: [Preview]: Manage certificate validity period
2019-11-19 11:26:09 change: DisplayName previous DisplayName: [Preview]: Certificates should not have a lengthy validity period
Used in Policy Initiative(s)
Initiative DisplayName Initiative Id
Enable Monitoring in Azure Security Center 1f3afdf9-d0c9-4c3d-847f-89da613e70a8
Policy Rule
{
  "properties": {
  "displayName": "[Preview]: Certificates should have the specified maximum validity period",
    "policyType": "BuiltIn",
    "mode": "Microsoft.KeyVault.Data",
    "description": "Manage your organizational compliance requirements by specifying the maximum amount of time that a certificate can be valid within your key vault.",
    "metadata": {
      "version": "2.0.0-preview",
      "category": "Key Vault",
      "preview": true
    },
    "parameters": {
      "maximumValidityInMonths": {
        "type": "Integer",
        "metadata": {
        "displayName": "[Preview]: The maximum validity in months",
          "description": "The limit to how long a certificate may be valid for. Certificates with lengthy validity periods aren't best practice."
        }
      },
      "effect": {
        "type": "String",
        "metadata": {
        "displayName": "[Preview]: Effect",
          "description": "'Audit' allows a non-compliant resource to be created, but flags it as non-compliant. 'Deny' blocks the resource creation. 'Disable' turns off the policy."
        },
        "allowedValues": [
          "audit",
          "deny",
          "disabled"
        ],
        "defaultValue": "audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.KeyVault.Data/vaults/certificates"
          },
          {
            "field": "Microsoft.KeyVault.Data/vaults/certificates/properties.validityInMonths",
          "greater": "[parameters('maximumValidityInMonths')]"
          }
        ]
      },
      "then": {
      "effect": "[parameters('effect')]"
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/0a075868-4c26-42ef-914c-5bc007359560",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "0a075868-4c26-42ef-914c-5bc007359560"
}