Blog

Notes on running CasWAF and the pieces around it: firewall rules, certificates, single sign-on and the parts of a reverse proxy that usually take a weekend.

Putting WordPress behind the gateway

WordPress attracts the most automated attacks of any common application. A gateway in front of it can take the brute force, the XML-RPC traffic and the scanner noise away before PHP ever starts.

The redirects every site needs, and the order they run in

www to the bare domain, the old domain to the new one, HTTP to HTTPS, and the trailing slash. Four redirects, one order, and a few paths where each of them does more harm than good.

When a rule blocks the wrong person

Every firewall eventually blocks a real customer. The difference between ten minutes and a bad afternoon is knowing which rule fired, and fixing it in the right place.

A self-hosted WAF in one Docker Compose file

Two services, a mounted config folder and three published ports. What the compose file actually contains, why the image is built rather than pulled, and the two edits that trip people up.

CAPTCHA without turning people away

Blocking suspicious traffic is a decision made once, by a rule. Challenging it moves the decision to the visitor. Where that trade is worth it, and the two places it is not.

Knowing a site is down before your users do

A health check that runs inside the same network answers a different question than one that comes from outside. What CasWAF checks, when it sends an alert, and the parts it deliberately leaves out.

Putting a company login in front of an internal tool

A reverse proxy can ask for a Casdoor login before a request reaches an application, so admin panels and internal tools get MFA, LDAP and social logins without a line of new code.

Running ModSecurity rules without Nginx

ModSecurity usually arrives as an Nginx module. CasWAF runs the same SecLang rules on Coraza, inside the gateway, with no Nginx underneath. What carries over, what does not, and how to move a ruleset.

Moving an Nginx server block to CasWAF

A server block is a list of decisions: name, upstream, certificate, redirects, limits. Here is what each part turns into in CasWAF, what has no equivalent, and how to cut over without a window of downtime.

Rate limiting that doesn't lock out real users

A rate limit is two numbers and a set of counting rules. Get the counting wrong and one office network or one page load takes the site down for everyone behind it.

The real client IP behind a reverse proxy

IP rules, rate limits and request records all key off the client's address. Once a proxy is in front, the address in the socket belongs to the proxy. How CasWAF works out the real one, and when it refuses to believe the header.

Running the gateway on Windows

Most WAFs assume a Linux box next to the application. CasWAF runs on the server itself, including the Windows one that hosts the app. What is the same, what is different, and the one thing to plan before a reboot.

Several gateways, one database

CasWAF has no cluster mode. Any number of machines can run the same gateway against one database, which is the same thing with fewer moving parts. What is shared, what each node keeps to itself, and where it breaks.

TLS certificates without the certificate files

In a file-based proxy, a certificate is two paths on one machine and a reload. Here it is a row in the database, matched per connection by domain. What that changes for renewal, wildcards and several nodes.

What the request records can tell you

Every request is written down before the gateway decides anything about it. That ordering is what makes the records useful, and it also explains what they cannot answer.