TLS-beleidsversies en coderingssuites configureren in Application Gateway

Meer informatie over het configureren van TLS/SSL-beleidsversies en coderingssuites in Application Gateway. U kunt kiezen uit een lijst met vooraf gedefinieerde beleidsregels die verschillende configuraties van TLS-beleidsversies en ingeschakelde coderingssuites bevatten. U hebt ook de mogelijkheid om een aangepast TLS-beleid te definiëren op basis van uw vereisten.

Belangrijk

We raden u aan TLS 1.2 te gebruiken als minimale TLS-protocolversie voor betere beveiliging op uw Application Gateway. Vanaf 31 augustus 2025 moeten alle clients en back-endservers die communiceren met Azure-toepassing Gateway TLS (Transport Layer Security) 1.2 of hoger gebruiken, omdat ondersteuning voor TLS 1.0 en 1.1 wordt stopgezet.

Opmerking

U wordt aangeraden de Azure Az PowerShell-module te gebruiken om te communiceren met Azure. Zie Azure PowerShell installeren om aan de slag te gaan. Raadpleeg Azure PowerShell migreren van AzureRM naar Az om te leren hoe u naar de Azure PowerShell-module migreert.

Beschikbare TLS-opties ophalen

De Get-AzApplicationGatewayAvailableSslOptions cmdlet bevat een lijst met beschikbare vooraf gedefinieerde beleidsregels, beschikbare coderingssuites en protocolversies die kunnen worden geconfigureerd. In het volgende voorbeeld ziet u een voorbeeld van uitvoer van het uitvoeren van de cmdlet.

Belangrijk

Gateways die zijn gemaakt met API-versie 2023-02-01 of later, gebruiken AppGwSslPolicy20220101 als standaard TLS-beleid. De DefaultPolicy waarde in de volgende output geeft nog steeds aan dat AppGwSslPolicy20150501 omdat Azure PowerShell en Azure CLI-ondersteuning voor de bijgewerkte standaard nog niet beschikbaar is. Om de standaardinstelling voor je gateway te bevestigen, controleer je de read-only defaultPredefinedSslPolicy eigenschap op de resource. Voor meer informatie, zie TLS-beleidsoverzicht.

DefaultPolicy: AppGwSslPolicy20150501
PredefinedPolicies:
    /subscriptions/xxx-xxx/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/Applic
ationGatewaySslPredefinedPolicy/AppGwSslPolicy20150501
    /subscriptions/xxx-xxx/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/Applic
ationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401
    /subscriptions/xxx-xxx/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/Applic
ationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401S
    /subscriptions/xxx-xxx/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/Applic
ationGatewaySslPredefinedPolicy/AppGwSslPolicy20220101
    /subscriptions/xxx-xxx/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/Applic
ationGatewaySslPredefinedPolicy/AppGwSslPolicy20220101S

AvailableCipherSuites:
    TLS_AES_128_GCM_SHA256
    TLS_AES_256_GCM_SHA384
    TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
    TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
    TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
    TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
    TLS_DHE_RSA_WITH_AES_256_CBC_SHA
    TLS_DHE_RSA_WITH_AES_128_CBC_SHA
    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
    TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
    TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
    TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
    TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
    TLS_DHE_DSS_WITH_AES_256_CBC_SHA
    TLS_DHE_DSS_WITH_AES_128_CBC_SHA
    TLS_RSA_WITH_3DES_EDE_CBC_SHA
    TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA

AvailableProtocols:
    TLSv1_0
    TLSv1_1
    TLSv1_2
    TLSv1_3

Vooraf gedefinieerd TLS-beleid weergeven

Application Gateway wordt geleverd met meerdere vooraf gedefinieerde beleidsregels die je kunt gebruiken. Met de Get-AzApplicationGatewaySslPredefinedPolicy cmdlet worden deze beleidsregels opgehaald. Elk beleid heeft verschillende protocolversies en coderingssuites ingeschakeld. Gebruik deze vooraf gedefinieerde beleidsregels om snel een TLS-beleid te configureren op je applicatiegateway. Het standaardbeleid dat wordt toegepast wanneer je geen specifiek TLS-beleid definieert, hangt af van de API-versie die wordt gebruikt om de gateway te maken: gateways die zijn gemaakt met API-versie 2023-02-01 of later, standaard AppGwSslPolicy20220101, terwijl gateways die met eerdere API-versies zijn gemaakt standaard AppGwSslPolicy20150501 gebruiken. Omdat de ondersteuning voor TLS 1.0 en 1.1 op 31 augustus 2025 is beëindigd, gebruik een vooraf gedefinieerd beleid uit 2022 (AppGwSslPolicy20220101 of AppGwSslPolicy20220101S) of een CustomV2-beleid, zodat clients en backendservers TLS 1.2 of hoger onderhandelen. Als je een specifieke set cipher-suites nodig hebt, kun je AppGwSslPolicy20170401S gebruiken. De vooraf gedefinieerde beleidsregels van 2022 en het CustomV2-beleid zijn alleen beschikbaar op de v2 SKU (Standard_v2 of WAF_v2).

