Rozwiązywanie problemów z zabezpieczeniami
Dotyczy: Pakiet Windows Azure Pack
W tym temacie opisano rozwiązywanie problemów dotyczących zabezpieczeń i uwierzytelniania w pakiecie Windows Azure Pack dla systemu Windows Server. Wiele problemów można rozwiązać, przeglądając listę kontrolną Poświadczenia w tym temacie. Zalecenia są udostępniane dla następujących problemów:
Po zintegrowaniu usług AD FS zresetuj portal zarządzania, aby korzystać z usługi AD
Po zintegrowaniu usług AD FS nie można uzyskać dostępu do portalu dzierżawy
Uzyskiwanie tokenu za pomocą polecenia cmdlet Get-MgmtSvcToken
Programowe używanie certyfikatów dzierżawy
Zastępowanie certyfikatu z podpisem własnym zaufanym certyfikatem
Rozwiązywanie problemów z ostrzeżeniami dotyczącymi certyfikatów
Zaloguj się do portalu zarządzania z wielu kont
Przeglądanie ustawień protokołu SSL/TLS
Lista kontrolna poświadczeń
Poniższa lista kontrolna zawiera najlepsze rozwiązania dotyczące konfigurowania certyfikatów, nazw użytkowników i haseł dla pakietu Windows Azure Pack oraz używanych produktów i dostawców.
Do testowania lub składników innych niż Internet, takich jak portal zarządzania dla administratorów lub interfejsu API Administracja, można użyć urzędu certyfikacji firmy Microsoft do tworzenia certyfikatów z podpisem własnym.
W przypadku składników z Dostępem do Internetu, takich jak portal zarządzania dla dzierżaw i publiczny interfejs API dzierżawy, należy użyć zaufanego publicznego urzędu certyfikacji.
Skonfiguruj tożsamości puli aplikacji dla programu Service Provider Foundation w usługach Internet Information Services (IIS) na serwerze z uruchomionym programem Service Provider Foundation, aby używały konta poświadczeń użytkownika domeny. Korzystanie z usług sieciowych nie jest zalecane.
Skonfiguruj tożsamości puli aplikacji na serwerach z programem System Center 2012 R2 Virtual Machine Manager i Service Provider Foundation, aby używać tego samego konta domeny, które ma prawa logowania jako usługa .
Skonfiguruj program Service Provider Foundation do korzystania z uwierzytelniania podstawowego w usługach IIS.
Skonfiguruj konto użytkownika lokalnego z uprawnieniami administracyjnymi, które ma być członkiem grupy programu VMM, Administracja, dostawcy i użycia na serwerze z uruchomionym programem Service Provider Foundation. Użyj tego konta użytkownika lokalnego, aby zarejestrować punkt końcowy programu Service Provider Foundation w pakiecie Windows Azure Pack dla systemu Windows Server.
Aby uzyskać więcej informacji, zobacz wpis w blogu Troubleshooting Windows Azure Pack, Service Provider Foundation & Virtual Machine Manager(Rozwiązywanie problemów z pakietem Windows Azure Pack, Service Provider Foundation & Virtual Machine Manager). Aby zapoznać się z omówieniem usług sieci Web Service Provider Foundation, zobacz Manage Web Services and Connections in Service Provider Foundation (Zarządzanie usługami sieci Web i Connections w programie Service Provider Foundation). Zobacz też Omówienie uwierzytelniania pakietu Windows Azure Pack.
Po zintegrowaniu usług AD FS nie można uzyskać dostępu do portalu dzierżawy
Dotyczy: Konfigurowanie Active Directory Federation Services dla pakietu Windows Azure Pack
Problem
Ekran logowania dzierżawy nie jest wyświetlany po skonfigurowaniu usług AD FS (Active Directory Federation Services) lub nie może uzyskać dostępu do portalu zarządzania dla dzierżaw.
Zalecenie
Po zintegrowaniu usług AD FS w domenie, w której jest zainstalowany pakiet Windows Azure Pack, strona logowania jest pomijana bezpośrednio do portalu. Jest to oczekiwane zachowanie przeglądarki.
Jeśli nie możesz uzyskać dostępu do portalu zarządzania dla dzierżaw, użyj Menedżer serwera, aby uruchomić edytor ADSI i sprawdzić, czy serwer usługi AD SF ma nazwę główną usługi (SPN) na liście. Nazwa SPN powinna mieć postać http/myADFSServer.
Powrót do początku
Po zintegrowaniu usług AD FS zresetuj portal zarządzania, aby korzystać z usługi AD
Dotyczy: Konfigurowanie Active Directory Federation Services dla pakietu Windows Azure Pack
Problem
Chcesz powrócić do korzystania z usługi Active Directory (AD) dla portalu zarządzania po zintegrowaniu Active Directory Federation Services (AD FS).
Zalecenie
Należy ponownie opublikować zaufanie między portalem zarządzania dla administratorów i witryny uwierzytelniania systemu Windows, tak jak w przypadku usług AD FS. Lokacja uwierzytelniania systemu Windows to port 30072. Możesz użyć poleceń cmdlet Windows PowerShell Set-MgmtSvcRelyingPartySettigns i Set-MgmtSvcIdentityProviderSettings.
Uzyskiwanie tokenu za pomocą polecenia cmdlet Get-MgmtSvcToken
Dotyczy: Windows Azure Pack for Windows Server Automation z Windows PowerShell
Problem
Get-MgmtSvcToken nie zwraca tokenu zgodnie z oczekiwaniami.
Zalecenie
Może to być problem z poleceniem cmdlet Get-MgmtSvcToken, które nie używa poprawnie Active Directory Federation Services (AD FS). Poniższy skrypt definiuje funkcję Get-AdfsToken jako obejście.
function Get-AdfsToken([string]$adfsAddress, [PSCredential]$credential)
{
$clientRealm = 'http://azureservices/AdminSite'
$allowSelfSignCertificates = $true
Add-Type -AssemblyName 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Add-Type -AssemblyName 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
$identityProviderEndpoint = New-Object -TypeName System.ServiceModel.EndpointAddress -ArgumentList ($adfsAddress + '/adfs/services/trust/13/usernamemixed')
$identityProviderBinding = New-Object -TypeName System.ServiceModel.WS2007HttpBinding -ArgumentList ([System.ServiceModel.SecurityMode]::TransportWithMessageCredential)
$identityProviderBinding.Security.Message.EstablishSecurityContext = $false
$identityProviderBinding.Security.Message.ClientCredentialType = 'UserName'
$identityProviderBinding.Security.Transport.ClientCredentialType = 'None'
$trustChannelFactory = New-Object -TypeName System.ServiceModel.Security.WSTrustChannelFactory -ArgumentList $identityProviderBinding, $identityProviderEndpoint
$trustChannelFactory.TrustVersion = [System.ServiceModel.Security.TrustVersion]::WSTrust13
if ($allowSelfSignCertificates)
{
$certificateAuthentication = New-Object -TypeName System.ServiceModel.Security.X509ServiceCertificateAuthentication
$certificateAuthentication.CertificateValidationMode = 'None'
$trustChannelFactory.Credentials.ServiceCertificate.SslCertificateAuthentication = $certificateAuthentication
}
$ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($credential.Password)
$password = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($ptr)
[System.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($ptr)
$trustChannelFactory.Credentials.SupportInteractive = $false
$trustChannelFactory.Credentials.UserName.UserName = $credential.UserName
$trustChannelFactory.Credentials.UserName.Password = $password #$credential.Password
$rst = New-Object -TypeName System.IdentityModel.Protocols.WSTrust.RequestSecurityToken -ArgumentList ([System.IdentityModel.Protocols.WSTrust.RequestTypes]::Issue)
$rst.AppliesTo = New-Object -TypeName System.IdentityModel.Protocols.WSTrust.EndpointReference -ArgumentList $clientRealm
$rst.TokenType = 'urn:ietf:params:oauth:token-type:jwt'
$rst.KeyType = [System.IdentityModel.Protocols.WSTrust.KeyTypes]::Bearer
$rstr = New-Object -TypeName System.IdentityModel.Protocols.WSTrust.RequestSecurityTokenResponse
$channel = $trustChannelFactory.CreateChannel()
$token = $channel.Issue($rst, [ref] $rstr)
$tokenString = ([System.IdentityModel.Tokens.GenericXmlSecurityToken]$token).TokenXml.InnerText;
$result = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($tokenString))
return $result
}
# Fill in values
$adfsAddress = 'https://adfshost'
$username = 'domain\username'
$password = 'password'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username,$securePassword
$token = Get-AdfsToken -adfsAddress $adfsAddress -credential $credential
$token
Powrót do początku
Programowe używanie certyfikatów dzierżawy
Dotyczy: Service Provider Foundation Developer's Guide
Problem
Należy utworzyć certyfikat i przekazać go do portalu zarządzania dla dzierżaw, a następnie móc go programowo używać.
Zalecenie
Postępuj zgodnie z następującą procedurą:
Utwórz certyfikat (może być podpisany samodzielnie). Powinna mieć rozszerzenie .cer pliku.
Na stronie Moje konto portalu zarządzania dla dzierżaw kliknij pozycję Certyfikaty zarządzania.
Przekaż certyfikat w nagłówku żądania do publicznego interfejsu API dzierżawy na potrzeby uwierzytelniania, jak pokazano w poniższym przykładzie.
Uwaga
Będzie można uzyskać dostęp tylko do subskrypcji przypisanej do tego certyfikatu. Nie będzie można usunąć subskrypcji za pośrednictwem publicznego interfejsu API dzierżawy.
X509Certificate2 mycert3 = new X509Certificate2("C:\\WorkDocs\\Test\\Management Certs\\myCert.cer"); HttpClient httpClient = new HttpClient(); var handler = new WebRequestHandler(); handler.ClientCertificates.Add(mycert3); handler.PreAuthenticate = true; httpClient = new HttpClient(handler); string tenantPublicEndpoint = "https://test.fabrikam.com:30006/"; string subscriptionid = " 7d31eb89-bb1e-4b16-aa3c-993f978b6bc1"; string subscriptionEndpoint = tenantPublicEndpoint + subscriptionid+ "/services/webspaces/defaultwebspace/sites"; var response = httpClient.GetAsync(subscriptionEndpoint); var resultsStr = response.Result.Content.ReadAsStringAsync().Result;
Powrót do początku
Zastępowanie certyfikatu z podpisem własnym zaufanym certyfikatem
Dotyczy: Administrowanie pakietem Windows Azure Pack dla systemu Windows Server
Problem
Po użyciu certyfikatu z podpisem własnym dla środowiska testowego chcesz zastąpić certyfikat certyfikatem wystawionym z zaufanego urzędu.
Zalecenie
Zainstaluj certyfikat w magazynie osobistym komputera lokalnego i zamapuj certyfikat na każdą witrynę sieci Web w Menedżerze usług Internet Information Services (IIS). Certyfikat powinien spełniać następujące wymagania:
Pochodzą z zaufanego urzędu certyfikacji
Mieć prawidłowy zakres dat
Podaj prawidłowe użycie i instrukcję zamierzonego celu
Podaj uwierzytelnianie serwera
Dopasuj nazwę domeny certyfikatu do nazwy witryny sieci Web
Szyfrowanie RSA-1024-bitowe lub nowsze
Dołączanie klucza prywatnego
Powrót do początku
Rozwiązywanie problemów z ostrzeżeniami dotyczącymi certyfikatów
Dotyczy: Wdrażanie pakietu Windows Azure Pack dla systemu Windows Server
Problem
Ostrzeżenia dotyczące certyfikatów są utrwalane przy użyciu certyfikatu z zaufanego urzędu.
Zalecenie
Niektóre przeglądarki nie przetwarzają pola Dostęp do informacji o urzędzie, które znajduje się w certyfikacie podczas walidacji certyfikatu. Obejście polega na jawnym zainstalowaniu certyfikatów pośrednich w magazynie certyfikatów. Aby uzyskać listę urzędów certyfikacji obsługujących to pole, zobacz Windows and Windows Phone 8 SSL Root Certificate Program (Member CAs) (System Windows i Windows Phone 8 certyfikatów głównych SSL (CAs Member CA).
Powrót do początku
Przeglądanie ustawień protokołu SSL/TLS
Dotyczy: Wdrażanie pakietu Windows Azure Pack dla systemu Windows Server
Problem
Słabe zabezpieczenia komunikacji mogą powodować zalew błędów Schannel wyświetlanych w dzienniku zdarzeń systemu.
Zalecenie
Aby zwiększyć bezpieczeństwo kanałów komunikacyjnych pakietu Windows Azure Pack, rozważ zaktualizowanie ustawień protokołu SSL/TLS. Przed wdrożeniem tych zmian należy upewnić się, że nie mają one wpływu na inne aplikacje ani usługi.
Wyłącz protokół SSLv3 (aby uzyskać więcej informacji, zobacz Jak wyłączyć protokół SSL 3.0 w usłudze Azure Websites, rolach i Virtual Machines).
Nie akceptuj kluczy z mniej niż 128 bitami.
Nie akceptuj słabych metod kryptograficznych, takich jak RC4-SHA i MD5 (aby uzyskać więcej informacji, zobacz Jak ograniczyć użycie niektórych algorytmów kryptograficznych i protokołów w Schannel).
Aby wprowadzić następujące zmiany, możesz uruchomić następujący skrypt na każdej maszynie z uruchomionym pakietem Windows Azure Pack:
# PowerShell script to secure TLS/SSL settings.
# Copyright (c) Microsoft Corporation. All rights reserved.
# 20-Jun-2015 Update-ComputerSchannelSettings.ps1
<#
.Synopsis
Apply HTTP.SYS settings
.NOTES
Reference: Http.sys registry settings for Windows
https://support.microsoft.com/en-us/kb/820129
#>
function Set-HttpSysSettings()
{
Write-Verbose -Message "$($Myinvocation.MyCommand.Name)" -Verbose
$regPath = "HKLM:\System\CurrentControlSet\Services\HTTP\Parameters"
# Read original values.
$maxFieldLength = (Get-ItemProperty -Path $regPath -Name MaxFieldLength -ErrorAction SilentlyContinue).MaxFieldLength
$maxRequestBytes = (Get-ItemProperty -Path $regPath -Name MaxRequestBytes -ErrorAction SilentlyContinue).MaxRequestBytes
Write-Verbose -Message "HTTP.SYS settings:`r`n MaxFieldLength = $maxFieldLength`r`n MaxRequestBytes = $maxRequestBytes" -Verbose
# Is update needed?
if ($maxFieldLength -ne 32KB -or $maxRequestBytes -ne 32KB)
{
# Write updated values.
Set-ItemProperty -Path $regPath -Name MaxFieldLength -Value 32KB
Set-ItemProperty -Path $regPath -Name MaxRequestBytes -Value 32KB
# Read updated values.
$maxFieldLength = (Get-ItemProperty -Path $regPath -Name MaxFieldLength).MaxFieldLength
$maxRequestBytes = (Get-ItemProperty -Path $regPath -Name MaxRequestBytes).MaxRequestBytes
Write-Verbose -Message "HTTP.SYS settings (updated):`r`n MaxFieldLength = $maxFieldLength`r`n MaxRequestBytes = $maxRequestBytes" -Verbose
# Changes that are made to the registry will not take effect until you restart the HTTP service.
Write-Warning -Message "HTTP.SYS settings updated; restarting the HTTP service."
Restart-Service -Name "http" -Force -Verbose
}
return $false # No reboot needed.
}
<#
.Synopsis
Apply SSL configuration settings (TLS Cipher Suite Ordering)
.NOTES
Reference: Prioritizing Schannel Cipher Suites
https://msdn.microsoft.com/en-us/library/windows/desktop/bb870930(v=vs.85).aspx
#>
function Set-SchannelCipherOrder()
{
Write-Verbose -Message "$($Myinvocation.MyCommand.Name)" -Verbose
$reboot = $false
$regPath = "HKLM:\SOFTWARE\Policies\Microsoft\Cryptography\Configuration\SSL\00010002"
# The ordered suites names need to be specified as a single string (REG_SZ)
# with each suite separated by commas and with no embedded spaces.
# The list of cipher suites is limited to 1023 characters.
$cipherOrder = @(
'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384_P384'
'TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_P256'
'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384'
'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256'
'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384'
'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256'
'TLS_RSA_WITH_AES_256_GCM_SHA384'
'TLS_RSA_WITH_AES_128_GCM_SHA256'
'TLS_RSA_WITH_AES_256_CBC_SHA256'
'TLS_RSA_WITH_AES_128_CBC_SHA256'
'TLS_RSA_WITH_AES_256_CBC_SHA'
'TLS_RSA_WITH_AES_128_CBC_SHA'
)
$cipherOrderList = ($cipherOrder -join ',')
# Read original values.
$functions = (Get-ItemProperty -Path $regPath -Name Functions -ErrorAction SilentlyContinue).Functions
Write-Verbose -Message "Schannel Cipher Order:`r`n Functions = $($functions -split ',' | ConvertTo-Json)" -Verbose
# Is update needed?
if ($functions -ne ($cipherOrder -join ','))
{
# Write updated values.
Set-ItemProperty -Path $regPath -Name Functions -Value $cipherOrderList -Force
# Read updated values.
$functions = (Get-ItemProperty -Path $regPath -Name Functions -ErrorAction SilentlyContinue).Functions
Write-Verbose -Message "Schannel Cipher Order (updated):`r`n Functions = $($functions -split ',' | ConvertTo-Json)" -Verbose
# It is necessary to restart the computer after modifying this setting for the changes to take effect.
Write-Warning -Message "Schannel Cipher Order updated; it is necessary to restart the computer."
$reboot = $true ### TODO: Restart-Computer -Force -Verbose
}
return $reboot
}
<#
.Synopsis
Apply TLS Protocol version configuration
.NOTES
Reference: How to Disable SSL 3.0 in Azure Websites, Roles, and Virtual Machines
https://azure.microsoft.com/blog/2014/10/19/how-to-disable-ssl-3-0-in-azure-websites-roles-and-virtual-machines/
#>
function Set-SchannelProtocols()
{
Write-Verbose -Message "$($Myinvocation.MyCommand.Name)" -Verbose
$reboot = $false
$regPath = "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols"
$protocolSettings = @(
[PSCustomObject]@{ Path = "$regPath\SSL 2.0\Client"; Name = "Enabled"; Value = 0 }
[PSCustomObject]@{ Path = "$regPath\SSL 2.0\Server"; Name = "Enabled"; Value = 0 }
[PSCustomObject]@{ Path = "$regPath\SSL 3.0\Client"; Name = "Enabled"; Value = 0 }
[PSCustomObject]@{ Path = "$regPath\SSL 3.0\Server"; Name = "Enabled"; Value = 0 }
[PSCustomObject]@{ Path = "$regPath\TLS 1.0\Client"; Name = "Enabled"; Value = 1 }
[PSCustomObject]@{ Path = "$regPath\TLS 1.0\Server"; Name = "Enabled"; Value = 1 }
[PSCustomObject]@{ Path = "$regPath\TLS 1.1\Client"; Name = "Enabled"; Value = 1 }
[PSCustomObject]@{ Path = "$regPath\TLS 1.1\Server"; Name = "Enabled"; Value = 1 }
[PSCustomObject]@{ Path = "$regPath\TLS 1.2\Client"; Name = "Enabled"; Value = 1 }
[PSCustomObject]@{ Path = "$regPath\TLS 1.2\Server"; Name = "Enabled"; Value = 1 }
)
# Read original values.
$currentProtocolSettings = @()
foreach ($protocolSetting in $protocolSettings)
{
$value = (Get-ItemProperty -Path $protocolSetting.Path -Name $protocolSetting.Name -ErrorAction SilentlyContinue).$($protocolSetting.Name)
$currentProtocolSettings += [PSCustomObject]@{ Path = $protocolSetting.Path; Name = $protocolSetting.Name; Value = $value }
}
Write-Verbose -Message "Schannel Protocol Settings: $($currentProtocolSettings | Format-Table -Autosize | Out-String)" -Verbose
$observed = $currentProtocolSettings | ConvertTo-Json -Compress
$expected = $protocolSettings | ConvertTo-Json -Compress
# Is update needed?
if ($observed -ne $expected)
{
# Create registry nodes.
$protocolPaths = @(
"$regPath\SSL 2.0"
"$regPath\SSL 2.0\Client"
"$regPath\SSL 2.0\Server"
"$regPath\SSL 3.0"
"$regPath\SSL 3.0\Client"
"$regPath\SSL 3.0\Server"
"$regPath\TLS 1.0"
"$regPath\TLS 1.0\Client"
"$regPath\TLS 1.0\Server"
"$regPath\TLS 1.1"
"$regPath\TLS 1.1\Client"
"$regPath\TLS 1.1\Server"
"$regPath\TLS 1.2"
"$regPath\TLS 1.2\Client"
"$regPath\TLS 1.2\Server"
)
foreach ($protocolPath in $protocolPaths)
{
if (-not (Get-Item -Path $protocolPath -ErrorAction SilentlyContinue))
{
New-Item -Path $protocolPath -ItemType Container -Force | Out-Null
}
}
# Write updated values.
foreach ($protocolSetting in $protocolSettings)
{
Set-ItemProperty -Path $protocolSetting.Path -Name $protocolSetting.Name -Value $protocolSetting.Value -Force
}
# Read updated values.
$currentProtocolSettings = @()
foreach ($protocolSetting in $protocolSettings)
{
$value = (Get-ItemProperty -Path $protocolSetting.Path -Name $protocolSetting.Name -ErrorAction SilentlyContinue).$($protocolSetting.Name)
$currentProtocolSettings += [PSCustomObject]@{ Path = $protocolSetting.Path; Name = $protocolSetting.Name; Value = $value }
}
Write-Verbose -Message "Schannel Protocol Settings (updated): $($currentProtocolSettings | Format-Table -Autosize | Out-String)" -Verbose
# It is necessary to restart the computer after modifying this setting for the changes to take effect.
Write-Warning -Message "Schannel Protocols updated; it is necessary to restart the computer."
$reboot = $true ### TODO: Restart-Computer -Force -Verbose
}
return $reboot
}
#-------------------------------------------------------------------------------
# Main
$reboot = $false
$reboot += Set-HttpSysSettings
$reboot += Set-SchannelCipherOrder
$reboot += Set-SchannelProtocols
if ($reboot)
{
Write-Warning -Message "Restart the computer for settings to take effect."
# TODO: Restart-Computer -Force -Verbose
}
Możesz również uruchomić narzędzia do sprawdzania poprawności protokołu SSL/TLS, aby zidentyfikować inne obszary do ulepszenia.
Powrót do początku
Zaloguj się do portalu zarządzania z wielu kont
Dotyczy: Pakiet Windows Azure Pack dla usługi Windows Server Automation z Windows PowerShell
Problem
Musisz mieć możliwość logowania się do portalu zarządzania z wielu kont.
Zalecenie
Użyj polecenia cmdlet Add-MgmtSvcAdminUser Windows PowerShell, aby dodać dodatkowe podmioty zabezpieczeń. Te podmioty zabezpieczeń mogą być jawnymi użytkownikami lub grupami zabezpieczeń (jeśli tokeny zawierają informacje o grupie zabezpieczeń). Poniższy przykład dodaje użytkownika. (Przyjęto założenie, że hasło zostało zdefiniowane dla zmiennej $pwd).
Add-MgmtSvcAdminUser -Server 'mysqlserver' -UserName 'sa' -Password $pwd -Principal 'user7@contoso.com'
Powrót do początku