What is a WAF?

A WAF filters malicious HTTP requests before they reach your application blocking common attack vectors. CloudSonic includes an enterprise grade WAF on every plan configured and maintained by our team.

CloudSonic
CloudSonic
Last Updated September 10, 2026

TL;DR WAF

A WAF, or Web Application Firewall, is a security layer that monitors, filters, and blocks HTTP traffic between the internet and your web application based on a set of rules designed to identify and stop malicious requests. Unlike a network firewall which operates at the IP and port level, a WAF operates at the application layer and understands the context of web traffic. This means it can identify and block specific attack patterns like SQL injection, cross-site scripting, remote file inclusion, and XML-RPC abuse, all of which are common vectors for compromising websites. A WAF is particularly important for WordPress sites because WordPress is the most widely targeted CMS on the internet and attackers specifically probe for known WordPress vulnerabilities. CloudSonic includes an enterprise grade WAF on every plan through Cloudflare Enterprise, configured and updated continuously by our team. It works alongside bot protection and DDoS protection as part of a layered security approach.

How a WAF Works

A WAF inspects every HTTP request arriving at your website before it reaches your application and compares it against a ruleset designed to identify malicious patterns. Rules are written to match the signatures of known attack techniques. A SQL injection rule might look for request parameters containing SQL keywords like UNION SELECT or DROP TABLE. An XSS rule might look for script tags or JavaScript event handlers in form inputs. A rule targeting brute force attacks might count login attempts from a single IP address and block further attempts after a threshold is exceeded. When a request matches a rule, the WAF can block it outright, return a challenge page, log it for review, or apply rate limiting depending on how the rule is configured. Rules are maintained and updated continuously by security teams who monitor new vulnerabilities and attack patterns as they emerge. Cloudflare's WAF ruleset, which CloudSonic uses through Cloudflare Enterprise, is one of the most comprehensive and frequently updated in the industry.


# Test that your WAF is blocking SQL injection attempts
curl -s -o /dev/null -w "%{http_code}" \
  "https://example.com/?id=1+UNION+SELECT+1,2,3--"
# Expected: 403

# Test that XSS attempts are blocked
curl -s -o /dev/null -w "%{http_code}" \
  "https://example.com/?q=alert(1)"
# Expected: 403

# Test that xmlrpc.php is blocked
curl -s -o /dev/null -w "%{http_code}" \
  -X POST https://example.com/xmlrpc.php
# Expected: 403

# Test that legitimate traffic still passes
curl -s -o /dev/null -w "%{http_code}" https://example.com
# Expected: 200

Why a WAF Matters for Your Website

The web application layer is where the vast majority of successful attacks against websites happen. Network firewalls and DDoS protection block traffic at the IP and port level but they cannot inspect the content of HTTP requests. An attacker sending a SQL injection payload in a form submission looks like normal web traffic at the network level. Only a WAF, which understands HTTP and can read request parameters, headers, and body content, can identify and block that attack. WordPress sites face a particularly high volume of application-layer attacks because WordPress is the most widely deployed CMS in the world and its attack surface is extensively documented. Attackers run automated scanners that probe for known plugin vulnerabilities, attempt credential stuffing against the login page, and test for SQL injection in any input field they can find. A WAF blocks all of these patterns before they reach your application, making it one of the most important security layers for any publicly accessible website.

Frequently Asked Questions on WAF

Can I write my own WAF rules on CloudSonic?

Yes. CloudSonic's WAF through Cloudflare Enterprise supports custom rules that you can configure to match specific traffic patterns relevant to your application. You can create rules that block, challenge, or rate limit requests based on URL patterns, request headers, geographic origin, user agent strings, or combinations of these criteria. Custom rules sit alongside the managed ruleset maintained by Cloudflare's security team.

What is the difference between a WAF and a firewall?

A traditional firewall operates at the network layer and makes decisions based on IP addresses, ports, and protocols. It cannot inspect the content of HTTP requests. A WAF operates at the application layer and understands HTTP, meaning it can read request parameters, headers, cookies, and body content to identify malicious payloads. Both are necessary and serve different purposes. CloudSonic uses UFW as a network firewall and Cloudflare Enterprise as the WAF, providing protection at both layers.

Does a WAF slow my website down?

The latency added by WAF inspection is measured in single-digit milliseconds and is imperceptible to visitors. Cloudflare's WAF inspection happens at the edge before the request travels to your origin server, meaning the total request time including WAF inspection is still faster than a direct connection to an unprotected origin server in most cases due to the benefits of edge proximity.

What WordPress-specific attacks does CloudSonic's WAF block?

CloudSonic's WAF ruleset includes rules specifically targeting common WordPress attack vectors including brute force attempts against wp-login.php, XML-RPC abuse, enumeration of WordPress usernames via the author parameter, exploitation of known plugin and theme vulnerabilities, and SQL injection attempts through WordPress form inputs. These rules are updated continuously as new vulnerabilities are disclosed.