Technical Guide

A WAF (web application firewall) is a security layer that sits between your web application and the internet, inspects HTTP and HTTPS requests and blocks the harmful ones. A network firewall looks at which IP may connect to which port; a WAF looks at the content of the request: it reads the URL, headers, cookies and body to decide whether a request is an attack such as SQL injection or XSS. This guide explains what a WAF is, how it works, what it protects and how to choose one.
What is a WAF?
A WAF is a filter that works at the application layer (layer 7 of the OSI model). It acts like a reverse proxy between the user and the application server. Every incoming request passes through the WAF first; requests that follow the rules are forwarded to the application, others are blocked, slowed down or sent to a challenge page.
The value of a WAF is that it can keep known attack patterns out without changing the application's code. Until a vulnerability is patched, it acts as a temporary shield.
How does a WAF work?
A WAF does three basic things:
- Parses the request. It decodes the HTTP method, path, query parameters, headers and body. To inspect HTTPS traffic it needs to terminate the TLS connection.
- Compares it with rules. There are two approaches: a negative model looks for known bad patterns (for example
' OR 1=1) and blocks them; a positive model only allows defined, expected requests. Most WAFs use a mix of both. - Decides the action. The request is passed, blocked, rate limited or shown a challenge page.
Rules come from two sources: managed rules that the provider keeps up to date and custom rules you write for your own application. A common open-source example is the OWASP Core Rule Set, which provides generic attack detection rules for ModSecurity and compatible WAFs.
What does a WAF protect against?
The OWASP Top 10 is a widely used reference that lists the most critical security risks in web applications. Attacks a WAF typically helps with:
- SQL injection: Database commands hidden in input.
- Cross-site scripting (XSS): Injecting malicious script into a page.
- Path traversal and file inclusion: Unauthorised access to files on the server.
- Bot traffic and brute force: Automated login attempts and content scraping.
- HTTP flood: Wearing out the application with many legitimate-looking requests.
WAF vs firewall
| Network firewall | WAF | |
|---|---|---|
| Layer | Network and transport (L3/L4) | Application (L7) |
| What it looks at | IP, port, protocol | URL, headers, cookies, request body |
| When it is enough | Restricting access at service level | Filtering attacks aimed at the web application |
| Example attack | Port scan, UDP flood | SQL injection, XSS, HTTP flood |
They do not replace each other; they complement each other.
WAF vs DDoS protection
DDoS protection stops volumetric and protocol attacks at link and network level in front of your link. A WAF evaluates requests at HTTP level. If the link is already full, traffic is lost before it reaches the WAF, so for volumetric attacks you need remote DDoS protection or inline protection. The rate limiting and challenge features of a WAF come into play for application-layer attacks such as an HTTP flood. We compared these attack types in types of DDoS attacks.
Limits of a WAF
- It does not replace secure coding. It does not fix the flaw, it only shields against known patterns.
- False positives can happen. It may block a legitimate request, so rules should be tried in monitoring mode first and exceptions defined.
- Seeing encrypted traffic needs TLS termination. Certificate management has to be planned.
- It is limited against zero-day flaws. It may not recognise an unknown pattern.
Types of WAF: cloud, on-premise and host-based
- Cloud WAF: You point your domain's DNS record to the provider and traffic passes through its WAF nodes first. Setup is fast and the provider runs the infrastructure.
- On-premise / self-hosted WAF: You install it on your own servers; data and nodes stay under your control.
- Host-based WAF: A module added to the web server or application framework.
WireShield Web Protection as a WAF
WireShield Web Protection is an L7 protection layer for websites, customer portals and HTTP APIs, managed from one panel:
- Web Application Firewall: Filters unwanted HTTP requests with managed and custom rules.
- Rate limiting: Request limits are set per URL and service need.
- Challenge pages: Policies are managed per domain and path; the page can show your own logo and texts.
- Rules suited to API traffic: Browser checks can be managed separately from your API endpoints.
- Caching: Static files are stored on WireShield WAF nodes, which reduces the load on your origin server. WAF checks also apply to responses served from the cache.
- Cloud or on-premise: With identical features, you can start in the cloud by pointing your DNS records, or install it on your own servers and use it as white-label. Reseller accounts can be opened.
Web Protection complements the L3/L4 protection at network and transport level.
Questions to ask when choosing a WAF
- Do you need cloud, or your own infrastructure?
- How often are the managed rules updated, and can you write custom rules?
- Can you try rules in monitoring mode before blocking?
- Can you separate API traffic from browser challenges?
- Are rate limiting, caching and logs in the same panel?
- Can you get it together with DDoS protection from one provider?
Frequently asked questions
Does a WAF fix a SQL injection vulnerability?
No. A WAF blocks known attack patterns but does not remove the flaw in the code. Patching the vulnerability is still necessary; the WAF gives extra protection in the meantime.
Does a WAF slow my site down?
Inspecting a request adds a very small delay. A WAF that also offers caching usually speeds your site up by serving static files from its own nodes.
Do I need a WAF for a small website?
Yes if the site has login forms, payments or customer data. For a simple brochure site, the need depends on your threat level and how you maintain it.
Does a WAF stop an HTTP flood?
It reduces most of it with rate limiting, behavioural analysis and challenge pages. If the attack grows large enough to fill your link, network-layer filtering is needed too.
Do I have to change my hosting to use a cloud WAF?
Usually not. You point the domain's DNS record to the provider and define your origin server details; your hosting stays where it is.
Sources
- OWASP, OWASP Top 10
- OWASP, Core Rule Set (CRS)
- CISA, Understanding Denial-of-Service Attacks
Next step
Tell us which domains and applications you want to protect, your traffic and your policy needs, and we will do a technical assessment together. You can look at the Web Protection page or talk to the technical team.