Back to blog
    Header image for the article "WAF (Web Application Firewall): What It Is & Do You Need It?"
    Security05/06/20266 min

    WAF (Web Application Firewall): What It Is & Do You Need It?

    Want to know how your own site is doing?

    A WAF is a security layer that filters malicious traffic before it reaches your server. Learn how to choose and configure the right one for your site.

    Author: Kodulehehaldus

    What is a WAF?

    A WAF (Web Application Firewall) is software that filters HTTP traffic before it reaches your server. It blocks:

    • SQL injection attempts
    • Cross-site scripting (XSS)
    • Brute force logins
    • DDoS attacks
    • Malicious bots
    • Geo-blocking (if needed)
    • Known attacker IPs

    A WAF protects against 90%+ of the attacks listed in the OWASP Top 10.

    How does a WAF work?

    User → WAF (Filters) → Your Server
                ↓
            Malicious → BLOCK

    A WAF uses specific rules:

    • Known attack patterns (signature-based)
    • Anomalies (behavioural models)
    • ML models (modern WAFs)

    Types

    1. Cloud WAF (Recommended for 2026)

    • Cloudflare, Sucuri, AWS WAF
    • Easy to install (DNS change)
    • Maintained by the provider
    • DDoS protection included
    • Price: £0 – tens of pounds/month

    2. Plugin WAF

    • Wordfence, Sucuri plugin
    • Runs inside WordPress
    • Limited (traffic has already reached the server)
    • Free versions are decent

    3. Server WAF (ModSecurity)

    • At the Apache/Nginx level
    • Open source
    • Requires configuration
    • Good for experienced admins

    4. Hardware WAF

    • For large enterprises
    • F5, Imperva, Fortinet
    • Expensive (£10,000+)

    Free vs Paid

    Free options

    • Cloudflare Free – basics (rate limits, country blocking, basic rules)
    • Wordfence Free – reliable plugin
    • ModSecurity + OWASP CRS – self-hosted

    Paid options

    • Cloudflare Pro ($20/month) – full rule set, image optimisation
    • Sucuri Firewall ($200/year) – professional grade
    • Wordfence Premium ($119/year) – real-time threat feed

    Cloudflare WAF Setup

    1. Point DNS to Cloudflare (see CDN Comparison)

    2. SSL → Full (Strict)

    3. Security → WAF

    • Managed Rules: ON
    • OWASP Core Rule Set: ON
    • Sensitivity: Medium (to start with)

    4. Rate Limiting (Pro)

    • /wp-login.php: max 5 req/min
    • /xmlrpc.php: max 1 req/min

    5. Bot Fight Mode: ON

    • Blocks known malicious bots
    • Bypass: Allows useful bots (Googlebot, Bingbot)

    6. Geo-blocking (if needed)

    • Typical local business: not required
    • Against spam: block countries where you have no customers

    Typical WAF Rules

    SQL Injection

    Block: union select, ' OR 1=1, /**/, sleep(

    XSS

    Block: <script>, javascript:, onerror=

    Path traversal

    Block: ../, ../../etc/passwd

    File upload

    Block: .php upload via form

    False Positives

    A WAF can occasionally block legitimate requests:

    • Contact forms with long messages
    • Admins editing SQL code
    • API calls

    Solution: Whitelist legitimate IPs / URLs.

    Monitoring WAF Logs

    Cloudflare → Analytics → Security:

    • Blocked requests
    • Attack types
    • Geo-distribution
    • Top targets

    Set up email alerts for high activity spikes.

    DDoS Protection

    A WAF usually includes DDoS protection:

    • L3/L4 (packet level)
    • L7 (application level, the most difficult to stop)

    Cloudflare blocks over 100 billion attacks every second.

    Do You Need a WAF?

    ScenarioWAF Needed?
    Small portfolioCloudflare Free is enough
    BlogCloudflare Free is enough
    Business websiteYes, Cloudflare Free
    E-commerce storeYes, Cloudflare Pro or similar
    Site with user dataYes, professional WAF
    Large site, high trafficYes, Cloudflare Business+

    Limitations

    A WAF does NOT protect against:

    • Weak passwords (use 2FA)
    • Plugin vulnerabilities (keep them updated!)
    • Social engineering (see phishing)
    • Insider threats
    • Physical attacks

    Summary

    A WAF is mandatory in 2026, even for small websites. Cloudflare's free plan covers the basic needs of a small site. Our security service includes WAF configuration and monitoring. Request a quote.

    Sources

    Join the newsletter

    Once a month, practical tips on making your website faster, more secure and easier to find on Google and in AI search.

    By subscribing you receive our newsletter. You can unsubscribe at any time from the end of every e-mail. Privacy policy

    Author

    Kodulehehaldus.com (Innov8it OÜ) – an Estonian web agency that builds, maintains and optimises websites.

    Related articles