Set-​Azure​Rm​Application​Gateway​Web​Application​Firewall​Configuration

Modifies the WAF configuration of an application gateway.

Syntax

Set-AzureRmApplicationGatewayWebApplicationFirewallConfiguration
   -ApplicationGateway <PSApplicationGateway>
   [-DisabledRuleGroups <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayFirewallDisabledRuleGroup]>]
   -Enabled <Boolean>
   -FirewallMode <String>
   [-RuleSetType <String>]
   [-RuleSetVersion <String>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

The Set-AzureRmApplicationGatewayWebApplicationFirewallConfiguration cmdlet modifies the web application firewall (WAF) configuration of an application gateway.

Examples

Example 1: Update the application gateway web application firewall configuration

PS C:\> $AppGw = Get-AzureRmApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
PS C:\> Set-AzureRmApplicationGatewayWebApplicationFirewallConfiguration -ApplicationGateway $AppGw -Enabled $True -FirewallMode "Detection" -RuleSetType "OWASP" -RuleSetVersion "3.0"

The first command gets the application gateway named ApplicationGateway01 and then stores it in the $AppGw variable.

The second command enables the firewall configuration for the application gateway stored in $AppGw and sets the firewall mode to "Detection", RuleSetType to "OWASP" and the RuleSetVersion to "3.0".

Required Parameters

-ApplicationGateway

Specifies an application gateway object. You can use the Get-AzureRmApplicationGateway cmdlet to get an application gateway object.

Type:PSApplicationGateway
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Enabled

Indicates whether the web application firewall is enabled.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-FirewallMode

Specifies the web application firewall mode. The acceptable values for this parameter are:

  • Detection
  • Prevention
Type:String
Parameter Sets:Detection, Prevention
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisabledRuleGroups

The disabled rule groups.

Type:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayFirewallDisabledRuleGroup]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RuleSetType

The type of the web application firewall rule set. The acceptable values for this parameter are:

  • OWASP
Type:String
Parameter Sets:OWASP
Position:Named
Default value:OWASP
Accept pipeline input:False
Accept wildcard characters:False
-RuleSetVersion

The version of the rule set type. The acceptable values for this parameter are:

  • 3.0
  • 2.2.9
Type:String
Parameter Sets:3.0, 2.2.9
Position:Named
Default value:3.0
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.Azure.Commands.Network.Models.PSApplicationGateway