Right now our application is running behind this front door. We can put a Web Application Firewall in front of the Front Door.
Click Create a resource and search for Web Application Firewall. Click Create.
We are creating the policy for Front Door. Choose the resource group. Then give the name policy a name and go to the policy settings.
In this setting, you can select what happens when a request is blocked. We are going to choose prevention. Prevention blocks the attack while detection just logs them.
Next is a list of rules that the WAF protects us against. The list is quite comprehensive. If you scroll down, you will find that there are rules for Cross Site Scripting, SQL injection, Bot protection and many more. You can scroll down and check by yourself.
Next, you can configure custom rules. It can things like IP filters, filters on geo location, also on the type and size of the request. Click Next.
Here we are going to add our frontend host. Select the front door and choose the host. Finally, click review + create.
Now when you try to run the URL, your request will get blocked.
The page title will also change. This request isn’t even reaching the application. It has been blocked at the edge of Azure by Web Application Firewall before it can do any harm.