Detect traffic anomalies and auto-mitigate spikes with Azure WAF on Microsoft Azure Front Door
Introduction
Azure WAF on Microsoft Azure Front Door provides a centralized protection solution for your web applications. WAF includes built-in rules to defend against common exploits and vulnerabilities, and custom rules so you can tailor the protection to your specific needs.
Challenge
A popular use-case for custom rules is to rate limit Front Door traffic based on the Country or IP address range. However, configuring the rate limit threshold can sometimes be tricky due to varying traffic patterns based on the time of the day or the day of the week. For example, a rate limit rule created to protect against traffic spikes on a weekend (when the traffic volume is lower) may not fire on a weekday because what's a spike on a weekend might be the usual traffic volume for a weekday.
Solution
It involves two main steps:
- Detect anomalous spikes in traffic
- Automatically add Azure WAF rules to filter out the traffic causing the spike
In the deep-dive video that follows, we do a step-by-step walkthrough of how to perform these steps. The video is structured as follows:
- Introduction
- What anomaly detection is.
- What anomaly detection tools are available in Azure.
- Defining the problem statement
- An overview of the challenge and issue we are trying to solve.
- Exploring the architecture diagram
- An overview of the various components of the system and how they come together to solve the problem.
- Seeing it in action
- Setup:
- Create a WAF policy
- Create a Microsoft Azure Front Door
- Link it to the WAF policy we created in Step (1)
- Define a dynamic threshold alert on the Azure Front Door endpoint
- Create an Azure Function that would run when the alert fires
- Demo:
- Simulate a DDOS (distributed denial of service) attack
- Demonstrate that the attack has started
- Wait for the alert to fire
- Demonstrate that Azure WAF rules to mitigate the attack get auto-generated
- Demonstrate the attack is mitigated after the Azure WAF rules are deployed to the edge
You can find the reference code here.
Published on:
Learn moreRelated posts
Azure Developer CLI (azd) Dec 2025 – Extensions Enhancements, Foundry Rebranding, and Azure Pipelines Improvements
This post announces the December release of the Azure Developer CLI (`azd`). The post Azure Developer CLI (azd) Dec 2025 – Extensions En...
Unlock the power of distributed graph databases with JanusGraph and Azure Apache Cassandra
Connecting the Dots: How Graph Databases Drive Innovation In today’s data-rich world, organizations face challenges that go beyond simple tabl...
Azure Boards integration with GitHub Copilot
A few months ago we introduced the Azure Boards integration with GitHub Copilot in private preview. The goal was simple: allow teams to take a...
Microsoft Dataverse – Monitor batch workloads with Azure Monitor Application Insights
We are announcing the ability to monitor batch workload telemetry in Azure Monitor Application Insights for finance and operations apps in Mic...
Copilot Studio: Connect An Azure SQL Database As Knowledge
Copilot Studio can connect to an Azure SQL database and use its structured data as ... The post Copilot Studio: Connect An Azure SQL Database ...
Retirement of Global Personal Access Tokens in Azure DevOps
In the new year, we’ll be retiring the Global Personal Access Token (PAT) type in Azure DevOps. Global PATs allow users to authenticate across...
Azure Cosmos DB vNext Emulator: Query and Observability Enhancements
The Azure Cosmos DB Linux-based vNext emulator (preview) is a local version of the Azure Cosmos DB service that runs as a Docker container on ...
Azure Cosmos DB : Becoming a Search-Native Database
For years, “Database” and “Search systems” (think Elastic Search) lived in separate worlds. While both Databases and Search Systems oper...