Web Application Firewall (WAF): Your App's HTTP Bodyguard
A Web Application Firewall (WAF) is a specialized bodyguard for your web app, inspecting all HTTP traffic for malicious requests. It blocks common attacks like SQL injection and XSS by matching traffic against known patterns.
WHY IT EXISTS: Traditional network firewalls inspect traffic based on source and destination (IP addresses, ports), but they don't understand the application-layer data inside. Web applications have unique vulnerabilities that can be exploited via normal-looking HTTP requests. A WAF was created to inspect the actual content of web traffic and block attacks that a normal firewall would miss.
THE MENTAL MODEL: Think of a WAF as a security guard at an airport who doesn't just check your ticket, but also puts your luggage through an X-ray scanner. The scanner is programmed to recognize forbidden items (attack signatures). If it detects a threat, the bag is stopped long before it can get on the plane (your application server).
HOW IT WORKS: A WAF sits between the internet and your web application, intercepting all HTTP traffic. It analyzes each request against a set of rules and signatures that define what malicious traffic looks like. If a request matches a signature for an attack like SQL injection or cross-site scripting, the WAF can block it, log it, and alert an administrator. These rules can be pre-built to stop common attacks or customized to protect against specific, newly discovered threats.
WHEN TO USE IT: A WAF should be a standard defense layer for any public-facing web application. It is highly effective at providing a first line of defense against the most common web exploits, such as those on the OWASP Top 10 list. It's also critical for providing a temporary, emergency patch for a zero-day vulnerability, blocking the exploit at the edge while developers work on a permanent fix in the code.
WHEN NOT TO USE IT: Do not use a WAF as a substitute for writing secure code. Relying on it completely creates a false sense of security, as sophisticated attackers can sometimes find ways to bypass its rules. A poorly configured WAF can also be a problem, either by failing to block real attacks or by generating false positives that block legitimate users, impacting business.
ONE CANONICAL EXAMPLE: An attacker tries to log into a site by entering ' OR 1=1; -- into the password field. A traditional firewall would allow this traffic. A WAF, however, inspects the field's content, recognizes the pattern as a classic SQL injection attack, and blocks the request from ever reaching the application's database, preventing an unauthorized login.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.