Web Application Firewalls
Summary
A web application firewall (WAF) inspects HTTP and HTTPS traffic to and from web applications and blocks attacks such as SQL injection and cross-site scripting. It understands web protocols in detail and protects applications even when their code has flaws.
In plain words
A web application firewall (WAF) protects web applications and their databases. It understands HTTP and applies application-aware rules and signatures to block requests containing suspicious code, such as injection attempts, and it logs what it finds. It can be an appliance in front of the web zone or a plug-in on the web server.
Detailed explanation
-
Web application firewall (WAF): A layer 7 filter designed to protect web applications by inspecting requests and responses.
- Protects against: Injection, cross-site scripting, path traversal, malicious bots and other OWASP Top 10 risks.
- Rule sets: Signatures and patterns for known attacks, such as the OWASP Core Rule Set, plus custom rules.
- Positive security model: Allows only known-good requests.
- Negative security model: Blocks known-bad patterns.
- Deployment: Network appliance, reverse proxy, software plug-in on the web server, or cloud service in front of the site.
- Logging: Records blocked requests for investigation and tuning.
Important terms
taken from the text above- Web application firewall (WAF)
- A layer 7 filter designed to protect web applications by inspecting requests and responses.
- Rule sets
- Signatures and patterns for known attacks, such as the OWASP Core Rule Set, plus custom rules.
- Positive security model
- Allows only known-good requests.
- Negative security model
- Blocks known-bad patterns.
- Deployment
- Network appliance, reverse proxy, software plug-in on the web server, or cloud service in front of the site.
- Logging
- Records blocked requests for investigation and tuning.
Examples & real-world scenarios
- A WAF blocking a request with SQL injection syntax in a form field.
- A WAF plug-in running on the web server platform.
- Reviewing WAF logs to see which attacks are hitting your site.
Scenario
A company's older web app can't be patched quickly. A WAF with injection signatures in front of it reduces the risk while the code is fixed, as a compensating control.
Common mistakes
- Thinking a network firewall allowing port 443 protects the web app. It doesn't inspect the application requests.
- Treating a WAF as a replacement for secure coding.
Practical skills
- Explain what a WAF inspects that a packet filter can't.
What I should remember
- WAF: Protects web apps at layer 7.
- SQL injection and XSS: Typical attacks a WAF blocks.
- Virtual patching: Using WAF rules to shield a known flaw until the code is fixed.
- Exam tip: A WAF protects web servers; a forward proxy protects users browsing out.