Delen via


Beveiligingsproblemen oplossen

 

Van toepassing op: Windows Azure Pack

In dit onderwerp worden problemen met beveiliging en verificatie in Windows Azure Pack voor Windows Server beschreven. Veel problemen kunnen worden opgelost door de controlelijst voor referenties in dit onderwerp te bekijken. Er worden aanbevelingen gedaan voor de volgende problemen:

  • Nadat AD FS is geïntegreerd, stelt u de beheerportal opnieuw in om AD te gebruiken

  • Na de integratie van AD FS heeft u geen toegang tot de tenantportal

  • Een token ophalen met de cmdlet Get-MgmtSvcToken

  • Tenantcertificaten programmatisch gebruiken

  • Een zelfondertekend certificaat vervangen door een vertrouwd certificaat

  • Certificaatwaarschuwingen oplossen

  • Aanmelden bij de beheerportal vanaf meerdere accounts

  • SSL/TLS-instellingen controleren

Controlelijst voor referenties

De volgende controlelijst bevat aanbevolen procedures voor het configureren van certificaten, gebruikersnamen en wachtwoorden voor Windows Azure Pack en de producten en providers die worden gebruikt.

  • Voor het testen of niet-internetgerichte onderdelen, zoals de beheerportal voor beheerders of Beheer API, kunt u de Microsoft-certificeringsinstantie gebruiken om zelfondertekende certificaten te maken.

  • Voor internetgerichte onderdelen, zoals de beheerportal voor tenants en de openbare TENANT-API, gebruikt u een vertrouwde openbare certificeringsinstantie.

  • Configureer de toepassingsgroepidentiteiten voor Service Provider Foundation in Internet Information Services (IIS) op de server waarop Service Provider Foundation wordt uitgevoerd, zodat ze het account voor domeingebruikersreferenties gebruiken. Het gebruik van Netwerkservices wordt niet aanbevolen.

  • Configureer de identiteiten van de groep van toepassingen op de servers met System Center 2012 R2 Virtual Machine Manager en Service Provider Foundation om hetzelfde domeinaccount te gebruiken dat aanmeldingsrechten heeft.

  • Configureer Service Provider Foundation voor het gebruik van basisverificatie in IIS.

  • Configureer een lokaal gebruikersaccount met beheerdersrechten om lid te zijn van de VMM-, Beheer-, provider- en gebruiksgroepen op de server waarop Service Provider Foundation wordt uitgevoerd. Gebruik dit lokale gebruikersaccount om het Service Provider Foundation-eindpunt te registreren bij Windows Azure Pack voor Windows Server.

Zie het blogbericht Problemen met Windows Azure Pack, Service Provider Foundation & Virtual Machine Manager oplossen voor meer informatie. Zie Webservices en Connections beheren in Service Provider Foundation voor een overzicht van de Service Provider Foundation-webservices. Zie ook Overzicht van Windows Azure Pack-verificatie.

Na de integratie van AD FS heeft u geen toegang tot de tenantportal

Heeft betrekking op: Active Directory Federation Services configureren voor Windows Azure Pack

Probleem

Het aanmeldingsscherm van de tenant wordt niet weergegeven na het configureren van AD FS (Active Directory Federation Services) of heeft geen toegang tot de beheerportal voor tenants.

Aanbeveling

Nadat u AD FS hebt geïntegreerd in het domein waar Windows Azure Pack is geïnstalleerd, wordt de aanmeldingspagina omzeild en gaat deze rechtstreeks naar de portal. Dit is het verwachte browsergedrag.

Als u geen toegang hebt tot de beheerportal voor tenants, gebruikt u Serverbeheer om ADSI Bewerken uit te voeren en te controleren of uw AD SF-server een Service Principal Name (SPN) wordt vermeld. De SPN moet de vorm http/myADFSServer hebben.

Naar boven

Nadat AD FS is geïntegreerd, stelt u de beheerportal opnieuw in om AD te gebruiken

Heeft betrekking op: Active Directory Federation Services configureren voor Windows Azure Pack

Probleem

Wilt u terugkeren naar het gebruik van Active Directory (AD) voor de beheerportal, na de integratie van Active Directory Federation Services (AD FS).

Aanbeveling

U moet de vertrouwensrelatie tussen de beheerportal voor beheerders en de Windows-verificatiesite herstellen, net zoals u hebt gedaan voor AD FS. De Windows-verificatiesite is poort 30072. U kunt de Windows PowerShell cmdlets Set-MgmtSvcRelyingPartySettigns en Set-MgmtSvcIdentityProviderSettings gebruiken.

Een token ophalen met de cmdlet Get-MgmtSvcToken

Heeft betrekking op: Windows Azure Pack voor Windows Server Automation met Windows PowerShell

Probleem

