【问题标题】:Azure ML MSI deployment over ARM Templates enables purge protection on Key Vault通过 ARM 模板部署 Azure ML MSI 可在 Key Vault 上启用清除保护
【发布时间】:2021-10-04 01:56:40
【问题描述】:

我最近发现,当您从ARM Template 部署Azure ML 实例时,MSI 将覆盖Key Vault 的清除保护设置。它将在Key Vault 上启用清除保护。这不是我要寻找的行为,因为当尝试再次部署它时,模板将失败,指出同名的 Key Vault 已经存在,并且您无法在保留期之前删除。

如果您手动部署 Azure ML 实例并选择 Key Vault,它将保留禁用清除设置。有什么想法可以让我们保持禁用清除功能吗?

我们使用的 Azure ML 属性如下所述:

  {
    "type": "Microsoft.MachineLearningServices/workspaces",
    "apiVersion": "2020-09-01-preview",
    "name": "[variables('machineLearningWorkspaceName')]",
    "location": "[parameters('location')]",
    "identity": {
      "type": "[parameters('amlManagedIdentityOption')]"
    },
    "dependsOn": [
      "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
      "[resourceId('Microsoft.Insights/components', variables('applicationInsightsName'))]",
      "[resourceId('Microsoft.ContainerRegistry/registries', variables('containerRegistryName'))]"
    ],
    "tags": "[parameters('resourceTags')]",
    "properties": {
      "friendlyName": "[variables('machineLearningWorkspaceName')]",
      "storageAccount": "[variables('storageAccount')]",
      "keyVault": "[variables('keyVault')]",
      "applicationInsights": "[variables('applicationInsights')]",
      "containerRegistry": "[ variables('containerRegistry')]",
      "adbWorkspace": "[variables('adbWorkSpace')]",
      "hbiWorkspace": "[parameters('confidential_data')]",
      "allowPublicAccessWhenBehindVnet": "[parameters('allowPublicAccessWhenBehindVnet')]"
    }
  }

在 Key Vault ARM 上,我们具有以下属性:

         "properties": {
                 "enabledForDeployment": "[parameters('enabledForDeployment')]",
                 "enabledForTemplateDeployment": "[parameters('enabledForTemplateDeployment')]",
                 "enabledForVolumeEncryption": "[parameters('enableVaultForVolumeEncryption')]",
                 "softDeleteRetentionInDays": 7,
                 "tenantId": "[subscription().tenantId]",
                 "copy": [
                     {
                         "name": "accessPolicies",
                         "count": "[length(parameters('userObjectId'))]",
                         "input": {
                             "tenantId": "[subscription().tenantId]",
                             "objectId": "[parameters('userObjectId')[copyIndex('accessPolicies')].Id]",
                             "permissions": "[parameters('userObjectId')[copyIndex('accessPolicies')].Permissions]"
                         }
 }

【问题讨论】:

  • 是否可以在 Azure 门户中查找或与部署模板进行比较?当我尝试使用新的密钥库清除设置从 Azure 门户进行部署时,默认情况下已启用。您是否使用过关闭清除设置的现有密钥库?如果您也从门户创建新的密钥库,您是否也看到类似的行为?
  • 感谢您与我们联系。在门户中,如果选择禁用了清除保护的现有 Key Vault,它将在完成 Azure ML 部署后保持禁用状态。
  • 在密钥库臂上,您应该可以设置enablePurgeProtection: false

标签: azure azure-devops azure-resource-manager azure-machine-learning-studio infrastructure-as-code


【解决方案1】:

场景 1: 使用 Azure 门户 创建了一个 Machine Learning,并将 KeyVault 配置为依赖资源,其中清除生产默认设置为启用

场景 2: 创建了一个 Test keyVault 服务作为独立资源,可以看到 purge production 设置为 disabled 并且可以看到 enable 相同的选项

场景 3: 在部署机器语言 keyVault(禁用清除生产)后,通过portal再次创建Test keyVault(禁用清除生产)Machine language purge production 自动启用

找到一篇公开文章here 问题基本上是在将Key Vault 附加到Azure 机器学习工作区时,会自动激活Key Vault 上的清除保护

【讨论】:

    【解决方案2】:

    在通过 Azure 中的手动/模板部署 ML 时,默认情况下在 Key Vault 中 enables 软删除和清除保护。它保护密钥免受意外或恶意删除。我们不会把它改成Disable,因为这是设计行为。Refer machine learning security baseline

    一旦 Purge Productionenabled,就不能被包括 Microsoft 在内的任何人禁用或覆盖。 Refer

    您需要作为功能请求进行投票或提交反馈here

    【讨论】:

    • 不完全正确,如果您首先部署 KV 和 Azure ML 并选择 KV,则默认情况下不会启用清除。此外,我们不将其更改为 Disable 的论点,因为它是设计行为不是很强制。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-07
    • 2018-09-11
    • 2020-01-06
    • 2020-09-28
    • 1970-01-01
    • 2017-07-01
    相关资源
    最近更新 更多