Skip to content

Conversation

@yoavmal
Copy link
Contributor

@yoavmal yoavmal commented Oct 21, 2025

Description

Adding XFF support to WAF custom rule.
This PR is a successor of this initial PR.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@Copilot Copilot AI review requested due to automatic review settings October 21, 2025 14:57
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for X-Forwarded-For (XFF) header-based rate limiting variables to Azure Application Gateway WAF custom rules. The new variables enable rate limiting based on client IP addresses and geographic locations extracted from XFF headers, which is important for scenarios involving proxies or load balancers.

Key Changes

  • Added two new VariableName options: ClientAddrXFFHeader and GeoLocationXFFHeader to the New-AzApplicationGatewayFirewallCustomRuleGroupByVariable cmdlet
  • Added comprehensive test coverage for the new XFF header variables, including creation and removal scenarios

Reviewed Changes

Copilot reviewed 5 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
NewAzureApplicationGatewayFirewallCustomRuleGroupByVariableCommand.cs Added validation for two new XFF-based variable names in the cmdlet parameter
New-AzApplicationGatewayFirewallCustomRuleGroupByVariable.md Updated help documentation to include the new accepted values
ChangeLog.md Documented the addition of the new variable names
ApplicationGatewayTests.ps1 Added four test functions covering creation and removal scenarios for both new XFF variables
ApplicationGatewayTests.cs Added test method declarations to invoke the new PowerShell test functions

@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@DanielMicrosoft
Copy link
Contributor

@yoavmal do you mind taking a look at the suggestions from Co-pilot to refactor. If not relevant/possible, please mark them as resolved with explanation. Cheers.

@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@yoavmal
Copy link
Contributor Author

yoavmal commented Oct 23, 2025

@DanielMicrosoft, code is refactored, and test runs are re-recorded.

@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@DanielMicrosoft DanielMicrosoft merged commit 6c2dfc0 into Azure:main Oct 23, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants