Networking Application security premium field-manual operator-field-manual

Web Application Firewall

A Web Application Firewall is a protective inspection layer for web traffic before it reaches an application. It looks for patterns that commonly appear in attacks, such as SQL injection, cross-site scripting, protocol abuse, or suspicious bots. In Azure, WAF is attached to entry points like Application Gateway or Front Door, not placed inside the application code. Operators use policies, managed rule sets, exclusions, custom rules, and detection or prevention modes to reduce risk while still letting legitimate users through.

Aliases
WAF, Azure WAF, Application Gateway WAF, Front Door WAF
Difficulty
fundamentals
CLI mappings
6
Last verified
2026-05-29

Microsoft Learn

Azure Web Application Firewall is a centralized protection service for HTTP applications. It can run with Application Gateway, Front Door, Application Gateway for Containers, or Azure CDN, using managed and custom rules to detect and block common exploits such as SQL injection and cross-site scripting.

Microsoft Learn: Introduction to Azure Web Application Firewall2026-05-29

Technical context

Technically, Azure WAF sits in the network and application delivery path. Application Gateway WAF protects regional Layer 7 ingress, while Front Door WAF protects global edge entry points. A WAF policy contains managed rules, custom rules, exclusions, request body limits, logging, and mode settings. It affects data-plane HTTP and HTTPS traffic, but policy resources, associations, diagnostics, and RBAC are managed through the Azure control plane. Monitoring depends on diagnostic logs, metrics, Application Gateway access logs, Front Door logs, and incident response queries.

Why it matters

WAF matters because most public web attacks arrive through normal-looking HTTP requests, not exotic network paths. Without a centralized inspection layer, every application team must patch, validate, and defend the same classes of input attacks on its own. A well-tuned WAF gives security teams a control point for emergency rule changes, compliance evidence, and consistent protection across apps. It also gives operations teams logs that explain blocked requests and false positives. The business value is practical: fewer emergency code changes, lower breach probability, faster vulnerability response, and a cleaner boundary between internet traffic and application code when applications are patched on different release schedules.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

In Azure portal WAF policy blades, engineers see mode, managed rule sets, custom rules, exclusions, associated gateways or Front Door profiles, and recent diagnostic configuration before approving changes.

Signal 02

In Log Analytics or Microsoft Sentinel, WAF logs show matched rule IDs, actions, hostnames, request paths, client IPs, and messages that explain blocked or allowed suspicious traffic.

Signal 03

In ARM or Bicep templates, WAF appears as policy resources and associations, making rule configuration, listener attachment, and environment drift visible during code review and approval.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Protect internet-facing apps from common OWASP attack patterns without changing every application codebase.
  • Apply emergency virtual patching for a newly disclosed web vulnerability while application teams prepare fixes.
  • Centralize ingress security for multiple regional apps behind Application Gateway or global apps behind Front Door.
  • Review false positives safely by starting rules in detection mode before enforcing prevention on critical flows.
  • Produce compliance evidence showing managed rules, custom rules, exclusions, and blocked-request logs for protected endpoints.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Flash-sale booking platform blocks attack traffic

A travel booking marketplace exposed hotel search and checkout APIs through several regional gateways. During flash-sale events, scripted tr

Scenario

A travel booking marketplace exposed hotel search and checkout APIs through several regional gateways. During flash-sale events, scripted traffic triggered payment errors and suspicious injection attempts.

Business/Technical Objectives
  • Block high-risk HTTP attack patterns before they reached checkout services.
  • Reduce payment failure spikes during flash-sale traffic.
  • Keep security changes centralized across regional application gateways.
  • Give incident responders rule-match evidence within minutes.
Solution Using Web Application Firewall

Architects attached Azure Web Application Firewall policies to the Application Gateways serving the search and checkout APIs. Managed rules were first run in detection mode against a replay of sale traffic so login, coupon, and payment payloads could be reviewed for false positives. The team then moved selected policies to prevention, added narrow exclusions for one partner callback path, and created custom rules for suspicious headers used by scraping tools. WAF diagnostics flowed to Log Analytics, where security engineers built queries for rule ID, hostname, client IP, and checkout correlation ID. Release pipelines exported policy JSON before every change so rollback was a command, not a meeting.

Results & Business Impact
  • Checkout 5xx spikes during sale windows fell from 3.8 percent to 0.6 percent.
  • Security triage time for suspicious HTTP traffic dropped from two hours to fifteen minutes.
  • False-positive refunds fell by 42 percent after path-specific exclusions replaced broad rule disables.
  • Regional policy drift was eliminated across six gateways by using the same approved baseline.
Key Takeaway for Glossary Readers

A WAF policy is most valuable when it blocks real attack paths while giving operators enough evidence to tune safely.

Case study 02

Public utility uses virtual patching for a portal flaw

A public utility discovered that an older customer portal plugin was vulnerable to crafted form submissions. The development fix needed two