De Get-MgmtSvcToken retourneert het token niet zoals verwacht.

Aanbeveling

Dit kan een probleem zijn waarbij de cmdlet Get-MgmtSvcToken Active Directory Federation Services (AD FS) niet correct gebruikt. Het volgende script definieert een functie, Get-AdfsToken, als tijdelijke oplossing.

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

Naar boven

Tenantcertificaten programmatisch gebruiken

Heeft betrekking op: Handleiding voor ontwikkelaars van Service Provider Foundation

Probleem

U moet een certificaat maken en uploaden naar de beheerportal voor tenants en het vervolgens programmatisch kunnen gebruiken.

Aanbeveling

Gebruik de volgende procedure:

  1. Een certificaat maken (dit kan zelfondertekend zijn). Het moet een .cer bestandsextensie hebben.

  2. Klik op de pagina Mijn account van de beheerportal voor tenants op Beheercertificaten.

  3. Geef het certificaat in de header van de aanvraag door aan de openbare TENANT-API voor verificatie, zoals wordt weergegeven in het volgende voorbeeld.

    Notitie

    U hebt alleen toegang tot het abonnement waaraan dit certificaat is toegewezen. U kunt het abonnement niet verwijderen via de openbare TENANT-API.

    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;
    

Naar boven

Een zelfondertekend certificaat vervangen door een vertrouwd certificaat

Heeft betrekking op: Windows Azure Pack voor Windows Server beheren

Probleem

Nadat u een zelfondertekend certificaat voor een testomgeving hebt gebruikt, wilt u het certificaat vervangen door een certificaat dat is uitgegeven door een vertrouwde instantie.

Aanbeveling

Installeer het certificaat in het persoonlijke archief van de lokale computer en wijs het certificaat toe aan elke website in IIS-beheer (Internet Information Services). Het certificaat moet voldoen aan de volgende vereisten:

  • Afkomstig van een vertrouwde certificeringsinstantie

  • Een geldig datumbereik hebben

  • Geef een geldige gebruiks- en doelinstructie op

  • Serververificatie opgeven

  • De domeinnaam van het certificaat vergelijken met de naam van de website

  • Een RSA-1024-bits versleuteling of hoger hebben

  • De persoonlijke sleutel opnemen

Naar boven

Certificaatwaarschuwingen oplossen

Heeft betrekking op: Windows Azure Pack voor Windows Server implementeren

Probleem

Certificaatwaarschuwingen blijven behouden met een certificaat van een vertrouwde instantie.

Aanbeveling

Sommige browsers verwerken het veld Toegang tot autoriteitsgegevens in het certificaat niet tijdens de certificaatvalidatie. De tijdelijke oplossing is om de tussenliggende certificaten expliciet in het certificaatarchief te installeren. Zie Windows and Windows Phone 8 SSL Root Certificate Program (Member CA's) voor een lijst met certificeringsinstanties die ondersteuning bieden voor dit veld.

Naar boven

SSL/TLS-instellingen controleren

Heeft betrekking op: Windows Azure Pack voor Windows Server implementeren

Probleem

Zwakke communicatiebeveiliging kan leiden tot een stroom Schannel-fouten die worden weergegeven in het systeemgebeurtenislogboek.

Aanbeveling

Als u de beveiliging van communicatiekanalen van Windows Azure Pack wilt verbeteren, kunt u overwegen uw SSL/TLS-instellingen bij te werken. Voordat u deze wijzigingen implementeert, moet u ervoor zorgen dat ze geen invloed hebben op andere toepassingen of services.

U kunt het volgende script uitvoeren op elke computer waarop Windows Azure Pack wordt uitgevoerd om deze wijzigingen voor u aan te brengen:

# 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
}

U kunt ook HULPPROGRAMMA's voor SSL/TLS-validatie uitvoeren om andere gebieden voor verbetering te identificeren.

Naar boven

Aanmelden bij de beheerportal vanaf meerdere accounts

Heeft betrekking op: Windows Azure Pack voor Windows Server Automation met Windows PowerShell

Probleem

U moet zich vanuit meerdere accounts kunnen aanmelden bij de beheerportal.

Aanbeveling

Gebruik de cmdlet Add-MgmtSvcAdminUser Windows PowerShell om extra principals toe te voegen. Deze principals kunnen expliciete gebruikers of beveiligingsgroepen zijn (als uw tokens informatie over beveiligingsgroepen bevatten). In het volgende voorbeeld wordt een gebruiker toegevoegd. (Hierbij wordt ervan uitgegaan dat het wachtwoord is gedefinieerd voor de variabele $pwd.)

Add-MgmtSvcAdminUser -Server 'mysqlserver' -UserName 'sa' -Password $pwd -Principal 'user7@contoso.com'

Naar boven

Zie ook

Problemen met Windows Azure Pack oplossen