Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| network application-gateway waf-policy managed-rule exception | sub group network application-gateway waf-policy managed-rule exception added |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for managed rule exceptions in application gateway WAF policies by introducing new CLI commands for adding, listing, and removing exceptions.
- Introduces a new test for the exception command in the network module.
- Implements a new custom function to remove WAF managed rule exceptions.
- Updates the commands and help documentation to include the exception commands.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/latest/test_network_commands.py | Adds a new test function for WAF policy exception commands. |
| custom.py | Implements the remove function for managed rule exceptions using an inline class. |
| commands.py | Registers new CLI commands for exception removal and listing under the proper command group. |
| aaz/latest/network/application_gateway/waf_policy/managed_rule/exception/init.py | Sets up module exports for the exception commands. |
| aaz/latest/network/application_gateway/waf_policy/managed_rule/exception/__cmd_group.py | Defines the command group for exception commands. |
| _help.py | Adds help documentation for exception commands. |
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/network/custom.py:2199
- [nitpick] Consider adding a docstring to the nested class 'WAFExceptionRemove' to clarify its purpose and improve maintainability.
class WAFExceptionRemove(Update):
| self.cmd('network application-gateway waf-policy managed-rule exception add -g {rg} --policy-name {waf} ' | ||
| '--match-variable "RequestURI" --value-match-operator "Contains" --values "health" "account/images" "default.aspx" ' | ||
| '--rule-sets [0].rule-set-type=OWASP [0].rule-set-version=3.2') |
There was a problem hiding this comment.
[nitpick] For better readability and maintainability, consider splitting the long command string into multiple lines or using a variable to store the command arguments.
| self.cmd('network application-gateway waf-policy managed-rule exception add -g {rg} --policy-name {waf} ' | |
| '--match-variable "RequestURI" --value-match-operator "Contains" --values "health" "account/images" "default.aspx" ' | |
| '--rule-sets [0].rule-set-type=OWASP [0].rule-set-version=3.2') | |
| exception_args = { | |
| 'match_variable': "RequestURI", | |
| 'value_match_operator': "Contains", | |
| 'values': '"health" "account/images" "default.aspx"', | |
| 'rule_sets': '[0].rule-set-type=OWASP [0].rule-set-version=3.2' | |
| } | |
| self.cmd( | |
| 'network application-gateway waf-policy managed-rule exception add -g {rg} --policy-name {waf} ' | |
| '--match-variable {match_variable} --value-match-operator {value_match_operator} --values {values} ' | |
| '--rule-sets {rule_sets}'.format(**exception_args) | |
| ) |
Related command
az network application-gateway waf-policy managed-rule exception add/list/removeDescription
resolve #31597
aaz Azure/aaz#776
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.