Monitor vs block mode
How HostWall's monitor, block and off modes work, how requests are scored, and how to roll out blocking safely.
Every site runs in one of three modes. New sites start in monitor mode.
| Mode | Inspects requests | Stops attacks | Use it for |
|---|---|---|---|
| Monitor | Yes | No, logs them as "Would block" | New sites, and after changing rules or paranoia levels |
| Block | Yes | Yes, with a 403 page | Sites you've checked for false alarms |
| Off | No | No | Temporarily, while you investigate a problem |
How HostWall decides
Each request is checked against the OWASP Core Rule Set. Every matching rule adds to the request's anomaly score: a critical match adds 5, lesser matches add less. When the score reaches 5, the request is an attack.
- In monitor mode, the request is still passed to your app. HostWall records an event with the action monitored ("Would block" in the dashboard).
- In block mode, the request never reaches your app. The visitor gets a short "Request blocked" page (or a JSON error for API clients) with a reference code, and HostWall records an event with the action blocked.
The paranoia level controls how many rules are active. Level 1, the default, is right for almost every site.
A safe rollout
- Add the site in monitor mode. Nothing can break.
- Use the site normally for a few days. Sign in, post forms, upload files, use the admin area, run your API clients.
- Review the Attacks page with the action filter set to Would block. Real attacks (scanners,
/etc/passwd,UNION SELECTfrom unknown IPs) need no action. For anything legitimate, use Allow this. - Switch to block mode when only real attacks are left.
Switching modes
- Dashboard: on the Sites page, use the site's Off / Monitor / Block switch. It applies immediately, also for sites from the config file.
- CLI:
sudo hostwall site mode example.com block(ormonitor,off). - Config file: set
mode: blockon the site and save. HostWall reloads within about 2 seconds.
Sites defined in the config file can only be changed in the file.
To change the mode new sites start in, set defaults.mode in the config file. Monitor is the safe default.
What visitors see when blocked
A plain page titled Request blocked, saying the request looked like an attack, with a reference code. The code is the request ID: search for it on the Attacks page to find the exact request. Clients that ask for JSON (Accept: application/json) get:
{"error": "Request blocked", "message": "...", "request_id": "3f2a9c1d7e4b6a80"}If inspection fails
Separate from attacks: if HostWall can't inspect a request because of an internal error, the site's fail setting decides. open (the default) passes the request on and logs the error; closed refuses it with a 503. See Fail open or closed.