Skip to Content
HostWall

Handling false positives

Find and fix false alarms in HostWall: monitor mode, reading why a request was blocked, Allow this exceptions and paranoia levels.

A false positive (false alarm) is a normal request that HostWall thinks is an attack: a blog post that contains SQL, a search for <script>, an API field with unusual characters. Every WAF has them. This page shows how to find them before they hurt anyone and how to fix them without weakening protection.

1. Start in monitor mode

New sites start in monitor mode. HostWall inspects every request and records what it would block, but lets everything through. Nothing breaks while you learn what your traffic looks like.

Leave a new site in monitor mode for a few days of normal use, and use your site the way your users do: sign in, post a comment, upload a file, use the admin area, run your API clients.

Check the monitored events:

  • Dashboard: Attacks, with the action filter set to Would block. Each site card on the Sites page also shows a "would block" count.
  • CLI: sudo hostwall logs --action monitored -n 50

2. Read "why was this blocked?"

Click an event on the Attacks page. The detail page shows:

  • Attack type, such as SQL injection or Cross-site scripting (XSS), and a one-sentence explanation.
  • Each rule that matched: its OWASP CRS rule ID, what it looks for, where it matched (for example parameter "comment", header "User-Agent", the URL path) and the matched value.
  • The anomaly score. A request is blocked when the score reaches 5.
  • The request: method, URL, client IP, selected headers, and a "Copy as cURL" button to reproduce it.

Ask yourself:

Looks likeProbably
A scanner user agent (sqlmap, nikto, nuclei), /etc/passwd, UNION SELECT, <script> in a URL nobody links to, from an IP you don't knowA real attack. Do nothing.
Your own IP, a path your app really uses, a field where users type free text, your monitoring or API clientA false positive. Allow it.

Real attacks need no action. In monitor mode they are allowed through, which is why you switch to block mode once you're done.

3. Use "Allow this"

On the event page, Allow this creates exceptions that stop the matching rules from firing for this kind of request again. Pick the narrowest scope that covers the problem:

ScopeWhat it allowsUse when
Only this field on this path (safest)These rules no longer inspect this one field (for example the comment parameter or the session cookie) on this exact path.A specific form field or API property legitimately contains code-like text.
These rules on this pathThese rules are switched off for this exact path, for every field.The match isn't in a named field (for example in the URL path or the raw body), or several fields on one endpoint are affected.
These rules on the whole site (widest)These rules are switched off for every request to the site.A rule doesn't fit your app at all. Use sparingly.

Details:

  • The path must match exactly (query string ignored). /api/posts doesn't cover /api/posts/42.
  • An exception removes specific rule IDs only. Every other rule keeps protecting that field, path or site.
  • If a field can't be named safely, "only this field" falls back to "these rules on this path" for that rule. The preview on the page shows exactly which exceptions will be created.
  • You can add a note (for example "rich text editor") so you remember why later.
  • Exceptions apply within a couple of seconds, with no restart.

To review or undo exceptions, open Exceptions in the dashboard. Deleting an exception turns those rules back on.

Exceptions are stored in the database (they're included in hostwall backup). They aren't part of the YAML file yet.

4. Switch to block mode

When the Attacks page has gone quiet apart from real attacks, switch the site to block mode: on the Sites page, set the site's mode switch to Block, or

sudo hostwall site mode example.com block

For a site in the config file, set mode: block and save the file.

If a blocked visitor contacts you, the block page shows them a reference code. Search for it on the Attacks page to find their request, then use Allow this as above.

5. Tune the paranoia level

The paranoia level (1 to 4) controls how many OWASP CRS rules are active. Level 1, the default, has the fewest false positives. If you raised the level and see many false alarms across your site, lowering it is usually better than creating many exceptions.

To raise the level safely:

  1. Switch the site to monitor mode.
  2. Raise the level (in the site's settings in the dashboard, or paranoia: in the YAML file).
  3. Watch the Attacks page for a few days and allow what's legitimate.
  4. Switch back to block mode.

See Paranoia levels for what each level adds.

Other options

  • Mode off turns inspection off for a whole site while keeping the proxy and HTTPS. Use it as a temporary escape hatch, not as a fix.
  • Bodies larger than body_inspect_limit are only partly inspected, so they don't cause parse-error blocks.
  • fail: open (the default) means an internal inspection error never blocks a visitor. It doesn't affect false positives.

Report false positives

Each false positive you report helps every HostWall user, and later it helps build app rule packs (WordPress, Nextcloud and others are planned for v0.2).

Open a False positive or missed attack issue and include:

  • the app and version (for example "WordPress 6.7, Gutenberg editor, saving a post");
  • the rule IDs, matched location and anomaly score from the event page;
  • the request, with real data, cookies and tokens replaced by placeholders;
  • your paranoia level and hostwall version.

Never paste passwords, session cookies or API keys. For a missed attack against an unpatched app, use a private security report instead.

Edit this page on GitHub

On this page