Skip to content
Lesson 2 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

Correlate WAF rule events with the request outcome

Verify diagnostic collection and table choice, then group rule events by gateway and transaction. A matched-rule row is neither a unique request nor proof of a blocked or failed application transaction.

25 MIN

By AISecurityInterviews · Updated

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

TL;DR: Verify diagnostic collection and table choice, then group rule events by gateway and transaction. A matched-rule row is neither a unique request nor proof of a blocked or failed application transaction.

Where you are. Use the effective policy map to build a trustworthy evidence path before changing a rule.

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.

Establish collection before interpreting silence

Mira reports a failed booking at an agreed time. Ishan first checks whether the training gateway's access and firewall categories are collected into the approved destination. The Azure activity log records administrative events; it cannot substitute for request-level firewall evidence. An empty query can mean the wrong resource, table, time interval, destination or missing collection.

The diagnostic logging guide distinguishes legacy AzureDiagnostics collection from resource-specific tables. This lesson uses AGWFirewallLogs and AGWAccessLogs. Confirm the configured collection type and actual received records before pasting a query. Existing streams do not automatically become equivalent historical data when collection settings change. Review workspace transformations, retention and reader access with the customer because they can remove or restrict relevant evidence.

Microsoft Azure portal diagnostic setting showing log categories and destination choices

Microsoft documentation figure, unmodified. The documentation example shows categories on the left and a Log Analytics destination on the right. It also displays a Performance category that applies to v1, not this WAF_v2 pilot. Inspect current category and collection-type settings; its allLogs and AllMetrics selections are not the collection recommendation for this course. Official source; CC BY 4.0; full-size image. No endorsement is implied.

Use the figure to locate the distinction between what is collected and where it goes. Record both. The following optional read is documented in the diagnostic-settings CLI reference and does not create a logging destination:

az monitor diagnostic-settings list \
  --resource "$REVIEW_GATEWAY_ID" --output json

Preserve the transaction boundary

One request can match several managed rules and then produce a separate anomaly decision. The AGWFirewallLogs schema provides TransactionId, PolicyId, PolicyScope, PolicyScopeName, RuleId, Action and the gateway _ResourceId. Retain the resource and transaction together. A transaction value copied from another gateway is not an acceptable join key by itself.

The AGWAccessLogs schema provides the corresponding transaction identifier, HTTP status, listener and routing-rule context. Use a bounded UTC interval and one approved gateway. The original query below summarizes rule rows; it deliberately omits matched request content, URLs and client addresses from the working summary.

AGWFirewallLogs
| where TimeGenerated >= datetime(2026-11-01T10:00:00Z)
| where TimeGenerated < datetime(2026-11-01T10:15:00Z)
| where _ResourceId =~ "<approved-gateway-resource-id>"
| summarize RuleRows=count(), Rules=make_set(RuleId),
    Actions=make_set(Action) by _ResourceId, TransactionId, PolicyId

The dates are fictional fixtures, not a query of current customer traffic. This is documentation-checked KQL, not an executed workspace result. Run only within the customer's approved query and cost boundary. Resource-specific table access and query capabilities must exist in that workspace. For a legacy table, use its documented schema instead of renaming fields by guesswork.

Distinguish each result from its explanation

A Matched row says a particular rule matched part of a request. A Blocked decision identifies enforcement in its documented context. An HTTP error alone does not identify the WAF as its source. Conversely, a successful HTTP response does not establish that the booking was accepted correctly by the application. Mira supplies the business outcome; Owen supplies gateway context; Ishan preserves the rule and decision sequence.

Some detailed fields can contain fragments of user input. Keep raw records in the restricted customer store and use redacted identifiers for discussion. Do not copy authentication material, personal data or full request bodies into a ticket merely to prove the query ran. Evidence minimization must preserve the correlation keys and relevant decision, not discard the whole record.

Count requests rather than rows

The offline exercise supplies three firewall rows for two requests and one unrelated access row using a repeated transaction label. Its composite join avoids that unrelated row. It is an evidence exercise, not an Azure log parser; production normalization, duplicates, timestamp windows and missing records still need review.

A defensible handover states the selected gateway, time interval, table, query, received transaction evidence and unresolved application outcome. If the access record is missing, retain that gap. Do not manufacture an allowed or blocked result from the number of rule matches. The next lesson explains why rule order and policy mode can produce apparently contradictory rows.

AZURE WAF · OPERATIONS
Join a request outcome without counting every match as a request

Collection

Categories, destination and table

Rule observations

Many rows may share one transaction

Scoped correlation

Gateway plus transaction and time

Customer outcome

Gateway decision and application result

firewall = [
    ('gw-a', 'tx-1', 'Matched'),
    ('gw-a', 'tx-1', 'Blocked'),
    ('gw-a', 'tx-2', 'Matched'),
]
access = {('gw-a', 'tx-1'): 403, ('gw-a', 'tx-2'): 200,
          ('gw-b', 'tx-1'): 200}
requests = {}
for gateway, transaction, action in firewall:
    key = (gateway, transaction)
    requests.setdefault(key, set()).add(action)

assert len(firewall) == 3 and len(requests) == 2
assert access[('gw-a', 'tx-1')] == 403
assert requests[('gw-a', 'tx-2')] == {'Matched'}
assert ('gw-b', 'tx-1') not in requests
missing = set(requests) - set(access)
assert missing == set()
print(len(requests), len(missing))

Do this before moving on

Produce a two-request incident worksheet from the supplied rows. Record the query boundary and application-outcome gap. Remove one access record, rerun the missing-record calculation, and explain why neither a row count nor an HTTP status alone proves a false positive.

Go deeper

Key takeaways

  • Verify collection, destination and schema before interpreting query results.
  • Group rule events by resource and transaction within a bounded interval.
  • Keep rule matches, enforcement decisions and application outcomes distinct.

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. 1Three firewall rows share one gateway and transaction. How many requests do they establish?

  2. 2The firewall query is empty and diagnostic collection is unverified. What is the next conclusion?

Sign in to track which lessons you have finished.