De volgende uitvoer is een voorbeeld van het uitvoeren van Get-AzApplicationGatewaySslPredefinedPolicy.

Name: AppGwSslPolicy20150501
MinProtocolVersion: TLSv1_0
CipherSuites:
    TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
    TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
    TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
    TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
    TLS_DHE_RSA_WITH_AES_256_CBC_SHA
    TLS_DHE_RSA_WITH_AES_128_CBC_SHA
    TLS_RSA_WITH_AES_256_GCM_SHA384
 ...
Name: AppGwSslPolicy20170401
MinProtocolVersion: TLSv1_1
CipherSuites:
    TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
    TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
    TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
...

Een aangepast TLS-beleid configureren

Wanneer je een aangepast TLS-beleid configureert, geef dan de volgende parameters: PolicyType, MinProtocolVersion, , CipherSuiteen ApplicationGateway. Als je andere parameters probeert te geven, krijg je een foutmelding bij het aanmaken of updaten van de Application Gateway. In het volgende voorbeeld wordt een aangepast TLS-beleid ingesteld op een toepassingsgateway. Hiermee stelt u de minimale protocolversie TLSv1_2 in en schakelt u de volgende coderingssuites in:

  • TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  • TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
# get an application gateway resource
$gw = Get-AzApplicationGateway -Name AdatumAppGateway -ResourceGroup AdatumAppGatewayRG

# set the TLS policy on the application gateway
Set-AzApplicationGatewaySslPolicy -ApplicationGateway $gw -PolicyType Custom -MinProtocolVersion TLSv1_2 -CipherSuite "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"

# validate the TLS policy locally
Get-AzApplicationGatewaySslPolicy -ApplicationGateway $gw

# update the gateway with validated TLS policy
Set-AzApplicationGateway -ApplicationGateway $gw

Belangrijk

Cipher Suites TLS_AES_128_GCM_SHA256 en TLS_AES_256_GCM_SHA384 met TLSv1.3 zijn niet aanpasbaar en worden standaard inbegrepen bij het instellen van een CustomV2-beleid met een minimale TLS-versie van 1.2 of 1.3. Deze twee cipher suites verschijnen niet in de Get Details-output, met uitzondering van Portal.

Als u de minimale protocolversie wilt instellen op 1.3, moet u de volgende opdracht gebruiken:

Set-AzApplicationGatewaySslPolicy -ApplicationGateway $AppGW -MinProtocolVersion TLSv1_3 -PolicyType CustomV2 -CipherSuite @()

In deze afbeelding wordt het gebruik van CustomV2-beleid nader uitgelegd met minimale protocolversies 1.2 en 1.3.

Diagram met het gebruik van de parameter ciphersuite voor het CustomV2-beleid.

Een toepassingsgateway maken met een vooraf gedefinieerd TLS-beleid

Wanneer u een vooraf gedefinieerd TLS-beleid configureert, geeft u de volgende parameters door: PolicyType, PolicyName en ApplicationGateway. Als u andere parameters probeert door te geven, krijgt u een foutmelding bij het maken of bijwerken van de Application Gateway.

In het volgende voorbeeld wordt een nieuwe toepassingsgateway gemaakt met een vooraf gedefinieerd TLS-beleid.

# Create a resource group
$rg = New-AzResourceGroup -Name ContosoRG -Location "East US"

# Create a subnet for the application gateway
$subnet = New-AzVirtualNetworkSubnetConfig -Name subnet01 -AddressPrefix 10.0.0.0/24

# Create a virtual network with a 10.0.0.0/16 address space
$vnet = New-AzVirtualNetwork -Name appgwvnet -ResourceGroupName $rg.ResourceGroupName -Location "East US" -AddressPrefix 10.0.0.0/16 -Subnet $subnet

# Retrieve the subnet object for later use
$subnet = $vnet.Subnets[0]

# Create a public IP address (v2 requires a Standard SKU, static public IP address)
$publicip = New-AzPublicIpAddress -ResourceGroupName $rg.ResourceGroupName -name publicIP01 -location "East US" -AllocationMethod Static -Sku Standard

# Create an ip configuration object
$gipconfig = New-AzApplicationGatewayIPConfiguration -Name gatewayIP01 -Subnet $subnet

# Create a backend pool for backend web servers
$pool = New-AzApplicationGatewayBackendAddressPool -Name pool01 -BackendIPAddresses 134.170.185.46, 134.170.188.221,134.170.185.50

