feat(terraform): add the Azure waf module - #14104
Merged
Merged
Conversation
This was referenced Aug 19, 2026
Contributor
Greptile SummaryThe PR adds a regional Azure Application Gateway WAF policy module mirroring the AWS WAF module.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
Input[Module inputs] --> Validation[Input validation]
Validation --> Policy[Application Gateway WAF policy]
Policy --> Managed[OWASP and optional Bot Manager rules]
Policy --> Custom[Allowlist, geo block, and rate limits]
Policy --> Output[Policy ID and mode outputs]
Output --> Gateway[Application Gateway attachment]
Reviews (2): Last reviewed commit: "feat(terraform): add the Azure waf modul..." | Re-trigger Greptile |
Contributor
There was a problem hiding this comment.
2 issues found across 5 files
Confidence score: 3/5
- In
deployment/terraform/modules/azure/waf/main.tf, overrides for unsupported or disabled rule sets are silently ignored, leaving the managed rule unchanged; validate every override target and fail when it cannot be applied. - In
deployment/terraform/modules/azure/waf/outputs.tf, the resource is an Application Gateway WAF policy but is described as a Front Door firewall policy, which can mislead users about what is provisioned; correct the description or add separate Front Door configuration.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="deployment/terraform/modules/azure/waf/main.tf">
<violation number="1" location="deployment/terraform/modules/azure/waf/main.tf:44">
P2: When an override targets an unsupported or disabled rule set, this `try` silently drops it and leaves the managed rule unchanged. Validate every override target and fail when an override cannot be applied.</violation>
</file>
<file name="deployment/terraform/modules/azure/waf/outputs.tf">
<violation number="1" location="deployment/terraform/modules/azure/waf/outputs.tf:2">
P2: This resource creates an Application Gateway WAF policy, not a Front Door firewall policy. Remove Front Door from this description or provide a separate Front Door firewall and security-policy configuration.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
justin-tahara
force-pushed
the
jtahara/azure-tf-waf
branch
from
August 19, 2026 22:47
cccfb6a to
f2e9a4f
Compare
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
justin-tahara
force-pushed
the
jtahara/azure-tf-waf
branch
from
August 19, 2026 23:14
f2e9a4f to
41e520c
Compare
justin-tahara
force-pushed
the
jtahara/azure-tf-waf
branch
from
August 19, 2026 23:31
41e520c to
226cd2b
Compare
jmelahman
approved these changes
Aug 20, 2026
justin-tahara
force-pushed
the
jtahara/azure-tf-waf
branch
from
August 20, 2026 21:06
226cd2b to
ff4d726
Compare
Contributor
|
Preview Deployment
|
justin-tahara
force-pushed
the
jtahara/azure-tf-waf
branch
from
August 20, 2026 21:12
ff4d726 to
c9657a0
Compare
Mirrors deployment/terraform/modules/aws/waf. The policy is regional, the same scope the AWS web ACL uses, and attaches to an Application Gateway or a Front Door route. The rule inventory collapses. Where AWS composes four managed rule groups, the OWASP Core Rule Set covers the common, known-bad-inputs and SQL injection groups on its own, and the Microsoft bot manager set stands in for the anonymous IP list. Two rate limits and the optional allowlist and geo block stay as custom rules, counting per client address over five minutes as before. Three differences to know when reading this against the AWS module: - Detection mode replaces overriding every managed rule to COUNT, and is the way to see what a new policy would do before it does it. Individual rules still have overrides, but Azure identifies them by group and numeric id rather than by name. - Rate limit exemptions are a second, negated match condition rather than a scope-down statement. Conditions on a rule are combined with AND, so the effect is the same. - There is no log group here. Azure emits WAF logs from the Application Gateway or Front Door the policy attaches to, so the diagnostic setting belongs on that resource rather than on the policy.
justin-tahara
force-pushed
the
jtahara/azure-tf-waf
branch
from
August 20, 2026 21:20
c9657a0 to
67abf8b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Mirrors
deployment/terraform/modules/aws/waf. The policy is regional — the same scope the AWS web ACL uses — and attaches to an Application Gateway or a Front Door route.The rule inventory collapses. Where AWS composes four managed rule groups, the OWASP Core Rule Set covers the common, known-bad-inputs and SQL injection groups on its own, and the Microsoft bot manager set stands in for the anonymous IP list. Two rate limits and the optional allowlist and geo block stay as custom rules, counting per client address over five minutes as before.
Three differences to know when reading this against the AWS module:
How Has This Been Tested?
The suite covers rule priority ordering, the negated allowlist condition, the exemption landing on both rate limits, regrouping a flat override list into nested group overrides, and three input validations.
terraform validateand the repo's terraform hooks pass. Not applied against a live subscription.Additional Options
Changes from review (greptile, cubic)
rule_set_type, or targeting the bot manager set whileenable_bot_protectionis false, was silently dropped — leaving the rule doing exactly what the operator meant to change. Both are now rejected at plan.azurerm_cdn_frontdoor_firewall_policyand cannot take this one. The output description now says so rather than pointing people at an integration that does not exist.Tests: 11 → 14.
Round 2
Tests: 14 → 16.