適用於 Linux 的 Azure 磁碟加密 (Microsoft.Azure.Security.AzureDiskEncryptionForLinux)

概觀

Azure 磁碟加密會使用 Linux 中的 dm-crypt 子系統在選取的 Azure Linux 發行版本上提供完整的磁碟加密。 此解決方案會與 Azure Key Vault 整合,以管理磁碟加密金鑰和祕密。

必要條件

如需必要條件的完整清單,請參閱適用於 Linux VM 的 Azure 磁碟加密,尤其是以下幾節:

擴充功能結構描述

Azure 磁碟加密 (ADE) 有兩個版本的擴充功能結構描述:

  • v1.1 - 較新的建議架構,不使用 Microsoft Entra 屬性。
  • v0.1 - 需要 Microsoft Entra 屬性的較舊架構。

若要選取目標結構描述,typeHandlerVersion 屬性必須設定為您想要使用的結構描述版本。

建議使用 v1.1 架構,而且不需要 Microsoft Entra 屬性。

注意

DiskFormatQuery 參數已被取代。 其功能已取代為 EncryptFormatAll 選項,這是在加密時將資料磁碟格式化的建議方式。

{
  "type": "extensions",
  "name": "[name]",
  "apiVersion": "2019-07-01",
  "location": "[location]",
  "properties": {
        "publisher": "Microsoft.Azure.Security",
        "type": "AzureDiskEncryptionForLinux",
        "typeHandlerVersion": "1.1",
        "autoUpgradeMinorVersion": true,
        "settings": {
          "DiskFormatQuery": "[diskFormatQuery]",
          "EncryptionOperation": "[encryptionOperation]",
          "KeyEncryptionAlgorithm": "[keyEncryptionAlgorithm]",
          "KeyVaultURL": "[keyVaultURL]",
          "KeyVaultResourceId": "[KeyVaultResourceId]",
          "KeyEncryptionKeyURL": "[keyEncryptionKeyURL]",
          "KekVaultResourceId": "[KekVaultResourceId",
          "SequenceVersion": "sequenceVersion]",
          "VolumeType": "[volumeType]"
        }
  }
}

架構 v0.1:使用 Microsoft Entra ID

0.1 結構描述需要 AADClientIDAADClientSecretAADClientCertificate

使用 AADClientSecret

{
  "type": "extensions",
  "name": "[name]",
  "apiVersion": "2019-07-01",
  "location": "[location]",
  "properties": {
    "protectedSettings": {
      "AADClientSecret": "[aadClientSecret]",
      "Passphrase": "[passphrase]"
    },
    "publisher": "Microsoft.Azure.Security",
    "type": "AzureDiskEncryptionForLinux",
    "typeHandlerVersion": "0.1",
    "settings": {
      "AADClientID": "[aadClientID]",
      "DiskFormatQuery": "[diskFormatQuery]",
      "EncryptionOperation": "[encryptionOperation]",
      "KeyEncryptionAlgorithm": "[keyEncryptionAlgorithm]",
      "KeyEncryptionKeyURL": "[keyEncryptionKeyURL]",
      "KeyVaultURL": "[keyVaultURL]",
      "SequenceVersion": "sequenceVersion]",
      "VolumeType": "[volumeType]"
    }
  }
}

使用 AADClientCertificate

{
  "type": "extensions",
  "name": "[name]",
  "apiVersion": "2019-07-01",
  "location": "[location]",
  "properties": {
    "protectedSettings": {
      "AADClientCertificate": "[aadClientCertificate]",
      "Passphrase": "[passphrase]"
    },
    "publisher": "Microsoft.Azure.Security",
    "type": "AzureDiskEncryptionForLinux",
    "typeHandlerVersion": "0.1",
    "settings": {
      "AADClientID": "[aadClientID]",
      "DiskFormatQuery": "[diskFormatQuery]",
      "EncryptionOperation": "[encryptionOperation]",
      "KeyEncryptionAlgorithm": "[keyEncryptionAlgorithm]",
      "KeyEncryptionKeyURL": "[keyEncryptionKeyURL]",
      "KeyVaultURL": "[keyVaultURL]",
      "SequenceVersion": "sequenceVersion]",
      "VolumeType": "[volumeType]"
    }
  }
}

屬性值

注意:所有屬性值皆區分大小寫。

名稱 值 / 範例 資料類型
apiVersion 2019-07-01 date
publisher Microsoft.Azure.Security string
type AzureDiskEncryptionForLinux string
typeHandlerVersion 1.1、0.1 int
(0.1 結構描述) AADClientID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx guid
(0.1 結構描述) AADClientSecret password string
(0.1 結構描述) AADClientCertificate thumbprint string
(選擇性) (0.1 結構描述) 複雜密碼 password string
DiskFormatQuery {"dev_path":"","name":"","file_system":""} JSON 字典
EncryptionOperation EnableEncryption、EnableEncryptionFormatAll string
(選擇性 - 預設 RSA-OAEP) KeyEncryptionAlgorithm 'RSA-OAEP'、'RSA-OAEP-256'、'RSA1_5' string
KeyVaultURL URL string
KeyVaultResourceId URL string
(選擇性) KeyEncryptionKeyURL URL string
(選擇性) KekVaultResourceId URL string
(選擇性) SequenceVersion UNIQUEIDENTIFIER string
VolumeType 作業系統、資料、全部 string

範本部署

如需以結構描述 v1.1 為基礎的範本部署範例,請參閱 Azure 快速入門範本 encrypt-running-linux-vm-without-aad

如需以結構描述 v0.1 為基礎的範本部署範例,請參閱 Azure 快速入門範本 encrypt-running-linux-vm

警告

  • 如果您先前曾使用 Azure 磁碟加密搭配 Microsoft Entra ID 來加密 VM,則必須繼續使用此選項來加密您的 VM。
  • 在加密 Linux OS 磁碟區時,請將 VM 視為無法使用。 強烈建議您在加密進行當下避免進行 SSH 登入,以免發生問題而封鎖加密過程中需要存取的任何已開啟檔案。 若要檢查進度,請使用 Get-AzVMDiskEncryptionStatus PowerShell Cmdlet 或 vm encryption show CLI 命令。 對於 30GB OS 磁碟區,此過程可能需要幾個小時,再加上額外的時間來進行加密資料磁碟區。 資料磁碟區加密時間會與資料磁碟區的大小和數量成正比;encrypt format all 選項比就地加密更快速,但會導致磁碟上的所有資料遺失。
  • 只有資料磁碟區支援在 Linux VM 上停用加密。 如果 OS 磁碟區已加密,則不支援在資料或 OS 磁碟區上停用加密。

注意

此外,如果 VolumeType 參數設定為 [全部],則資料磁碟只有在正確掛接時才會加密。

疑難排解與支援

疑難排解

如需疑難排解資訊,請參閱 Azure 磁碟加密疑難排解指南

支援

如果您在本文中有任何需要協助的地方,您可以連絡 MSDN Azure 和 Stack Overflow 論壇上的 Azure 專家。

或者,您可以提出 Azure 支援事件。 移至 Azure 支援,然後選取 [取得支援]。 如需關於使用 Azure 支援的資訊,請參閱 Microsoft Azure 支援常見問題集

下一步