準備 Azure Stack Hub 中的擴充主機
擴充主機藉由減少所需的 TCP/IP 埠數目來保護 Azure Stack Hub。 本文說明如何在 1808 更新之後,針對透過 Azure Stack Hub 更新套件自動啟用的擴充主機準備 Azure Stack Hub。 本文適用於 Azure Stack Hub 更新 1808、1809 和 1811。
憑證需求
擴充主機會實作兩個新的網域命名空間,以確保每個入口網站擴充功能的唯一主機條目。 新的網域命名空間需要另外兩個通配符憑證,以確保安全通訊。
下表顯示新的命名空間和相關聯的憑證:
部署資料夾 | 必要的憑證主體和主體替代名稱(SAN) | 範圍(每個區域) | 子域命名空間 |
---|---|---|---|
管理員擴充功能主機 | *.adminhosting。<區域>。<fqdn> (通配符 SSL 憑證) | 管理員擴充功能主機 | adminhosting。<區域>。<fqdn> |
公用擴充主機 | *.主機.<區域>.<fqdn> (通配符 SSL 憑證) | 公用擴充主機 | 主機代管。<區域>。<fqdn> |
如需詳細的憑證需求,請參閱 Azure Stack Hub 公鑰基礎結構憑證需求。
建立憑證簽署要求
Azure Stack Hub 整備檢查程式工具可讓您為兩個新的和必要的 SSL 憑證建立憑證簽署要求。 請遵循 Azure Stack Hub 憑證簽署要求產生一文中的步驟。
注意
您可以略過此步驟,視您要求 SSL 憑證的方式而定。
驗證新的憑證
在硬體生命週期主機或 Azure Stack Hub 管理工作站上,以系統管理員權限開啟 PowerShell。
執行下列 Cmdlet 以安裝 Azure Stack Hub 整備檢查工具:
Install-Module -Name Microsoft.AzureStack.ReadinessChecker
執行下列腳本來建立必要的資料夾結構:
New-Item C:\Certificates -ItemType Directory $directories = 'ACSBlob','ACSQueue','ACSTable','Admin Portal','ARM Admin','ARM Public','KeyVault','KeyVaultInternal','Public Portal', 'Admin extension host', 'Public extension host' $destination = 'c:\certificates' $directories | % { New-Item -Path (Join-Path $destination $PSITEM) -ItemType Directory -Force}
注意
如果您使用 Microsoft Entra ID Federated Services (AD FS) 進行部署,則必須在腳本中將下列目錄新增至 $directories:
ADFS
、Graph
。將您目前在 Azure Stack Hub 中所使用的現有憑證放在適當的目錄中。 例如,將 Admin ARM 憑證放在
Arm Admin
資料夾中。 然後將新建立的托管憑證放於Admin extension host
和Public extension host
目錄中。執行下列 Cmdlet 以啟動憑證檢查:
$pfxPassword = Read-Host -Prompt "Enter PFX Password" -AsSecureString Start-AzsReadinessChecker -CertificatePath c:\certificates -pfxPassword $pfxPassword -RegionName east -FQDN azurestack.contoso.com -IdentitySystem AAD
檢查輸出以查看所有憑證是否通過所有測試。
匯入延伸模組主機憑證
使用可連線到 Azure Stack Hub 特殊許可權端點的電腦進行後續步驟。 請確定您可以從該電腦存取新的憑證檔案。
使用可連線到 Azure Stack Hub 特殊許可權端點的電腦進行後續步驟。 請確定您從該電腦存取新的憑證檔案。
開啟 PowerShell ISE 以執行下一個腳本區塊。
匯入管理員裝載端點的憑證。
$CertPassword = read-host -AsSecureString -prompt "Certificate Password" $CloudAdminCred = Get-Credential -UserName <Privileged endpoint credentials> -Message "Enter the cloud domain credentials to access the privileged endpoint." [Byte[]]$AdminHostingCertContent = [Byte[]](Get-Content c:\certificate\myadminhostingcertificate.pfx -Encoding Byte) Invoke-Command -ComputerName <PrivilegedEndpoint computer name> ` -Credential $CloudAdminCred ` -ConfigurationName "PrivilegedEndpoint" ` -ArgumentList @($AdminHostingCertContent, $CertPassword) ` -ScriptBlock { param($AdminHostingCertContent, $CertPassword) Import-AdminHostingServiceCert $AdminHostingCertContent $certPassword }
匯入裝載端點的憑證:
$CertPassword = read-host -AsSecureString -prompt "Certificate Password" $CloudAdminCred = Get-Credential -UserName <Privileged endpoint credentials> -Message "Enter the cloud domain credentials to access the privileged endpoint." [Byte[]]$HostingCertContent = [Byte[]](Get-Content c:\certificate\myhostingcertificate.pfx -Encoding Byte) Invoke-Command -ComputerName <PrivilegedEndpoint computer name> ` -Credential $CloudAdminCred ` -ConfigurationName "PrivilegedEndpoint" ` -ArgumentList @($HostingCertContent, $CertPassword) ` -ScriptBlock { param($HostingCertContent, $CertPassword) Import-UserHostingServiceCert $HostingCertContent $certPassword }
更新 DNS 設定
注意
如果您使用 DNS 整合的 DNS 區域委派,則不需要此步驟。
如果個別主機 A 記錄已設定為發佈 Azure Stack Hub 端點,您需要建立兩個額外的主機 A 記錄:
網際協定(IP) | 主機名 | 類型 |
---|---|---|
<IP> | *.Adminhosting。<區域>。<FQDN> | 一個 |
<IP> | *.託管。<區域>。<FQDN> | 一個 |
執行 cmdlet Get-AzureStackStampInformation,即可透過具有特權的端點擷取已配置的 IP。
埠和通訊協定
本文 Azure Stack Hub 數據中心整合 - 發佈端點 涵蓋在擴充主機部署之前,需要進行進入通訊以發佈 Azure Stack Hub 的埠和通訊協定。
發佈新的端點
您必須透過防火牆發佈兩個新的端點。 您必須從 Azure Stack Hub 環境的特殊許可權端點執行下列程式碼,以擷取公用VIP集區中已配置的IP。
# Create a PEP Session
winrm s winrm/config/client '@{TrustedHosts= "<IpOfERCSMachine>"}'
$PEPCreds = Get-Credential
$PEPSession = New-PSSession -ComputerName <IpOfERCSMachine> -Credential $PEPCreds -ConfigurationName "PrivilegedEndpoint" -SessionOption (New-PSSessionOption -Culture en-US -UICulture en-US)
# Obtain DNS Servers and extension host information from Azure Stack Hub Stamp Information and find the IPs for the Host Extension Endpoints
$StampInformation = Invoke-Command $PEPSession {Get-AzureStackStampInformation} | Select-Object -Property ExternalDNSIPAddress01, ExternalDNSIPAddress02, @{n="TenantHosting";e={($_.TenantExternalEndpoints.TenantHosting) -replace "https://*.","testdnsentry"-replace "/"}}, @{n="AdminHosting";e={($_.AdminExternalEndpoints.AdminHosting)-replace "https://*.","testdnsentry"-replace "/"}},@{n="TenantHostingDNS";e={($_.TenantExternalEndpoints.TenantHosting) -replace "https://",""-replace "/"}}, @{n="AdminHostingDNS";e={($_.AdminExternalEndpoints.AdminHosting)-replace "https://",""-replace "/"}}
If (Resolve-DnsName -Server $StampInformation.ExternalDNSIPAddress01 -Name $StampInformation.TenantHosting -ErrorAction SilentlyContinue) {
Write-Host "Can access AZS DNS" -ForegroundColor Green
$AdminIP = (Resolve-DnsName -Server $StampInformation.ExternalDNSIPAddress02 -Name $StampInformation.AdminHosting).IPAddress
Write-Host "The IP for the Admin Extension Host is: $($StampInformation.AdminHostingDNS) - is: $($AdminIP)" -ForegroundColor Yellow
Write-Host "The Record to be added in the DNS zone: Type A, Name: $($StampInformation.AdminHostingDNS), Value: $($AdminIP)" -ForegroundColor Green
$TenantIP = (Resolve-DnsName -Server $StampInformation.ExternalDNSIPAddress01 -Name $StampInformation.TenantHosting).IPAddress
Write-Host "The IP address for the Tenant Extension Host is $($StampInformation.TenantHostingDNS) - is: $($TenantIP)" -ForegroundColor Yellow
Write-Host "The Record to be added in the DNS zone: Type A, Name: $($StampInformation.TenantHostingDNS), Value: $($TenantIP)" -ForegroundColor Green
}
Else {
Write-Host "Cannot access AZS DNS" -ForegroundColor Yellow
$AdminIP = (Resolve-DnsName -Name $StampInformation.AdminHosting).IPAddress
Write-Host "The IP for the Admin Extension Host is: $($StampInformation.AdminHostingDNS) - is: $($AdminIP)" -ForegroundColor Yellow
Write-Host "The Record to be added in the DNS zone: Type A, Name: $($StampInformation.AdminHostingDNS), Value: $($AdminIP)" -ForegroundColor Green
$TenantIP = (Resolve-DnsName -Name $StampInformation.TenantHosting).IPAddress
Write-Host "The IP address for the Tenant Extension Host is $($StampInformation.TenantHostingDNS) - is: $($TenantIP)" -ForegroundColor Yellow
Write-Host "The Record to be added in the DNS zone: Type A, Name: $($StampInformation.TenantHostingDNS), Value: $($TenantIP)" -ForegroundColor Green
}
Remove-PSSession -Session $PEPSession
範例輸出
Can access AZS DNS
The IP for the Admin Extension Host is: *.adminhosting.\<region>.\<fqdn> - is: xxx.xxx.xxx.xxx
The Record to be added in the DNS zone: Type A, Name: *.adminhosting.\<region>.\<fqdn>, Value: xxx.xxx.xxx.xxx
The IP address for the Tenant Extension Host is *.hosting.\<region>.\<fqdn> - is: xxx.xxx.xxx.xxx
The Record to be added in the DNS zone: Type A, Name: *.hosting.\<region>.\<fqdn>, Value: xxx.xxx.xxx.xxx
注意
啟用擴充主機之前,請先進行這項變更。 這可讓 Azure Stack Hub 入口網站持續存取。
端點 (VIP) | 協定 | 港口 |
---|---|---|
主機管理 | HTTPS | 443 |
主機托管 | HTTPS | 443 |
更新現有的發佈規則 (擴充主機啟用後)
注意
1808 Azure Stack Hub 更新套件尚未啟用擴充主機。 它可讓您匯入必要的憑證來準備擴充主機。 在 1808 更新之後,透過 Azure Stack Hub 更新套件自動啟用擴充主機之前,請勿關閉任何埠。
現有的防火牆規則中必須關閉下列現有的端點埠。
注意
建議您在驗證成功之後關閉這些埠。
端點(VIP) | 協定 | 港口 |
---|---|---|
入口網站(管理員) | HTTPS | 12495 12499 12646 12647 12648 12649 12650 13001 13003 13010 13011 13012 13020 13021 13026 30015 |
入口(使用者) | HTTPS | 12495 12649 13001 13010 13011 13012 13020 13021 30015 13003 |
Azure Resource Manager(系統管理員) | HTTPS | 30024 |
Azure Resource Manager(用戶) | HTTPS | 30024 |
後續步驟
- 瞭解 防火牆整合。
- 瞭解 Azure Stack Hub 憑證簽署要求生成。