Share via


Azure Portal을 사용하여 Kerberos 인증을 위한 Bastion 구성

이 문서에서는 Kerberos 인증을 사용하도록 Azure Bastion을 구성하는 방법을 보여 줍니다. Kerberos 인증은 기본 및 표준 Bastion SKU 모두에서 사용할 수 있습니다. Kerberos 인증에 대한 자세한 내용은 Kerberos 인증 개요를 참조하세요. Azure Bastion에 대한 자세한 내용은 Azure Bastion이란?을 참조하세요.

고려 사항

  • Azure Bastion에 대한 Kerberos 설정은 네이티브 클라이언트가 아닌 Azure Portal에서만 구성할 수 있습니다.
  • 온-프레미스에서 Azure로 마이그레이션된 VM은 현재 Kerberos를 지원하지 않습니다. 
  • 현재 Kerberos에서는 영역 간 인증이 지원되지 않습니다.
  • 도메인 컨트롤러는 베스천이 배포된 동일한 VNet 내의 Azure에서 호스트된 VM이어야 합니다.
  • 현재 Kerberos에서는 DNS 서버 변경이 지원되지 않습니다. DNS 서버를 변경한 후에는 Bastion 리소스를 삭제하고 다시 만들어야 합니다.
  • 추가 DC(도메인 컨트롤러)가 추가되면 Bastion은 첫 번째 DC만 인식합니다.
  • 다른 도메인에 대해 추가 DC가 추가되면 추가된 도메인은 Kerberos를 사용하여 성공적으로 인증할 수 없습니다.

필수 조건

VNet DNS 서버 업데이트

이 섹션에서는 다음 단계를 통해 가상 네트워크를 업데이트하여 사용자 지정 DNS 설정을 지정할 수 있습니다.

  1. Azure Portal에 로그인합니다.
  2. Bastion 리소스를 배포하려는 가상 네트워크로 이동합니다.
  3. VNet의 DNS 서버 페이지로 이동하여 사용자 지정을 선택합니다. Azure 호스팅 도메인 컨트롤러의 IP 주소를 추가하고 저장합니다.

Bastion 배포

  1. 자습서: 수동 구성 설정을 사용하여 Bastion 배포의 단계를 사용하여 베스천 배포 구성을 시작합니다. 기본 탭에서 설정을 구성합니다. 그런 다음 페이지 상단에서 고급을 클릭하여 고급 탭으로 이동합니다.

  2. 고급 탭에서 Kerberos를 선택합니다.

    Screenshot of select bastion features.

  3. 페이지 아래쪽에서 검토 + 만들기를 선택한 다음 만들기를 선택하여 가상 네트워크에 Bastion을 배포합니다.

  4. 배포가 완료되면 이를 사용하여 이전 단계에서 지정한 사용자 지정 DNS에 조인된 연결할 수 있는 모든 Windows VM에 로그인할 수 있습니다.

기존 Bastion 배포를 수정하려는 경우

이 섹션에서는 다음 단계를 통해 Kerberos 인증을 위해 가상 네트워크 및 기존 Bastion 배포를 수정할 수 있습니다.

  1. 가상 네트워크에 대한 DNS 서버 설정을 업데이트합니다.
  2. Bastion 배포에 대한 포털 페이지로 이동하여 구성을 선택합니다.
  3. 구성 페이지에서 Kerberos 인증을 선택한 다음, 적용을 선택합니다.
  4. Bastion이 새로운 구성 설정으로 업데이트됩니다.

Bastion이 Kerberos를 사용하고 있는지 확인하려면

참고 항목

Kerberos를 사용하여 로그인하려면 UPN(사용자 계정 이름)을 사용해야 합니다.

Bastion 리소스에서 Kerberos를 사용하도록 설정하면 대상 도메인에 가입된 VM에 대한 인증을 위해 실제로 Kerberos를 사용하는지 확인할 수 있습니다.

  1. 대상 VM에 로그인합니다(Bastion을 통해 또는 그렇지 않음). 작업 표시줄에서 "그룹 정책 편집"을 검색하고 로컬 그룹 정책 편집기를 엽니다.

  2. 컴퓨터 구성 > Windows 설정 > 보안 설정 > 로컬 정책 > 보안 옵션을 선택합니다.

  3. 정책 네트워킹 보안: NTLM 제한: 들어오는 NTLM 트래픽 을 찾아서 모든 도메인 계정을 거부하도록 설정합니다. Bastion은 Kerberos를 사용하지 않도록 설정할 때 인증에 NTLM을 사용하므로 이 설정을 사용하면 향후 VM에서 로그인을 시도할 때 NTLM 기반 인증이 실패합니다.

  4. VM 세션을 종료합니다.

  5. Bastion을 사용하여 대상 VM에 다시 연결합니다. 로그인이 성공해야 하며, Bastion이 인증에 NTLM이 아닌 Kerberos를 사용했음을 나타냅니다.

    참고 항목

    NTLM으로의 장애 복구를 방지하려면 이전 단계를 따릅니다. 절차를 따르지 않고 Kerberos를 사용하도록 설정해도 NTLM으로의 장애 복구가 방지되지 않습니다.

빠른 시작: Kerberos를 사용하여 Bastion 설정 - Resource Manager 템플릿

