Scanner blocking

Every public site receives a steady stream of automated vulnerability probes - requests for /wp-login.php, /.env, /xmlrpc.php and friends. The bad-URL auto-blocker recognises these, counts them per source IP in a rolling window, and blocks the IP once it crosses a threshold. It is on by default.

What counts as a probe

Built-in patterns cover the common scanner noise: WordPress paths (wp-login.php, wp-admin, wp-includes, wp-content, xmlrpc.php), phpMyAdmin (phpmyadmin, pma), dotfile fishing (.env, .git, .aws, .ssh), vendor/ and eval-stdin, router/exploit endpoints (HNAP1, setup.cgi, boaform), Exchange, Spring and console paths (owa/, autodiscover, actuator, console/) - and any .php URL at all, since a lazysite site serves no PHP. Operators can add their own substrings on top.

Configuration

Keys in lazysite/lazysite.conf, also editable on the manager's Extensions page (the bad-URL auto-blocker's Configure entry):

  • bad_url_block - enabled (default) or disabled
  • bad_url_threshold - probe hits from one IP that trigger a block (default 10)
  • bad_url_window - rolling window in seconds over which hits are counted (default 3600)
  • bad_url_extra - comma-separated extra substrings to treat as probes on top of the built-ins

So by default: ten probe URLs from one IP within an hour and that IP is blocked.

Where blocks are enforced

The check runs ahead of everything else in the auth wrapper and, on pool installs, in the front door, for each request it serves without the wrapper. Every request is therefore checked once, and a blocked IP cannot even reach the login form. The development server runs the same check. A blocked IP receives a plain 403 Forbidden. Each auto-block is written to the audit trail (ip-auto-blocked) and the error log.

The address counted and blocked is the visitor's, worked out through trusted_proxies behind a front proxy (see the configuration keys).

When nothing is blocked the check is a single file test, so the common case costs almost nothing.

Blocking and unblocking

The bad-URL auto-blocker's entry on the Extensions configure page lists the blocked addresses (address, probe count and blocked since), with an Unblock button per address and a Block this address field to block one by hand. The same actions are available on the control API: bad-url-blocks (list), bad-url-block and bad-url-unblock, each requiring the site-configuration permission (manage_config).

Notes

  • Blocks live in lazysite/cache/bad-url-blocked.json and the hit counters in lazysite/cache/bad-url-hits.json; both are size-bounded, so a scanning campaign cannot grow them without limit
  • Legitimate visitors are unaffected: only probe-shaped URLs are counted