-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Add XFF support to WAF custom rule #28730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add XFF support to WAF custom rule #28730
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this 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:
ClientAddrXFFHeaderandGeoLocationXFFHeaderto theNew-AzApplicationGatewayFirewallCustomRuleGroupByVariablecmdlet - 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 |
src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.ps1
Outdated
Show resolved
Hide resolved
src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.ps1
Outdated
Show resolved
Hide resolved
src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.ps1
Outdated
Show resolved
Hide resolved
src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.ps1
Outdated
Show resolved
Hide resolved
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@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. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@DanielMicrosoft, code is refactored, and test runs are re-recorded. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Adding XFF support to WAF custom rule.
This PR is a successor of this initial PR.
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.