Why do we need WAF?
Attacks against web servers are the most common among the issues in cybersecurity. Servers are often connected to a broader bandwidth, enabling these attacks to be increasingly efficient. Protecting web servers is important because not from the data perspective, the server can also be used as a bridge into the company’s network.
WAF provides centralized protection for your web application from the common exploits and vulnerabilities that make your web application bulletproof and secured in terms of attacks.
Benefits
Web vulnerabilities and attacks protection without changing your backend code.
Real-time protection monitoring logs.
Customization of rules as per application requirement.
WAF Modes
Detection
Monitors and logs all threat alerts into a log file if we run WAF in "Detection" mode, it won't block any request but log them.
Prevention
When put in "Prevention" mode, attacks are detected and are blocked by its rules and the attacker simply receives 403 Forbidden Error stating that the attacker doesn't have access to the request.
Implementation:
Step 1:Step 2:
Step 3:
Step 4:
Following are the options we will be looking at
Configuration:
Web Application Firewall:
In this section we can change Firewall mode as per the requirement, Rule set "OWASP 3.0" is recommended.
Further we can "select / deselect" rules according to our application using "Advanced Rule Configuration".
Backend Pools
There are several options in backend pool of WAF,
Note: VMs must be in the same VNET where you deployed WAF.
After selecting VM click "Save".
Step 6:
HTTP Settings
Add HTTP Setting
Step 7:
Listeners (Http and https)
There are 2 types of Listeners "Basic" and "Multi-site"
Basic – You need to use basic listeners if you want to receive all the requests from web on the listener
Multi-Site – You need to use Multi-Site listener to listen to a particuler hostname for example "www.mydomain.com".
In the same way assign Rule for all the listeners.
Health Probes
Health probes are to ping your host and check if Backend is online or not. You can create a custom health probe by following these steps.After adding a health Probe you need to assign that Health Probe to a HTTP Setting
Step 10:
Backend Health
Backend health should be healthy to run all the websites/web application smoothly. If backend is unhealthy, check your health probes configured properly.
Testing Your Deployement:
Step 1:
Point your domain e.g "www.abc.com" to WAF Public IP address or use WAF public IP in URL to access the site.
Step 2:
Check the flow of request through WAF by clicking on "Overview" of WAF blade.
Conclusion:
Microsoft Web Application Firewall solution is more effective at preventing malicious attacks on your web applications.
Combination of WAF with robust application coding makes web application more secured.
Besides protection, Web Application Firewall provides more functions such as logging attacks, load balancing, permanent redirections that further enhance website performance, security and reliability.