Bylaw

Gallery › Key Vault › Azure built-in policies

Keys should be backed by a hardware security module (HSM)

Doesn't convert yet Policy Audit Deny Disabled Mode Microsoft.KeyVault.Data Version 1.0.1

An HSM is a hardware security module that stores keys. An HSM provides a physical layer of protection for cryptographic keys. The cryptographic key cannot leave a physical HSM which provides a greater level of security than a software key.

ConvertTo-Bylaw can't convert this policy yet:

Azure Policy JSONKeys_HSMBacked.json · 53 lines
{
  "properties": {
    "displayName": "Keys should be backed by a hardware security module (HSM)",
    "policyType": "BuiltIn",
    "mode": "Microsoft.KeyVault.Data",
    "description": "An HSM is a hardware security module that stores keys. An HSM provides a physical layer of protection for cryptographic keys. The cryptographic key cannot leave a physical HSM which provides a greater level of security than a software key.",
    "metadata": {
      "version": "1.0.1",
      "category": "Key Vault"
    },
    "version": "1.0.1",
    "parameters": {
      "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",
            "notIn": [
              "RSA-HSM",
              "EC-HSM"
            ]
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.1"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/587c79fe-dd04-4a5e-9d0b-f89598c7261b",
  "name": "587c79fe-dd04-4a5e-9d0b-f89598c7261b"
}

Source: built-in-policies/policyDefinitions/Key Vault/Keys_HSMBacked.json in Azure/azure-policy, under the MIT licence.