Azure Application Gateway Web Application Firewall (WAF)

The Azure Web Application Firewall (WAF) on Application Gateway provides centralized protection to your web applications from common exploits and vulnerabilities such as SQL injection, cross-site scripting, and other web attacks. It is a managed service that shields your web applications from attacks by inspecting incoming HTTP requests.

What is WAF?

WAF is a type of firewall that filters, monitors, and blocks HTTP traffic to and from a web application. It helps protect your applications by understanding traffic between web applications and the internet. WAF can detect and block malicious HTTP requests, and prevent unauthorized data exfiltration. It can also help you achieve compliance with web application security requirements.

Key Features

WAF Modes

Application Gateway WAF supports two main modes:

Detection Mode

In detection mode, WAF logs malicious requests but does not block them. This mode is useful for understanding the types of attacks your applications are facing without impacting legitimate traffic. You can review the WAF logs to fine-tune your WAF policies.

Prevention Mode

In prevention mode, WAF actively blocks traffic that matches its rules. When a malicious request is detected, WAF returns a 403 Forbidden response to the client.

Application Gateway WAF Architecture

Conceptual diagram of Application Gateway WAF.

Configuring WAF

Configuring WAF involves creating or updating an Application Gateway resource with a WAF policy. Here are the general steps:

  1. Create a WAF Policy: Define your WAF rules, managed rule sets, and custom rules.
  2. Associate WAF Policy with Application Gateway: Link the WAF policy to your Application Gateway's listener.
  3. Configure Diagnostic Settings: Enable logging for WAF events to Azure Monitor or Azure Storage for analysis.

Example of a Custom Rule (Conceptual)


{
  "if": {
    "operator": "Contains",
    "matchVariable": "RequestUri",
    "selector": null,
    "values": ["/admin/login"]
  },
  "then": {
    "effect": "Block"
  }
}
            

Benefits of Using WAF

Important: Regularly review and update your WAF rules and managed rulesets to ensure protection against the latest threats.

Learn More

This page provides a high-level overview of Azure Application Gateway WAF. For detailed configuration and advanced features, please refer to the official Azure documentation.