Scenario

A public utility discovered that an older customer portal plugin was vulnerable to crafted form submissions. The development fix needed two release cycles because billing integrations shared the same code path.

Business/Technical Objectives
  • Reduce exposure immediately without shutting down customer self-service.
  • Avoid breaking payment, outage-reporting, and meter-reading forms.
  • Create compliance evidence for emergency mitigation.
  • Remove the temporary control after the application fix shipped.
Solution Using Web Application Firewall

The security team placed Azure Web Application Firewall on the Application Gateway that fronted the portal. They enabled the relevant managed rules in detection mode, then tested real form submissions from payment, outage, and meter-reading flows. After confirming the vulnerable pattern was visible in WAF logs, they enabled prevention for the affected rule group and added one narrow exclusion for a legacy meter-reading field that matched a rule incorrectly. Sentinel workbooks tracked blocked requests, affected URLs, and whether any customer-facing form returned abnormal errors. The change ticket required the exclusion to expire after the plugin patch reached production.

Results & Business Impact
  • Exploit attempts were blocked within four hours of vulnerability confirmation.
  • Customer form completion stayed above 98.7 percent during the mitigation window.
  • The audit packet included rule IDs, timestamps, URLs, and reviewer approval instead of screenshots.
  • The temporary exclusion was removed six days later with zero repeat findings.
Key Takeaway for Glossary Readers

WAF can buy time during a real vulnerability response, but only if exclusions are narrow, logged, and retired.

Case study 03

Manufacturing SaaS consolidates partner ingress protection

A manufacturing SaaS provider hosted separate partner portals for suppliers, logistics brokers, and plant supervisors. Each product team had

Scenario

A manufacturing SaaS provider hosted separate partner portals for suppliers, logistics brokers, and plant supervisors. Each product team had tuned ingress security differently, causing inconsistent blocks and audit friction.

Business/Technical Objectives
  • Standardize web protection across partner-facing portals.
  • Preserve different custom rules for supplier and logistics traffic.
  • Reduce audit preparation time for ingress controls.
  • Improve visibility into blocked traffic before partner escalations.
Solution Using Web Application Firewall

The platform group created a shared Azure Web Application Firewall baseline and attached it to Front Door routes for all partner portals. Managed rule versions, request limits, and default prevention mode were standardized, while route-specific custom rules handled supplier upload paths and logistics webhook signatures. Diagnostics were sent to a central workspace with saved queries per partner category. Product teams could request exclusions only through a pull request that included sample WAF log entries and an owner-approved expiry date. The team kept Application Gateway WAF for one private regional portal, but aligned its rule version and logging pattern with the Front Door policies.

Results & Business Impact
  • Audit evidence collection shrank from three weeks to four days.
  • Partner escalations about unexplained blocked requests dropped by 57 percent.
  • Custom rule reviews found and removed eleven stale allow rules from old integrations.
  • Security could identify the affected route and partner class in under five minutes.
Key Takeaway for Glossary Readers

Centralized WAF design lets teams share a strong baseline while still handling application-specific traffic safely.

Why use Azure CLI for this?

I use Azure CLI for WAF work because policy drift is hard to see from portal clicks. After ten years of Azure incidents, I want a repeatable way to list policies, show mode, inspect managed rule sets, export custom rules, and compare gateway or Front Door associations across environments. CLI output can be committed as evidence, checked by pipeline gates, and queried during an active attack without waiting for screens to load. It also makes dangerous changes obvious because the command includes the policy, resource group, scope, and action. For WAF, that repeatability is the difference between tuning and guessing.

CLI use cases

  • List WAF policies and confirm which gateway or Front Door entry point is using each policy.
  • Show a policy mode, managed rule sets, custom rules, and exclusions before changing enforcement.
  • Create or update a WAF policy in infrastructure automation for repeatable ingress builds.
  • Export WAF policy JSON for review, drift comparison, and audit evidence.
  • Check diagnostic settings and logs when investigating a blocked request or false positive.

Before you run CLI

  • Confirm tenant, subscription, resource group, WAF policy name, gateway or Front Door association, and target environment.
  • Verify RBAC because WAF policy updates can immediately change production traffic handling.
  • Check whether the policy is in detection or prevention mode before adding rules or exclusions.
  • Review existing diagnostic settings so you can prove whether a rule change worked.
  • Export current policy JSON before modifying managed rules, custom rules, exclusions, or associations.

What output tells you

  • Policy output shows mode, managed rule sets, custom rules, exclusions, request body limits, and resource identity.
  • Association fields show whether a policy is attached to the expected Application Gateway or edge route.
  • Managed rule details identify rule groups and versions that affect false-positive review and compliance evidence.
  • Diagnostic settings show whether blocked-request evidence is flowing to Log Analytics, storage, or Event Hubs.
  • Resource IDs and locations confirm whether you are changing the intended production or nonproduction policy.

