Post

Azure Application Gateway with WAF

Azure Application Gateway is a Layer 7 (HTTP/HTTPS) load balancer that sits at the front of our application, accepts internet traffic on a public IP, and routes it to backend servers based on listener and routing rules. The Web Application Firewall (WAF) adds security by inspecting requests for common web attacks (SQL injection, XSS, OWASP threats) before forwarding clean traffic to the backend pool.

x


Application Gateway

Here we have 2 linux servers on the internal network hosting web on port 8080

x


Next on the Application Gateways, create new

x


Here we will select Tier Standard first, before changing it later to enable WAF. We also place this App Gateway on the external subnet

x


For the frontend, give it a Public IP Address

x


For the backend, point it to both our linux servers

x


Next add a routing rule that listens on port 80 on frontend

x


And route it to port 8080 on the backend

x

x


That should finish our Application Gateway configuration

x

x


We can open the AppGW to see the health of the backend members

x


To test this, we visit the public IP on port 80, the traffic should be load balanced to our 2 linux servers

x

x


WAF

To enable WAF, we change the tier from Standard to WAF

x


Then on Network Security, open Web Application Firewalls and create new

x


Select regional WAF and use Prevention mode

x


Next we will skip the default policies and create our own custom ones, the first policy is to block traffic from China

x


And the second one is to throttle limit connections

x


These 2 rules should be enough for this lab test

x


Next associate the WAF to our App Gateway

x


And that should finish our WAF configuration

x


Because we associated it to our AppGW, when we open the AppGW it shows that our WAF is connected

x


Now when we try accessing our web using China based VPN or when we try to brute force it, we should be denied

x


This post is licensed under CC BY 4.0 by the author.