# Define the backend http settings to be used.
$poolSetting = New-AzApplicationGatewayBackendHttpSettings -Name poolsetting01 -Port 80 -Protocol Http -CookieBasedAffinity Enabled

# Create a new port for TLS
$fp = New-AzApplicationGatewayFrontendPort -Name frontendport01  -Port 443

# Upload an existing pfx certificate for TLS offload
$password = ConvertTo-SecureString -String "P@ssw0rd" -AsPlainText -Force
$cert = New-AzApplicationGatewaySslCertificate -Name cert01 -CertificateFile C:\folder\contoso.pfx -Password $password

# Create a frontend IP configuration for the public IP address
$fipconfig = New-AzApplicationGatewayFrontendIPConfig -Name fipconfig01 -PublicIPAddress $publicip

# Create a new listener with the certificate, port, and frontend ip.
$listener = New-AzApplicationGatewayHttpListener -Name listener01  -Protocol Https -FrontendIPConfiguration $fipconfig -FrontendPort $fp -SslCertificate $cert

# Create a new rule for backend traffic routing (rule priority is required)
$rule = New-AzApplicationGatewayRequestRoutingRule -Name rule01 -RuleType Basic -BackendHttpSettings $poolSetting -HttpListener $listener -BackendAddressPool $pool -Priority 100

# Define the size of the application gateway
$sku = New-AzApplicationGatewaySku -Name Standard_v2 -Tier Standard_v2 -Capacity 2

# Configure the TLS policy to use a different predefined policy
$policy = New-AzApplicationGatewaySslPolicy -PolicyType Predefined -PolicyName AppGwSslPolicy20220101S

# Create the application gateway.
$appgw = New-AzApplicationGateway -Name appgwtest -ResourceGroupName $rg.ResourceGroupName -Location "East US" -BackendAddressPools $pool -BackendHttpSettingsCollection $poolSetting -FrontendIpConfigurations $fipconfig  -GatewayIpConfigurations $gipconfig -FrontendPorts $fp -HttpListeners $listener -RequestRoutingRules $rule -Sku $sku -SslCertificates $cert -SslPolicy $policy

Een bestaande toepassingsgateway bijwerken met een vooraf gedefinieerd TLS-beleid

Als u een aangepast TLS-beleid wilt instellen, geeft u de volgende parameters door: PolicyType, MinProtocolVersion, CipherSuite en ApplicationGateway. Als u een vooraf gedefinieerd TLS-beleid wilt instellen, geeft u de volgende parameters door: PolicyType, PolicyName en ApplicationGateway. Als u andere parameters probeert door te geven, krijgt u een foutmelding bij het maken of bijwerken van de Application Gateway.

Opmerking

Zowel legacy als nieuwe (2022 Predefined of CustomV2) SSL-beleidsregels kunnen niet naast elkaar bestaan op dezelfde gateway. Als clients ciphers nodig hebben die alleen de legacy-beleidsregels bieden, gebruik dan een legacy vooraf gedefinieerd of aangepast beleid over de gateway. Omdat de ondersteuning voor TLS 1.0 en 1.1 op 31 augustus 2025 eindigde, onderhandelen de legacy-beleidsregels niet langer over die versies: de 20150501- en 20170401-voorgedefinieerde beleidsregels zijn stopgezet, en het legacy Custom-beleid ondersteunt alleen TLS 1.2. Voor details, zie TLS-beleidsoverzicht.

In het volgende voorbeeld zijn er codevoorbeelden voor zowel aangepast beleid als vooraf gedefinieerd beleid. Verwijder opmerkingen bij het beleid dat u wilt gebruiken.

# You have to change these parameters to match your environment.
$AppGWname = "YourAppGwName"
$RG = "YourResourceGroupName"

$AppGw = get-Azapplicationgateway -Name $AppGWname -ResourceGroupName $RG

# Choose either custom policy or predefined policy and uncomment the one you want to use.

# TLS Custom Policy
# Set-AzApplicationGatewaySslPolicy -PolicyType Custom -MinProtocolVersion TLSv1_2 -CipherSuite "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_RSA_WITH_AES_128_CBC_SHA256" -ApplicationGateway $AppGw

# TLS Predefined Policy
# Set-AzApplicationGatewaySslPolicy -PolicyType Predefined -PolicyName "AppGwSslPolicy20220101S" -ApplicationGateway $AppGW

# Update AppGW
# The TLS policy options are not validated or updated on the Application Gateway until this cmdlet is executed.
$SetGW = Set-AzApplicationGateway -ApplicationGateway $AppGW

Volgende stappen

Ga naar application Gateway-omleidingsoverzicht voor meer informatie over het omleiden van HTTP-verkeer naar een HTTPS-eindpunt.

Bekijk het instellen van specifieke SSL-beleidsregels voor listener bij het instellen van specifiek SSL-listenerbeleid via de portal