Mapped Azure CLI commands

WAF policy inspection and change commands

direct
az network application-gateway waf-policy list --resource-group <resource-group> --output table
az network application-gateway waf-policydiscoverSecurity
az network application-gateway waf-policy show --name <policy-name> --resource-group <resource-group>
az network application-gateway waf-policydiscoverNetworking
az network application-gateway waf-policy create --name <policy-name> --resource-group <resource-group> --location <region>
az network application-gateway waf-policyprovisionNetworking
az network application-gateway waf-policy policy-setting list --policy-name <policy-name> --resource-group <resource-group>
az network application-gateway waf-policy policy-settingdiscoverNetworking
az network application-gateway waf-policy policy-setting update --policy-name <policy-name> --resource-group <resource-group> --mode Prevention
az network application-gateway waf-policy policy-settingconfigureNetworking
az monitor diagnostic-settings list --resource <resource-id> --output table
az monitor diagnostic-settingsdiscoverMonitoring and Observability

Architecture context

Architecturally, WAF belongs at the application ingress boundary. For regional applications, it often sits on Application Gateway in a hub or workload virtual network, close to private backends and route control. For internet-scale or multi-region apps, it often sits on Front Door at the Microsoft edge before traffic reaches regional origins. The WAF policy should be designed separately from listener or route plumbing so security teams can tune rules without rebuilding ingress. Mature designs connect WAF logs to Sentinel or Log Analytics, use managed rules as a baseline, add custom rules for business-specific abuse, and document exclusions by application endpoint.

Security

Security impact is direct because WAF evaluates incoming HTTP requests before application code handles them. Use prevention mode for enforceable protection after testing, keep managed rule sets current, and document exclusions so teams do not quietly disable important checks. Custom rules can block known bad IP ranges, geographies, headers, methods, or request patterns, but they must be reviewed for bypass risk. RBAC should separate policy authors from application deployers where possible. Logs can contain client IPs, paths, headers, and rule matches, so retention and access should follow privacy and incident-response requirements. Access reviews should include policy authors, readers, and diagnostic log consumers.

Cost

WAF has direct and indirect cost impact. Application Gateway and Front Door pricing include capacity, requests, data processed, routing, and WAF policy usage depending on the chosen service. More rule evaluation, higher traffic, detailed diagnostics, and long log retention all add cost. False positives also cost people time because support, developers, and security must review blocked requests. On the other hand, one shared WAF policy can reduce duplicated controls across many apps. FinOps review should connect WAF spend to protected applications, traffic volume, diagnostic retention, and the cost of emergency mitigation if the protection is absent. Chargeback tags should identify shared policy beneficiaries clearly.

Reliability

Reliability depends on tuning WAF without blocking valid users. A strict managed rule can break login, upload, checkout, API, or webhook flows if the application legitimately sends payloads that resemble attack patterns. Start risky changes in detection mode, review log samples, then move to prevention with a rollback path. Design health probes and origin routing so WAF policy changes do not hide backend failures. For Front Door, consider multi-region origin behavior; for Application Gateway, consider zone redundancy and capacity. During incidents, throttling, custom blocks, or emergency exclusions should be applied carefully to reduce blast radius, not widen it. Load tests should include the final WAF policy.

Performance

Performance impact is usually modest but real because every inspected request passes through rule evaluation before reaching the backend. Large request bodies, complex custom rules, bot traffic, TLS handling, and high request rates can increase latency or capacity needs. Application Gateway WAF sizing should be tested with production-like payloads, while Front Door WAF should be validated from user regions and origin paths. WAF can improve perceived performance during attacks by blocking abusive traffic before it consumes backend capacity. Operators should watch latency, failed requests, capacity units, WAF match volume, and backend health after policy changes. Baseline before and after every material rule change.

Operations

Operators manage WAF by inspecting policy associations, mode, rule groups, exclusions, custom rules, diagnostics, and recent match logs. Common work includes moving from detection to prevention, suppressing a false positive for one path, adding an emergency block rule, confirming a gateway uses the expected policy, and exporting evidence for auditors. Troubleshooting starts with request IDs, WAF log categories, rule IDs, action, hostname, path, and backend response patterns. Changes should be ticketed because a small exclusion can weaken many applications. Good operations teams keep a tested query pack for blocked requests, top rules, and false-positive review. Runbooks should name policy owners and escalation channels.

Common mistakes

  • Turning on prevention mode in production without reviewing detection logs for key login, checkout, upload, and API paths.
  • Creating broad exclusions that silence an entire managed rule group instead of narrowing the affected field and path.
  • Assuming Application Gateway WAF and Front Door WAF policies have identical features and operational behavior.
  • Changing a shared WAF policy without checking every listener, route, hostname, or application using it.
  • Keeping WAF logs disabled, which makes false positives and real attacks nearly impossible to investigate quickly.