Back to controls

Ensure Application Gateway WAF is enabled in Prevention mode

Detection-only mode provides visibility but does not block attacks. Prevention mode is required for stronger protection on internet-facing workloads.

Category

Controls

High

Applies to

Microsoft Azure

Coverage

1 queries

Asset types

1 covered

Overview

Detection-only mode provides visibility but does not block attacks. Prevention mode is required for stronger protection on internet-facing workloads.

Remediation guidance

Azure Remediation

Service-wide fix (recommended): require a WAF policy on internet-facing Application Gateways and standardize a controlled move from Detection to Prevention after tuning exclusions and custom rules.

When to use service-wide remediation

Use the service-wide path when many gateways are affected or when teams create gateways without a standard WAF policy.

Azure portal

  1. Open the Application Gateway.
  2. Associate an existing WAF policy, or create one if none exists.
  3. Review false positives, exclusions, and any required custom rules.
  4. Set the WAF mode to Prevention.
  5. Confirm diagnostic logging is enabled so blocked requests are still visible during operations.

Azure CLI

Set the WAF policy mode to Prevention:

az network application-gateway waf-policy policy-setting update \
  --resource-group <resource-group> \
  --policy-name <waf-policy-name> \
  --mode Prevention

Validate the policy mode:

az network application-gateway waf-policy policy-setting list \
  --resource-group <resource-group> \
  --policy-name <waf-policy-name>

Operational notes

  • Microsoft recommends running a new WAF briefly in Detection mode first so you can tune exclusions before enforcing blocks in production.
  • If a gateway has no WAF policy attached, fixing only the mode is not enough. You must first attach a valid WAF policy.

References

  • https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/ag-overview
  • https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/policy-overview
  • https://learn.microsoft.com/en-us/cli/azure/network/application-gateway/waf-policy/policy-setting?view=azure-cli-lts

Query logic

These are the stored checks tied to this control.

Application gateways without WAF prevention mode

Connectors

Microsoft Azure

Covered asset types

ApplicationGateway

Expected check: eq []

{ applicationGateways(where: { OR: [ { wafEnabled: false }, { wafMode_NOT: "Prevention" } ] }) { ...AssetFragment } }
Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon