New-AzFrontDoorPolicySettingsObject
Create an in-memory object for PolicySettings.
Syntax
Default (Default)
New-AzFrontDoorPolicySettingsObject
[-CaptchaExpirationInMinutes <Int32>]
[-CustomBlockResponseBody <String>]
[-CustomBlockResponseStatusCode <Int32>]
[-EnabledState <String>]
[-JavascriptChallengeExpirationInMinutes <Int32>]
[-LogScrubbingSetting <IPolicySettingsLogScrubbing>]
[-Mode <String>]
[-RedirectUrl <String>]
[-RequestBodyCheck <String>]
[<CommonParameters>]
Description
Create an in-memory object for PolicySettings.
Examples
Example 1: Create a WAF policy settings object with all parameters
$logScrubbing = New-AzFrontDoorWafLogScrubbingSettingObject -State "Enabled" -ScrubbingRule @()
New-AzFrontDoorPolicySettingsObject -EnabledState "Enabled" -Mode "Prevention" -RequestBodyCheck "Enabled" -CustomBlockResponseStatusCode 403 -CustomBlockResponseBody "PGh0bWw+PGJvZHk+QmxvY2tlZDwvYm9keT48L2h0bWw+" -RedirectUrl "https://www.example.com/blocked" -JavascriptChallengeExpirationInMinutes 30 -LogScrubbingSetting $logScrubbing
CaptchaExpirationInMinutes :
CustomBlockResponseBody : PGh0bWw+PGJvZHk+QmxvY2tlZDwvYm9keT48L2h0bWw+
CustomBlockResponseStatusCode : 403
EnabledState : Enabled
JavascriptChallengeExpirationInMinutes : 30
LogScrubbingSetting : {
}
Mode : Prevention
RedirectUrl : https://www.example.com/blocked
RequestBodyCheck : Enabled
Create a comprehensive WAF policy settings object with prevention mode enabled, custom block response, redirect URL, and log scrubbing configuration.
Parameters
-CaptchaExpirationInMinutes
Defines the Captcha cookie validity lifetime in minutes.
This setting is only applicable to Premium_AzureFrontDoor.
Value must be an integer between 5 and 1440 with the default value being 30.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-CustomBlockResponseBody
If the action type is block, customer can override the response body.
The body must be specified in base64 encoding.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-CustomBlockResponseStatusCode
If the action type is block, customer can override the response status code.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-EnabledState
Describes if the policy is in enabled or disabled state.
Defaults to Enabled if not specified.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-JavascriptChallengeExpirationInMinutes
Defines the JavaScript challenge cookie validity lifetime in minutes.
This setting is only applicable to Premium_AzureFrontDoor.
Value must be an integer between 5 and 1440 with the default value being 30.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-LogScrubbingSetting
Defines rules that scrub sensitive fields in the Web Application Firewall logs.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Mode
Describes if it is in detection mode or prevention mode at policy level.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RedirectUrl
If action type is redirect, this field represents redirect URL for the client.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-RequestBodyCheck
Describes if policy managed rules will inspect the request body content.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs