Skip to content
Lesson 1 of 80 completed · Sign in to track completionCourse overview →Glossary ↗
Course contents · Find the enforcement boundary
  1. 1. Resolve the WAF policy that actually applies to a requestFree
  2. 2. Correlate WAF rule events with the request outcomeFree
  3. 3. Explain custom-rule precedence and managed-rule decisionsFree account
  4. 4. Bound a false-positive exclusion to the field and rulePremium
  5. 5. Verify body inspection independently from request admissionPremium
  6. 6. Promote a WAF pilot using an explicit acceptance matrixPremium
  7. 7. Review rule-set changes as changes to inspection behaviorPremium
  8. 8. Hand over a recoverable WAF policy with explicit evidence gapsPremium

Resolve the WAF policy that actually applies to a request

Trace the gateway, listener and matching path rule before inspecting a WAF policy. More specific associations override broader ones, so an enabled gateway policy alone cannot prove a route is inspected.

25 MIN

By AISecurityInterviews · Updated

Keep a return link on this browser. No account needed.

TL;DR: Trace the gateway, listener and matching path rule before inspecting a WAF policy. More specific associations override broader ones, so an enabled gateway policy alone cannot prove a route is inspected.

Where you are. Establish the application and policy boundary for the fictional Marshfield Tickets pilot.

Reference and lab. Azure Application Gateway WAF_v2 with an existing full WAF policy and Microsoft Default Rule Set 2.2; public Microsoft documentation checked November 2026. Older CRS screenshots are labelled separately. Marshfield Tickets and every exercise record are fictional. Python runs offline. Optional console inspections and read-only command templates require an explicitly authorized isolated Azure environment; no Azure account or traffic tests were operated during authoring.

Start with the customer route

Marshfield Tickets accepts bookings and supporting documents. Mira owns the application, Owen owns the application gateway, and Ishan operates the provider's security review. An attacker can send unauthenticated HTTP requests to the public application. The WAF examines requests at that boundary; application authorization, input handling and backend access restrictions remain separate controls.

Their assignment covers an existing isolated training gateway and two approved application paths. It excludes other subscriptions and any change to public production routing. Owen supplies the subscription, resource group, gateway resource ID, listener, routing rule, path map and policy IDs. Ishan records the inspecting principal and observation time. A friendly display name is insufficient when customers reuse names across subscriptions.

Microsoft diagram showing Application Gateway WAF before layer-seven load balancing to two sites

Microsoft documentation figure, unmodified. This conceptual diagram locates inspection before the backend sites. Its accepted and rejected arrows illustrate intended behavior, not measured detection coverage or proof that backend access is restricted. Official source; CC BY 4.0; full-size image. No endorsement is implied.

Follow the incoming arrow through WAF and the layer-seven load balancer. Then ask which listener and path the actual training request selects. The diagram does not answer that configuration question. The policy association guide establishes the next step: resolve the most specific applicable policy.

Resolve precedence without merging policies

Application Gateway WAF_v2 supports gateway-wide, listener and path-rule associations. A listener policy overrides the gateway policy for that listener. A policy attached to the matching path rule overrides both. These are effective-policy choices, not three layers whose exclusions and rule sets accumulate.

Selected request routeApplicable associationRequired inspection
Listener without a more specific policyGateway policyIts state, mode and complete settings
Listener with its own policyListener policyIts settings, independently of the gateway policy
Path rule with its own policyPath policyIts settings and all other routes sharing it

A policy may be shared by several associations. Changing it for one reported false positive can affect every associated route. List those consumers before proposing an edit. Also distinguish a full WAF policy from legacy settings stored directly on a gateway or an older custom-rules-only policy. The policy creation and migration guide explains these states. Stop and document a migration dependency when the customer's state does not match this course.

Inspect state and mode separately

An associated policy must be Enabled to inspect traffic, record rule events and take configured action. Detection mode records triggered rules without prevention enforcement. Prevention mode can enforce configured actions; a Log override or custom Allow still changes the result. Neither association nor the word Prevention establishes that every request body is inspected.

Use the existing portal association views to record the effective policy and its consumers. The following documentation-checked reads provide an independent configuration observation. Replace variables only with approved resource IDs; inspect the authenticated tenant first. These commands were not run against Azure.

az network application-gateway show \
  --ids "$REVIEW_GATEWAY_ID" --output json
az network application-gateway waf-policy show \
  --ids "$REVIEW_POLICY_ID" --output json

The gateway CLI reference and WAF policy CLI reference document both reads. Review the gateway's association objects as well as the policy settings. Keep the complete observations in the customer's restricted evidence store; a public worksheet needs only fictional identifiers and selected conclusions.

Make the boundary reproducible

The offline model receives already-resolved association candidates. It chooses path, then listener, then gateway. It does not implement HTTP routing, wildcard path matching, Azure permissions or provisioning. A missing route-resolution step must stay missing evidence; passing a guessed path policy into the function cannot establish the real association.

For the pilot, Mira identifies representative booking and upload transactions. Owen verifies their routing. Ishan records the resulting policy IDs and checks policy state, mode and sharing. If they disagree, resolve the configuration before tuning rules. Later lessons attach every log observation and change proposal to this same boundary.

AZURE WAF · OPERATIONS
Resolve one effective policy before interpreting results

Approved request

Customer route and time

Route selection

Gateway, listener and path

Effective policy

Most specific association

Inspection contract

State, mode and shared consumers

def effective_policy(gateway, listener=None, path=None):
    for policy in (path, listener, gateway):
        if policy is not None:
            return policy
    raise ValueError('No policy association established')

assert effective_policy('base') == 'base'
assert effective_policy('base', 'booking') == 'booking'
assert effective_policy('base', 'booking', 'upload') == 'upload'
assert effective_policy('base', None, 'upload') == 'upload'
try:
    effective_policy(None)
except ValueError:
    pass
else:
    raise AssertionError('An unbound route must not be accepted')
print(effective_policy('base', 'booking', 'upload'))

Do this before moving on

Draw the two approved training routes and record each effective policy. Give one route a path policy in the supplied worksheet. Explain which gateway-policy changes would no longer affect that route, and name every other consumer that a change to its effective policy could affect.

Go deeper

Key takeaways

  • Resolve the most specific association before reviewing policy settings.
  • Check Enabled state independently from Detection or Prevention mode.
  • Record every consumer of a shared policy before changing it.

Check yourself

Say or write your answer first, then reveal. Explaining it from memory, in your own words, is the skill an interviewer is checking.

  1. 1A path policy is associated below a listener policy. Which policy should the reviewer inspect for that path?

  2. 2The right policy is associated but Disabled. What does this establish?

Sign in to track which lessons you have finished.