{
  "properties": {
    "displayName": "Azure Data Box jobs should use a customer-managed key to encrypt the device unlock password",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Use a customer-managed key to control the encryption of the device unlock password for Azure Data Box. Customer-managed keys also help manage access to the device unlock password by the Data Box service in order to prepare the device and copy data in an automated manner. The data on the device itself is already encrypted at rest with Advanced Encryption Standard 256-bit encryption, and the device unlock password is encrypted by default with a Microsoft managed key.",
    "metadata": {
      "version": "1.0.0",
      "category": "Data Box"
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "The desired effect of the policy"
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      },
      "supportedSKUs": {
        "type": "Array",
        "metadata": {
          "displayName": "Supported SKUs",
          "description": "The list of SKUs that support customer-managed key encryption key"
        },
        "allowedValues": [
          "DataBox",
          "DataBoxHeavy"
        ],
        "defaultValue": [
          "DataBox",
          "DataBoxHeavy"
        ]
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.DataBox/jobs"
          },
          {
            "field": "Microsoft.Databox/jobs/sku.name",
            "in": "[parameters('supportedSKUs')]"
          },
          {
            "field": "Microsoft.DataBox/jobs/details.keyEncryptionKey.kekType",
            "notEquals": "CustomerManaged"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/86efb160-8de7-451d-bc08-5d475b0aadae",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "86efb160-8de7-451d-bc08-5d475b0aadae"
}