템플릿 검토

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "location": {
      "defaultValue": "[resourceGroup().location]",
      "type": "string"
    },
    "defaultNsgName": {
      "type": "string",
      "defaultValue": "Default-nsg"
    },
    "VnetName": {
      "type": "string",
      "defaultValue": "myVnet"
    },
    "ClientVMName": {
      "defaultValue": "Client-vm",
      "type": "string"
    },
    "ServerVMName": {
      "defaultValue": "Server-vm",
      "type": "string"
    },
    "vmsize": {
      "defaultValue": "Standard_DS1_v2",
      "type": "string",
      "metadata": {
        "description": "VM SKU to deploy"
      }
    },
    "ServerVMUsername": {
      "type": "string",
      "defaultValue": "serveruser",
      "metadata": {
        "description": "Admin username on all VMs."
      }
    },
    "ServerVMPassword": {
      "type": "securestring",
      "metadata": {
        "description": "Admin password on all VMs."
      }
    },
    "SafeModeAdministratorPassword": {
      "type": "securestring",
      "metadata": {
        "description": "See https://learn.microsoft.com/en-us/powershell/module/addsdeployment/install-addsdomaincontroller?view=windowsserver2022-ps#-safemodeadministratorpassword"
      }
    },
    "ClientVMUsername": {
      "type": "string",
      "defaultValue": "clientuser",
      "metadata": {
        "description": "username on ClientVM."
      }
    },
    "ClientVMPassword": {
      "type": "securestring",
      "metadata": {
        "description": "password on ClientVM."
      }
    },
    "ServerVmImage": {
      "type": "object",
      "defaultValue": {
        "offer": "WindowsServer",
        "publisher": "MicrosoftWindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      }
    },
    "ClientVmImage": {
      "type": "object",
      "defaultValue": {
        "offer": "Windows",
        "publisher": "microsoftvisualstudio",
        "sku": "Windows-10-N-x64",
        "version": "latest"
      }
    },
    "publicIPAllocationMethod": {
      "type": "string",
      "defaultValue": "Static"
    },
    "BastionName": {
      "defaultValue": "Bastion",
      "type": "string"
    },
    "BastionPublicIPName": {
        "defaultValue": "Bastion-ip",
        "type": "string"
    }
  },
  "variables": {
    "DefaultSubnetId": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('VnetName')), '/subnets/default')]",
    "ClientVMSubnetId": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('VnetName')), '/subnets/clientvm-subnet')]",
    "DNSServerIpAddress": "10.16.0.4",
    "ClientVMPrivateIpAddress": "10.16.1.4"
  },
  "resources": [
    {
      "apiVersion": "2020-03-01",
      "name": "[parameters('VnetName')]",
      "type": "Microsoft.Network/virtualNetworks",
      "location": "[parameters('location')]",
      "properties": {
        "dhcpOptions": {
          "dnsServers": [ "[variables('DNSServerIpAddress')]" ]
        },
        "subnets": [
          {
            "name": "default",
            "properties": {
              "addressPrefix": "10.16.0.0/24"
            }
          },
          {
            "name": "clientvm-subnet",
            "properties": {
              "addressPrefix": "10.16.1.0/24"
            }
          },
          {
            "name": "AzureBastionSubnet",
            "properties": {
              "addressPrefix": "10.16.2.0/24"
            }
          }
        ],
        "addressSpace": {
          "addressPrefixes": [
            "10.16.0.0/16"
          ]
        }
      }
    },
    {
      "type": "Microsoft.Network/networkInterfaces",
      "apiVersion": "2018-10-01",
      "name": "[concat(parameters('ServerVMName'), 'Nic')]",
      "location": "[parameters('location')]",
      "dependsOn": [
        "[concat('Microsoft.Network/virtualNetworks/', parameters('VnetName'))]"
      ],
      "properties": {
        "ipConfigurations": [
          {
            "name": "[concat(parameters('ServerVMName'), 'NicIpConfig')]",
            "properties": {
              "privateIPAllocationMethod": "Static",
              "privateIPAddress": "[variables('DNSServerIpAddress')]",
              "subnet": {
                "id": "[variables('DefaultSubnetId')]"
              }
            }
          }
        ]
      }
    },
    {
      "type": "Microsoft.Compute/virtualMachines",
      "apiVersion": "2020-06-01",
      "name": "[parameters('ServerVMName')]",
      "location": "[parameters('location')]",
      "dependsOn": [
        "[concat('Microsoft.Network/networkInterfaces/', parameters('ServerVMName'), 'Nic')]"
      ],
      "properties": {
        "hardwareProfile": {
          "vmSize": "[parameters('vmSize')]"
        },
        "osProfile": {
          "AdminUsername": "[parameters('ServerVMUsername')]",
          "AdminPassword": "[parameters('ServerVMPassword')]",
          "computerName": "[parameters('ServerVMName')]"
        },
        "storageProfile": {
          "imageReference": "[parameters('ServerVmImage')]",
          "osDisk": {
            "createOption": "FromImage",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "[ResourceId('Microsoft.Network/networkInterfaces/', concat(parameters('ServerVMName'), 'Nic'))]"
            }
          ]
        }
      }
    },
    {
      "type": "Microsoft.Compute/virtualMachines/extensions",
      "apiVersion": "2021-04-01",
      "name": "[concat(parameters('ServerVMName'),'/', 'PromoteToDomainController')]",
      "location": "[parameters('location')]",
      "dependsOn": [
        "[concat('Microsoft.Compute/virtualMachines/',parameters('ServerVMName'))]"
      ],
      "properties": {
        "publisher": "Microsoft.Compute",
        "type": "CustomScriptExtension",
        "typeHandlerVersion": "1.7",
        "autoUpgradeMinorVersion": true,
        "settings": {
          "commandToExecute": "[concat('powershell.exe -Command \"Install-windowsfeature AD-domain-services; Import-Module ADDSDeployment;$Secure_String_Pwd = ConvertTo-SecureString ',parameters('SafeModeAdministratorPassword'),' -AsPlainText -Force; Install-ADDSForest -DomainName \"bastionkrb.test\" -SafeModeAdministratorPassword $Secure_String_Pwd -Force:$true')]"
          }
      }
    },
    {
      "type": "Microsoft.Network/networkInterfaces",
      "apiVersion": "2018-10-01",
      "name": "[concat(parameters('ClientVMName'), 'Nic')]",
      "location": "[parameters('location')]",
      "dependsOn": [
        "[concat('Microsoft.Network/virtualNetworks/', parameters('VnetName'))]",
        "[concat('Microsoft.Compute/virtualMachines/', parameters('ServerVMName'))]"
      ],
      "properties": {
        "ipConfigurations": [
          {
            "name": "[concat(parameters('ClientVMName'), 'NicIpConfig')]",
            "properties": {
              "privateIPAllocationMethod": "Static",
              "privateIPAddress": "[variables('ClientVMPrivateIpAddress')]",
              "subnet": {
                "id": "[variables('ClientVMSubnetId')]"
              }
            }
          }
        ]
      }
    },
    {
      "type": "Microsoft.Compute/virtualMachines",
      "apiVersion": "2020-06-01",
      "name": "[parameters('ClientVMName')]",
      "location": "[parameters('location')]",
      "dependsOn": [
        "[concat('Microsoft.Network/networkInterfaces/', parameters('ClientVMName'), 'Nic')]"
      ],
      "properties": {
        "hardwareProfile": {
          "vmSize": "[parameters('vmSize')]"
        },
        "osProfile": {
          "AdminUsername": "[parameters('ClientVMUsername')]",
          "AdminPassword": "[parameters('ClientVMPassword')]",
          "computerName": "[parameters('ClientVMName')]"
        },
        "storageProfile": {
          "imageReference": "[parameters('ClientVmImage')]",
          "osDisk": {
            "createOption": "FromImage",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "[ResourceId('Microsoft.Network/networkInterfaces/', concat(parameters('ClientVMName'), 'Nic'))]"
            }
          ]
        }
      }
    },
    {
      "type": "Microsoft.Compute/virtualMachines/extensions",
      "apiVersion": "2021-04-01",
      "name": "[concat(parameters('ClientVMName'),'/', 'DomainJoin')]",
      "location": "[parameters('location')]",
      "dependsOn": [
        "[concat('Microsoft.Compute/virtualMachines/',parameters('ClientVMName'))]",
        "[concat('Microsoft.Compute/virtualMachines/', parameters('ServerVMName'),'/extensions/', 'PromoteToDomainController')]",
        "[concat('Microsoft.Network/bastionHosts/', parameters('BastionName'))]"
      ],
      "properties": {
        "publisher": "Microsoft.Compute",
        "type": "CustomScriptExtension",
        "typeHandlerVersion": "1.7",
        "autoUpgradeMinorVersion": true,
        "settings": {
          "commandToExecute": "[concat('powershell.exe -Command Set-ItemProperty -Path HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Lsa\\MSV1_0\\ -Name RestrictReceivingNTLMTraffic -Value 1; $Pass= ConvertTo-SecureString -String ',parameters('ServerVMPassword'),' -AsPlainText -Force; $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList \"AD\\serveruser\", $Pass; do { try { $joined = add-computer -computername Client-vm -domainname bastionkrb.test –credential $Credential -passthru -restart –force; } catch {}} while ($joined.HasSucceeded -ne $true)')]"
          }
      }
    },
    {
      "apiVersion": "2020-11-01",
      "type": "Microsoft.Network/publicIPAddresses",
      "name": "[parameters('BastionPublicIPName')]",
      "location": "[resourceGroup().location]",
      "sku": {
        "name": "Standard"
      },
      "properties": {
        "publicIPAllocationMethod": "Static"
      },
      "tags": {}
    },
    {
        "type": "Microsoft.Network/bastionHosts",
        "apiVersion": "2020-11-01",
        "name": "[parameters('BastionName')]",
        "location": "[resourceGroup().location]",
        "dependsOn": [
            "[concat('Microsoft.Network/virtualNetworks/', parameters('VnetName'))]",
            "[concat('Microsoft.Network/publicIpAddresses/', parameters('BastionPublicIPName'))]"
        ],
        "sku": {
            "name": "Standard"
        },
        "properties": {
            "enableKerberos": "true",
            "ipConfigurations": [
                {
                    "name": "IpConf",
                    "properties": {
                        "privateIPAllocationMethod": "Dynamic",
                        "publicIPAddress": {
                            "id": "[resourceId('Microsoft.Network/publicIpAddresses', parameters('BastionPublicIPName'))]"
                        },
                        "subnet": {
                            "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('VnetName')), '/subnets/AzureBastionSubnet')]"
                        }
                    }
                }
            ]
        }
    }
  ]
}

