last sync: 2021-Oct-25 16:02:14 UTC

Azure Policy definition

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

Name [Preview]: Certificates should have the specified maximum validity period
Azure Portal
Id 0a075868-4c26-42ef-914c-5bc007359560
Version 2.1.0-preview
details on versioning
Category Key Vault
Microsoft docs
Description Manage your organizational compliance requirements by specifying the maximum amount of time that a certificate can be valid within your key vault.
Mode Microsoft.KeyVault.Data
Type BuiltIn
Preview True
Deprecated FALSE
Effect Default: audit
Allowed: (audit, deny, disabled)
Used RBAC Role none
History
Date/Time (UTC ymd) (i) Change type Change detail
2020-12-11 15:42:52 change Minor, suffix remains equal (2.0.0-preview > 2.1.0-preview)
2020-09-02 14:03:46 change Previous DisplayName: [Preview]: Manage certificate validity period
2019-11-19 11:26:09 change Previous DisplayName: [Preview]: Certificates should not have a lengthy validity period
Used in Initiatives
Initiative DisplayName Initiative Id Initiative Category State
[Preview]: NIST SP 800-53 Rev. 5 179d1daa-458f-4e47-8086-2a68d0d6c38f Regulatory Compliance Preview
Azure Security Benchmark 1f3afdf9-d0c9-4c3d-847f-89da613e70a8 Security Center GA
FedRAMP High d5264498-16f4-418a-b659-fa7ef418175f Regulatory Compliance GA
FedRAMP Moderate e95f5a9f-57ad-4d03-bb0b-b1d16db93693 Regulatory Compliance GA
NIST SP 800-53 Rev. 4 cf25b9c1-bd23-4eb6-bd2c-f4f3ac644a5f Regulatory Compliance GA
JSON Changes

JSON
{
  "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.1.0-preview",
    "category": "Key Vault",
    "preview": true
  },
  "parameters": {
    "maximumValidityInMonths": {
      "type": "Integer",
      "metadata": {
        "displayName": "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."
      },
      "defaultValue": 12
    },
    "effect": {
      "type": "String",
      "metadata": {
        "displayName": "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')]"
    }
  }
}