次の方法で共有


(プレビュー) 既存の仮想マシン スケール セットでトラステッド起動を有効にする

適用対象: ✔️ Linux VM ✔️ Windows VM ✔️ Virtual Machine Scale Sets Uniform

Azure Virtual Machine Scale Sets は、トラステッド起動セキュリティ タイプへのアップグレードによる既存のユニフォーム スケール セット上のトラステッド起動の有効化をサポートしています。

トラステッド起動は、Azure 第 2 世代の仮想マシンとスケール セット上での基本的なコンピューティング セキュリティを実現し、それらをブート キットやルートキットなどの高度で永続的な攻撃手法から保護します。 これは、スケール セット上でセキュア ブート、vTPM、ブート整合性監視などのインフラストラクチャ テクノロジを組み合わせることによって実現されます。

制限事項

前提条件

既存のスケール セット ユニフォームでトラステッド起動を有効にする

このセクションでは、ARM テンプレートを使用して既存の仮想マシン スケール セット ユニフォームでトラステッド起動を有効にする手順について説明します。

既存の ARM テンプレート デプロイ コードに以下の変更を加えます。 完全なテンプレートについては、「クイックスタート トラステッド起動スケール セット ARM テンプレート」を参照してください。

重要

トラステッド起動セキュリティ タイプが利用できるのは、スケール セット apiVersion 2020-12-01 以上です。 アップグレード前に API バージョンが正しく設定されていることを確認します。

  1. OS イメージ: OS イメージ参照を Gen2 トラステッド起動がサポートされている OS イメージに更新します。 Azure Compute Gallery OS イメージを使用している場合は、ソースの Gen2 イメージが TrustedLaunchSupported セキュリティ タイプを持っていることを確認します。

    "storageProfile": { 
            "osDisk": { 
                "createOption": "FromImage", 
                "caching": "ReadWrite" 
            }, 
            "imageReference": { 
                "publisher": "MicrosoftWindowsServer", 
                "offer": "WindowsServer", 
                "sku": "2022-datacenter-azure-edition", 
                "version": "latest" 
            } 
    }
    
  2. (省略可能) スケール セット サイズ: 現在のサイズ ファミリがトラステッド起動セキュリティ構成でサポートされていない場合は、スケール セット サイズを変更します。

        "sku": { 
            "name": "Standard_D2s_v3", 
            "tier": "Standard", 
            "capacity": "[parameters('instanceCount')]" 
        } 
    
  3. セキュリティ プロファイル: virtualMachineProfile の下に securityProfile ブロックを追加して、トラステッド起動セキュリティ構成を有効にします。

    Note

    推奨設定: vTPM: true および secureBoot: true OS 上で何らかの署名されていないカスタム ドライバーやカーネルを使用している場合は、secureBootfalse に設定する必要があります。

    "securityProfile": { 
        "securityType": "TrustedLaunch", 
        "uefiSettings": { 
          "secureBootEnabled": true, 
          "vTpmEnabled": true
        } 
    }
    
  4. (推奨) ゲスト構成証明拡張機能: スケール セット リソースにゲスト構成証明 (GA) 拡張機能を追加します。これにより、スケール セットのブート整合性監視が可能になります。

    重要

    ゲスト構成証明拡張機能では、secureBootvTPMtrue に設定されている必要があります。

    { 
        "condition": "[and(parameters('vTPM'), parameters('secureBoot'))]", 
        "type": "Microsoft.Compute/virtualMachineScaleSets/extensions", 
        "apiVersion": "2022-03-01", 
        "name": "[format('{0}/{1}', parameters('vmssName'), GuestAttestation)]", 
        "location": "[parameters('location')]", 
        "properties": { 
          "publisher": "Microsoft.Azure.Security.WindowsAttestation", 
          "type": "GuestAttestation", 
          "typeHandlerVersion": "1.0", 
          "autoUpgradeMinorVersion": true, 
          "enableAutomaticUpgrade": true, 
          "settings": { 
            "AttestationConfig": { 
              "MaaSettings": { 
                "maaEndpoint": "[substring('emptystring', 0, 0)]", 
                "maaTenantName": "GuestAttestation" 
              } 
            } 
          } 
        }, 
        "dependsOn": [ 
          "[resourceId('Microsoft.Compute/virtualMachineScaleSets', parameters('vmssName'))]" 
        ] 
    } 
    

    拡張機能の発行元の名前:

    OS の種類 拡張機能の発行元の名前
    Windows Microsoft.Azure.Security.WindowsAttestation
    Linux Microsoft.Azure.Security.LinuxAttestation
  5. テンプレートに加えられた変更を確認します。

    展開して、既存のスケール セットのトラステッド起動とロールバック (必要な場合) へのアップグレードをサポートする完全なサンプル ARM テンプレートを表示します。
    {
      "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
        "vmSku": {
          "type": "string",
          "defaultValue": "Standard_D2s_v3",
          "metadata": {
            "description": "Size of VMs in the VM Scale Set."
          }
        },
        "sku": {
          "type": "string",
          "defaultValue": "2022-datacenter-azure-edition",
          "allowedValues": [
            "2022-datacenter-azure-edition"
          ],
          "metadata": {
            "description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version."
          }
        },
        "vmssName": {
          "type": "string",
          "maxLength": 61,
          "metadata": {
            "description": "String used as a base for naming resources. Must be 3-61 characters in length and globally unique across Azure. A hash is prepended to this string for some resources, and resource-specific information is appended."
          }
        },
        "instanceCount": {
          "type": "int",
          "defaultValue": 2,
          "maxValue": 100,
          "minValue": 1,
          "metadata": {
            "description": "Number of VM instances (100 or less)."
          }
        },
        "adminUsername": {
          "type": "string",
          "metadata": {
            "description": "Admin username on all VMs."
          }
        },
        "adminPassword": {
          "type": "securestring",
          "metadata": {
            "description": "Admin password on all VMs."
          }
        },
        "location": {
          "type": "string",
          "defaultValue": "[resourceGroup().location]",
          "metadata": {
            "description": "Location for all resources."
          }
        },
        "publicIpName": {
          "type": "string",
          "defaultValue": "myPublicIP",
          "metadata": {
            "description": "Name for the Public IP used to access the virtual machine Scale set."
          }
        },
        "publicIPAllocationMethod": {
          "type": "string",
          "defaultValue": "Static",
          "allowedValues": [
            "Dynamic",
            "Static"
          ],
          "metadata": {
            "description": "Allocation method for the Public IP used to access the virtual machine set."
          }
        },
        "publicIpSku": {
          "type": "string",
          "defaultValue": "Standard",
          "allowedValues": [
            "Basic",
            "Standard"
          ],
          "metadata": {
            "description": "SKU for the Public IP used to access the virtual machine Scale set."
          }
        },
        "dnsLabelPrefix": {
          "type": "string",
          "defaultValue": "[toLower(format('{0}-{1}', parameters('vmssName'), uniqueString(resourceGroup().id)))]",
          "metadata": {
            "description": "Unique DNS Name for the Public IP used to access the virtual machine Scale set."
          }
        },
        "healthExtensionProtocol": {
          "type": "string",
          "defaultValue": "TCP",
          "allowedValues": [
            "TCP",
            "HTTP",
            "HTTPS"
          ]
        },
        "healthExtensionPort": {
          "type": "int",
          "defaultValue": 3389
        },
        "healthExtensionRequestPath": {
          "type": "string",
          "defaultValue": "/"
        },
        "overprovision": {
          "type": "bool",
          "defaultValue": false
        },
        "upgradePolicy": {
          "type": "string",
          "defaultValue": "Manual",
          "allowedValues": [
            "Manual",
            "Rolling",
            "Automatic"
          ]
        },
        "maxBatchInstancePercent": {
          "type": "int",
          "defaultValue": 20
        },
        "maxUnhealthyInstancePercent": {
          "type": "int",
          "defaultValue": 20
        },
        "maxUnhealthyUpgradedInstancePercent": {
          "type": "int",
          "defaultValue": 20
        },
        "pauseTimeBetweenBatches": {
          "type": "string",
          "defaultValue": "PT5S"
        },
        "securityType": {
          "type": "string",
          "defaultValue": "TrustedLaunch",
          "allowedValues": [
            "Standard",
            "TrustedLaunch"
          ],
          "metadata": {
            "description": "Security Type of the Virtual Machine."
          }
        },
        "encryptionAtHost": {
            "type": "bool",
            "defaultValue": false,
            "metadata": {
                "description": "This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine Scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be disabled unless this property is set to true for the resource."
            }
        }
      },
      "variables": {
        "namingInfix": "[toLower(substring(format('{0}{1}', parameters('vmssName'), uniqueString(resourceGroup().id)), 0, 9))]",
        "addressPrefix": "10.0.0.0/16",
        "subnetPrefix": "10.0.0.0/24",
        "virtualNetworkName": "[format('{0}vnet', variables('namingInfix'))]",
        "subnetName": "[format('{0}subnet', variables('namingInfix'))]",
        "loadBalancerName": "[format('{0}lb', variables('namingInfix'))]",
        "natPoolName": "[format('{0}natpool', variables('namingInfix'))]",
        "bePoolName": "[format('{0}bepool', variables('namingInfix'))]",
        "natStartPort": 50000,
        "natEndPort": 50119,
        "natBackendPort": 3389,
        "nicName": "[format('{0}nic', variables('namingInfix'))]",
        "ipConfigName": "[format('{0}ipconfig', variables('namingInfix'))]",
        "imageReference": {
          "2022-datacenter-azure-edition": {
            "publisher": "MicrosoftWindowsServer",
            "offer": "WindowsServer",
            "sku": "[parameters('sku')]",
            "version": "latest"
          }
        },
        "extensionName": "GuestAttestation",
        "extensionPublisher": "Microsoft.Azure.Security.WindowsAttestation",
        "extensionVersion": "1.0",
        "maaTenantName": "GuestAttestation",
        "maaEndpoint": "[substring('emptyString', 0, 0)]",
        "uefiSettingsJson": {
            "secureBootEnabled": true,
            "vTpmEnabled": true
        },
        "rollingUpgradeJson": {
          "maxBatchInstancePercent": "[parameters('maxBatchInstancePercent')]",
          "maxUnhealthyInstancePercent": "[parameters('maxUnhealthyInstancePercent')]",
          "maxUnhealthyUpgradedInstancePercent": "[parameters('maxUnhealthyUpgradedInstancePercent')]",
          "pauseTimeBetweenBatches": "[parameters('pauseTimeBetweenBatches')]"
        }
      },
      "resources": [
        {
          "type": "Microsoft.Network/virtualNetworks",
          "apiVersion": "2022-05-01",
          "name": "[variables('virtualNetworkName')]",
          "location": "[parameters('location')]",
          "properties": {
            "addressSpace": {
              "addressPrefixes": [
                "[variables('addressPrefix')]"
              ]
            },
            "subnets": [
              {
                "name": "[variables('subnetName')]",
                "properties": {
                  "addressPrefix": "[variables('subnetPrefix')]"
                }
              }
            ]
          }
        },
        {
          "type": "Microsoft.Network/publicIPAddresses",
          "apiVersion": "2022-05-01",
          "name": "[parameters('publicIpName')]",
          "location": "[parameters('location')]",
          "sku": {
            "name": "[parameters('publicIpSku')]"
          },
          "properties": {
            "publicIPAllocationMethod": "[parameters('publicIPAllocationMethod')]",
            "dnsSettings": {
              "domainNameLabel": "[parameters('dnsLabelPrefix')]"
            }
          }
        },
        {
          "type": "Microsoft.Network/loadBalancers",
          "apiVersion": "2022-05-01",
          "name": "[variables('loadBalancerName')]",
          "location": "[parameters('location')]",
          "sku": {
            "name": "[parameters('publicIpSku')]",
            "tier": "Regional"
          },
          "properties": {
            "frontendIPConfigurations": [
              {
                "name": "LoadBalancerFrontEnd",
                "properties": {
                  "publicIPAddress": {
                    "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIpName'))]"
                  }
                }
              }
            ],
            "backendAddressPools": [
              {
                "name": "[variables('bePoolName')]"
              }
            ],
            "inboundNatPools": [
              {
                "name": "[variables('natPoolName')]",
                "properties": {
                  "frontendIPConfiguration": {
                    "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('loadBalancerName'), 'loadBalancerFrontEnd')]"
                  },
                  "protocol": "Tcp",
                  "frontendPortRangeStart": "[variables('natStartPort')]",
                  "frontendPortRangeEnd": "[variables('natEndPort')]",
                  "backendPort": "[variables('natBackendPort')]"
                }
              }
            ]
          },
          "dependsOn": [
            "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIpName'))]"
          ]
        },
        {
          "type": "Microsoft.Compute/virtualMachineScaleSets",
          "apiVersion": "2022-03-01",
          "name": "[parameters('vmssName')]",
          "location": "[parameters('location')]",
          "sku": {
            "name": "[parameters('vmSku')]",
            "tier": "Standard",
            "capacity": "[parameters('instanceCount')]"
          },
          "properties": {
            "virtualMachineProfile": {
              "storageProfile": {
                "osDisk": {
                  "createOption": "FromImage",
                  "caching": "ReadWrite"
                },
                "imageReference": "[variables('imageReference')[parameters('sku')]]"
              },
              "osProfile": {
                "computerNamePrefix": "[variables('namingInfix')]",
                "adminUsername": "[parameters('adminUsername')]",
                "adminPassword": "[parameters('adminPassword')]"
              },
              "securityProfile": {
                  "encryptionAtHost": "[parameters('encryptionAtHost')]",
                  "securityType": "[parameters('securityType')]",
                  "uefiSettings": "[if(equals(parameters('securityType'), 'TrustedLaunch'), variables('uefiSettingsJson'), null())]"
                  
              },
              "networkProfile": {
                "networkInterfaceConfigurations": [
                  {
                    "name": "[variables('nicName')]",
                    "properties": {
                      "primary": true,
                      "ipConfigurations": [
                        {
                          "name": "[variables('ipConfigName')]",
                          "properties": {
                            "subnet": {
                              "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetName'))]"
                            },
                            "loadBalancerBackendAddressPools": [
                              {
                                "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('loadBalancerName'), variables('bePoolName'))]"
                              }
                            ],
                            "loadBalancerInboundNatPools": [
                              {
                                "id": "[resourceId('Microsoft.Network/loadBalancers/inboundNatPools', variables('loadBalancerName'), variables('natPoolName'))]"
                              }
                            ]
                          }
                        }
                      ]
                    }
                  }
                ]
              },
              "extensionProfile": {
                "extensions": [
                  {
                    "name": "HealthExtension",
                    "properties": {
                      "publisher": "Microsoft.ManagedServices",
                      "type": "ApplicationHealthWindows",
                      "typeHandlerVersion": "1.0",
                      "autoUpgradeMinorVersion": false,
                      "settings": {
                        "protocol": "[parameters('healthExtensionProtocol')]",
                        "port": "[parameters('healthExtensionPort')]",
                        "requestPath": "[if(equals(parameters('healthExtensionProtocol'), 'TCP'), null(), parameters('healthExtensionRequestPath'))]"
                      }
                    }
                  }
                ]
              },
              "diagnosticsProfile": {
                "bootDiagnostics": {
                  "enabled": true
                }
              }
            },
            "orchestrationMode": "Uniform",
            "overprovision": "[parameters('overprovision')]",
            "upgradePolicy": {
              "mode": "[parameters('upgradePolicy')]",
              "rollingUpgradePolicy": "[if(equals(parameters('upgradePolicy'), 'Rolling'), variables('rollingUpgradeJson'), null())]",
              "automaticOSUpgradePolicy": {
                "enableAutomaticOSUpgrade": true
              }
            }
          },
          "dependsOn": [
            "[resourceId('Microsoft.Network/loadBalancers', variables('loadBalancerName'))]",
            "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
          ]
        },
        {
          "condition": "[and(equals(parameters('securityType'), 'TrustedLaunch'), and(equals(variables('uefiSettingsJson').secureBootEnabled, true()), equals(variables('uefiSettingsJson').vTpmEnabled, true())))]",
          "type": "Microsoft.Compute/virtualMachineScaleSets/extensions",
          "apiVersion": "2022-03-01",
          "name": "[format('{0}/{1}', parameters('vmssName'), variables('extensionName'))]",
          "location": "[parameters('location')]",
          "properties": {
            "publisher": "[variables('extensionPublisher')]",
            "type": "[variables('extensionName')]",
            "typeHandlerVersion": "[variables('extensionVersion')]",
            "autoUpgradeMinorVersion": true,
            "enableAutomaticUpgrade": true,
            "settings": {
              "AttestationConfig": {
                "MaaSettings": {
                  "maaEndpoint": "[variables('maaEndpoint')]",
                  "maaTenantName": "[variables('maaTenantName')]"
                }
              }
            }
          },
          "dependsOn": [
            "[resourceId('Microsoft.Compute/virtualMachineScaleSets', parameters('vmssName'))]"
          ]
        }
      ]
    }
    
  6. ARM テンプレートのデプロイを実行します。

    $resourceGroupName = "myResourceGroup"
    $parameterFile = "folderPathToFile\parameters.json"
    $templateFile = "folderPathToFile\template.json"
    
    New-AzResourceGroupDeployment `
        -ResourceGroupName $resourceGroupName `
        -TemplateFile $templateFile -TemplateParameterFile $parameterFile
    
  7. デプロイが成功したことを確認します。 Azure portal を使用して、スケール セット ユニフォームのセキュリティ タイプと UEFI 設定を確認します。 概要ページの [セキュリティの種類] セクションを確認します。

    スケール セットのトラステッド起動プロパティのスクリーンショット。

  8. スケール セット ユニフォームのアップグレード モードManual に設定されている場合は、VM インスタンスを手動で更新します。

    $resourceGroupName = "myResourceGroup"
    $vmssName = "VMScaleSet001"
    Update-AzVmssInstance -ResourceGroupName $resourceGroupName -VMScaleSetName $vmssName -InstanceId "0"
    

ロールバック

トラステッド起動から以前の正常な構成へと変更をロールバックするには、スケール セットの securityTypeStandard に設定する必要があります。

トラステッド起動から以前の正常な構成へと変更をロールバックするには、以下に示すように securityProfileStandard に設定します。 必要に応じて、他のパラメーターの変更 (OS イメージ、VM サイズ) を元に戻し、「既存のスケール セットでトラステッド起動を有効にする」で説明されている手順 5 から 8 を繰り返すこともできます

"securityProfile": {
    "securityType": "Standard",
    "uefiSettings": "[null()]"
}

次のステップ

(推奨) アップグレード後に、ブートの整合性の監視を有効にして、Microsoft Defender for Cloud を使って VM の正常性を監視できます。

トラステッド起動の詳細を学習し、よく寄せられる質問を確認します。