템플릿에는 다음과 같은 리소스가 정의되어 있습니다.

  • 다음 Azure 리소스를 배포합니다.
  • VNet의 DNS 서버가 ServerVM(도메인 컨트롤러)의 개인 IP 주소를 가리키도록 합니다.
  • ServerVM에서 사용자 지정 스크립트 확장을 실행하여 도메인 이름이 bastionkrb.test인 도메인 컨트롤러로 승격합니다.
  • ClientVM에서 사용자 지정 스크립트 확장을 실행하여 다음을 수행합니다.
    • NTLM 제한: 들어오는 NTLM 트래픽 = 모든 도메인 계정 거부(이는 Kerberos가 인증에 사용되도록 하기 위한 것입니다.)
    • bastionkrb.test 도메인에 가입합니다.

템플릿 배포

Kerberos를 설정하려면 다음 PowerShell cmd를 실행하여 이전 ARM 템플릿을 배포합니다.

New-AzResourceGroupDeployment -ResourceGroupName <your-rg-name> -TemplateFile "<path-to-template>\KerberosDeployment.json"`

배포된 리소스 검토

이제 Kerberos 인증과 함께 Bastion을 사용하여 ClientVM에 로그인합니다.

  • 자격 증명: 사용자 이름 = serveruser@bastionkrb.test 및 암호 = <password-entered-during-deployment>

다음 단계

Azure Bastion에 대한 자세한 내용은 Azure Bastion이란?을 참조하세요.