Skip to main content
Legia

Cybersecurity

What is a WAF (Web Application Firewall)?

Also called web application firewall.

Short definition

A WAF (web application firewall) is a filter that sits in front of a website or web application and inspects every HTTP request, then blocks attack patterns such as SQL injection, XSS, and suspicious bot traffic.

How it differs from a network firewall

A network firewall filters by address, port, and protocol: who may connect to what. A WAF works at the application layer and reads the content of requests, such as form parameters and page addresses. A network firewall cannot tell a normal login request from one that contains SQL commands, while a WAF is designed to do exactly that.

How it is deployed

A WAF can be a service on a content delivery network (CDN) that sits in front of the server, a module installed on the web server, or a dedicated appliance in a data center. Its rules come from collections of known attack patterns, plus custom rules for your application, such as limiting login attempts per minute or blocking access to the admin page from abroad.

Things to keep in mind

A WAF is an extra layer, not a substitute for fixing code. A flaw covered by a WAF still exists in the application and can be exploited with attack variations the rules do not recognize. Rules that are too strict can also block legitimate users, so a new WAF usually runs in monitoring mode first. Review its block logs regularly to fine-tune the rules. Also make sure the origin server only accepts traffic from the WAF, because an attacker who knows the server's IP address can bypass it and attack directly.

Related Legia service Server Installation & Management Setup, hardening, monitoring, and migration for physical, virtual, and cloud servers.