{
  "properties": {
    "displayName": "Keys using RSA cryptography should have a specified minimum key size",
    "policyType": "BuiltIn",
    "mode": "Microsoft.KeyVault.Data",
    "description": "Set the minimum allowed key size for use with your key vaults. Use of RSA keys with small key sizes is not a secure practice and doesn't meet many industry certification requirements.",
    "metadata": {
      "version": "1.0.0-preview",
      "category": "Key Vault",
      "preview": true
    },
    "parameters": {
      "minimumRSAKeySize": {
        "type": "Integer",
        "metadata": {
          "displayName": "Minimum RSA key size",
          "description": "The minimum key size for RSA keys."
        },
        "allowedValues": [
          2048,
          3072,
          4096
        ]
      },
      "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/keys"
          },
          {
            "field": "Microsoft.KeyVault.Data/vaults/keys/keyType",
            "in": [
              "RSA",
              "RSA-HSM"
            ]
          },
          {
            "field": "Microsoft.KeyVault.Data/vaults/keys/keySize",
            "less": "[parameters('minimumRSAKeySize')]"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/82067dbb-e53b-4e06-b631-546d197452d9",
  "name": "82067dbb-e53b-4e06-b631-546d197452d9"
}