Repository navigation
Feature Descriptions 2.x
This page is for BFStop 2.x (2.0.0 is not released yet; this describes the current development state). For BFStop 1.5.x, see Feature Descriptions 1.5.
This page describes BFStop's features and all of its settings. In BFStop 2.x, all settings are in the component: Components → Brute Force Stop → Settings. The plugin (System - Brute Force Stop) has no settings of its own any more; it only has to be enabled, which the installation does. Each setting also has a description in the settings page itself, shown below its input after pressing the "Toggle Inline Help" button.
For a short getting-started guide, see Configuration 2.x. If you are updating from 1.x, see Upgrading to 2.0.
Contents: How blocking works · Block modes · Adaptive risk scoring · Distributed attacks on one account · Repeat offenders · IPv6 · Proxies and load balancers · Blocking in the web server · Unblock emails · Notifications · Hints on the login page · The blocked page · Usernames and privacy · Maintenance and data retention · Logging · Backend views · Permissions · All settings
BFStop watches every login: in the frontend, in the backend and, new in 2.0, through Joomla!'s Web Services API (api/index.php, logins with HTTP Basic authentication or an API token). Each failed login is recorded with its address, username, time and origin.
When a failed login comes in, BFStop
- records it (before doing anything else with it, so parallel attempts are all counted),
- computes the risk score of the attempt, which raises or lowers the number of failed logins the address is allowed,
- counts the failed logins of the address within the Check interval (default: 1 week) that haven't led to a block yet,
- blocks the address if it has used up its allowed attempts, for the Block Duration (default: 1 day), longer for repeat offenders,
- sends the notifications and, if configured, the unblock email to the user.
A successful login clears the failed logins of that user (by username or email address) from that address: they no longer count. It also remembers the address as a known one for that user (see the known-IP signal below).
With the default settings, an address is blocked after 10 failed logins within a week, for a day.
Logins from one address are handled one after the other: a login waits (at most 5 seconds) until the previous login of the same address has been counted. Without this, an attacker sending many logins at the same time would get all their passwords checked before the first failed login was counted. Parallel failed logins that all reach the threshold block the address once, not once each. If the block list can't be read (a database problem), a login attempt is refused with status 503 ("try again in a few minutes"); other requests are let through.
An address on the allow list is never blocked and never counted. Blocks only apply in the parts of Joomla! BFStop is Active for (frontend, backend, API; all three by default), except blocks in the web server's configuration, which apply to everything the web server serves.
The Block Mode setting (tab Basic) decides what happens once an address is blocked:
| Mode | What a blocked address gets |
|---|---|
| Reporting Only | Nothing is blocked. Failed logins are still recorded, counted and notified. Use it to watch what happens before enforcing anything. |
| Login Only | The address can still browse the site, but its login attempts are refused. Less disruptive for a legitimate user who mistyped a password. |
| Full Site (default) | Every request of the address is refused with the blocked page. In the backend and the API, the request is refused before Joomla! routes it. Optionally, the blocks also go into an nginx deny file. |
| Full Site + .htaccess | Like Full Site, and the address is also written into the .htaccess file, so that Apache refuses it before Joomla! even starts. |
Even when blocked, an address can still reach:
- the unblock page of an unblock email, but only with a valid link for a block of that same address;
- the password reset and username reminder of the site (not of the backend), in Full Site mode; their forms can be submitted at most 10 times an hour from a blocked address. A captcha for these forms (in the options of Users) keeps bots off them.
In Full Site + .htaccess mode, only the unblock link gets through the web server; the password reset and the blocked message don't.
Login Only and other login methods: Login Only recognises the login forms of Joomla!'s own frontend and backend (com_users, com_login) and logins with credentials through the API. Extensions that log users in by themselves (social logins, single sign-on, login modules posting to their own controller, passkeys) are not stopped. If your site offers such logins, use Full Site.
Changing the block mode applies to all blocks, including existing ones and those added manually in the block list.
New in 2.0 (#76). Not every failed login is equally suspicious: someone mistyping their password at home is not the same as a script trying "admin" with no browser. BFStop gives each failed login a risk score from several signals. Each point of the score changes the number of failed logins the address is allowed by Block Threshold Change Per Risk Point (default: 1): a positive score means fewer attempts, a negative one more.
The allowed attempts are: Block threshold − score × Block Threshold Change Per Risk Point, but never fewer than Minimum Allowed Attempts (default: 2). The minimum can't be higher than the Block threshold.
The signals, each of which can be switched off (tab Adaptive Risk Scoring, and Distributed Attacks on One Account):
| Signal | Default | Points (default) | When it applies |
|---|---|---|---|
| Known IP | on | −5 | The address (an IPv6 client: its /64) has logged in successfully as this username before. Only that pair counts: logging in as one user doesn't make attempts against another username from the same address more trusted. |
| Common username | on | +2 | The username is on the list of Common Usernames (default: admin, administrator, root, test, webmaster; case-insensitive). |
| Missing User-Agent | on | +2 | The request has no User-Agent header. Browsers always send one; many simple scripts don't. |
| Account under attack | on | +3 | The username had too many failed logins from all addresses together, see Distributed attacks on one account. |
| GeoIP | off | +3 | The address's country is not one of the Home Countries (ISO codes like AT,DE,CH). Needs a GeoIP database. |
| Reverse DNS | off | +2 | The address has no reverse DNS (PTR) record. BFStop asks the name servers itself, gives up after 1 second (no answer counts as no record) and caches the result for a week. Needs /etc/resolv.conf, so it is skipped on Windows. |
Examples with the defaults (block threshold 10):
- A user who has logged in from their home connection before mistypes their password there: score −5, so 15 attempts.
- A script tries "admin" without a User-Agent: score +4, so 6 attempts.
- An unknown address tries an account that is under attack: score +3, so 7 attempts.
If a signal fails (for example the database lookup), it counts as 0 and the failure is logged; it never blocks anybody by itself.
The GeoIP signal and the Information for IP Address page of the backend use a local copy of a MaxMind GeoLite2 or GeoIP2 database (.mmdb). BFStop doesn't include it: download it from MaxMind (a free account is needed) and enter its full path under GeoIP Database Path (tab GeoIP Database). A Country database is enough for the risk signal; the address information shows region, city and coordinates only with a City database. Lookups are made locally; no address is sent anywhere. MaxMind publishes new versions twice a week, and addresses move between countries, so update the file regularly (for example with geoipupdate from cron) and check the license terms of the database.
An attacker can spread the attempts against one account over many addresses, so that no single address reaches the block threshold. BFStop 2.0 therefore also counts failed logins per username, across all addresses (tab Distributed Attacks on One Account):
- Detect Distributed Attacks on One Account: whether to count failed logins per username at all. Enabled by default.
- Failed Attempts per Account and Counting Window (Minutes): this many failed logins for one username (default: 20), from any addresses, within this time (default: 60 minutes) make the account count as under attack.
- Risk Points While Under Attack: while the account is under attack, each failed login for it scores this many more risk points (default: 3). With the default Block Threshold Change Per Risk Point of 1, every address trying the account is blocked after 7 instead of 10 failed logins, and never after fewer than Minimum Allowed Attempts. 0 only writes the attack to the log.
The account itself is never locked, and its owner's usual addresses are still trusted (Known-IP Trust Points). During the development of 2.0, this "account-level throttle" delayed the answer instead; see Design Decision No Response Delays for why that changed.
- Permanent after (tab Advanced, default: 3): once an address has been blocked this many times, its next block is permanent. Blocks lifted by an administrator in the backend don't count; blocks lifted with an unblock link do. "Never" switches this off.
- Progressive Block Duration (tab Advanced, default: off): each block of an address lasts twice as long as its previous one (at most 64 times the Block Duration). With a block duration of 1 day: 1 day, 2 days, 4 days, …
The earlier blocks of an address are remembered even after old blocks have been purged: BFStop keeps a count per address for a year after its latest block. Without this, a slow attacker (one block every five weeks, with the default purge age of four) would never have reached a permanent block.
A client with an IPv6 address usually controls a whole network and can switch to another address in it at will. BFStop 2.0 therefore counts failed logins and blocks IPv6 clients per network, by default per /56 (IPv6 Tracking Granularity, tab Advanced). Home, mobile and business connections usually get at least a /56, so a /64 would let a client start over 256 times. Choose /64 or a single address only if clients of your site share their networks with others you don't want blocked with them.
Some details:
- Logins (for the known-IP signal and the unblock email) are remembered per /64: a /56 may be shared by several customers of a provider.
- In the .htaccess file, only the /64 of the blocked client is written, not its whole /56, so that other customers of the same provider aren't turned away by the web server.
- Addresses that embed an IPv4 address (IPv4-mapped, NAT64, 6to4, Teredo) are tracked individually. An IPv4 client that the web server reports in IPv4-mapped form (
::ffff:203.0.113.5, for example on a server listening on[::]) is handled as the IPv4 address. - Blocks, the allow list and trusted proxies can be IPv6 networks in CIDR notation, like
2001:db8:1::/48.
If your site is behind a reverse proxy, a load balancer or a CDN, every request seems to come from the proxy. BFStop then has to take the visitor's address from a header the proxy adds. Configure this on the tab Proxy / Load Balancer:
- Behind a proxy / load balancer: enable only if browsers never connect to Joomla! directly.
-
Client IP header: the header your proxy sets or appends to (
X-Forwarded-Foris the most common;Forwarded(RFC 7239) is understood too). BFStop takes the last entry of the header, the one your own proxy added; entries further left come from the client and are ignored.Client-IpandX-Cluster-Client-Iphold one address only: use them only if your proxy always overwrites them. - Proxy / load balancer IP address: the addresses of your proxies (several separated by commas, networks in CIDR notation allowed, at most /8 for IPv4 or /16 for IPv6). The header is only read from requests that come from one of them. Only list addresses nobody but your own proxies sends from: trusting a whole address range of a CDN or hosting provider also trusts its other customers.
The tab shows, for your own request, the address it came from, its forwarding headers, and which address BFStop makes of them with the saved settings. If that isn't your own address, the settings don't fit yet. The backend also warns if it sees a forwarding header while the proxy settings are off.
A request that claims to come through a proxy but doesn't come from a configured one is logged (once an hour per address). Failed logins that come through a proxy without the header are counted against the proxy's address and blocked in the database, but a trusted proxy is never written to the .htaccess file or the nginx deny file, which would lock out everybody behind it.
Blocking in the database (Full Site) needs Joomla! to start for every request of a blocked address. Blocking in the web server's configuration refuses it before that, which is cheaper.
With Block Mode "Full Site + .htaccess", BFStop also writes blocked addresses into an .htaccess file (in the site's root directory, or the directory given in .htaccess path, tab Advanced; the file must be in the site's directory or one above it). It needs Apache 2.4; the setting is refused on nginx, which doesn't read .htaccess files, and LiteSpeed gets a warning, as it may not support every directive used.
The block section looks like this:
# BEGIN BFStop Blocks
<If "(-R '203.0.113.5' || -R '2001:db8:1:200::/64') && !(%{REQUEST_URI} == '/index.php' && %{QUERY_STRING} =~ /.../)">
Require all denied
</If>
# END BFStop BlocksThe second part of the condition lets the exact link of an unblock email through to Joomla!. There are up to 50 addresses per <If>. The section only denies: it doesn't change any other access control of the directory.
- The Check .htaccess button in the toolbar of the settings tests whether the web server honours the section: it creates a test directory with a test
.htaccessnext to the file, requests it twice and removes it again. It tells whether the section works, is ignored (Apache needsAllowOverride AuthConfigorAllthere), or breaks the site (status 500). - Blocks that expire or are lifted are taken out of the file (when lifted, right away). At most 2000 addresses are kept in the file; blocks beyond that still apply in the database.
- Addresses or networks that contain an allowed address or a trusted proxy are only blocked in the database.
- Switching to another block mode or file, or uninstalling, takes BFStop's entries out of the file. Entries you added by hand between the markers stay, except on uninstallation.
- Blocks added or changed in the backend's block list go into the file as well. The backend's Blocked IPs (.htaccess) view lists the file's entries, and lets you add entries to it directly.
- In this mode, the block list can't show the "attempts since block" of a block: the web server refuses those requests before Joomla! sees them.
nginx doesn't read .htaccess files. With Block Mode "Full Site", you can instead let BFStop keep the active blocks in a file of deny lines (nginx Deny File, tab Advanced; an absolute path ending in .conf, in an existing directory PHP can write to):
# BFStop blocks: written by Brute Force Stop, do not edit
deny 203.0.113.5;
deny 2001:db8:1:200::/56;Include it in the server block of your site, for example include /etc/nginx/bfstop/example.org.conf;. BFStop rewrites it on each block, unblock and change of a block, and in the daily maintenance. It leaves out addresses of the allow list and trusted proxies, and only ever overwrites a file it wrote itself (with that first line).
nginx only reads the file when it is reloaded. You have to arrange that, for example with a systemd path unit that watches the file, or a cron job running nginx -t && nginx -s reload.
BFStop can send the owner of an account an email with a link to unblock the address that got blocked while trying their username (User Block Message, tab Notification). Because anybody can cause such an email by failing to log in with someone's username, there are three values:
| Value | Behaviour |
|---|---|
| disabled (default) | No unblock emails. |
| enabled, only if the user has logged in from that IP address before (recommended) | The email is only sent if the user has logged in successfully from the blocked address (an IPv6 client: from its /64) before. That is the case for somebody who locked themselves out, never for an attacker's address. |
| enabled, for any IP address | The email is sent for any address, but a user gets at most one link at a time that can still be used. |
In either case, no email is sent:
- if the username doesn't belong to an account (failed logins with the account's email address, or the username in another case, count as the account), or the account is disabled;
- if the failed logins that led to the block also went against other existing accounts (an attacker with an account of their own could otherwise unblock themselves after guessing at other accounts);
- if the site's address is not set: unblock links need
$live_sitein Joomla!'sconfiguration.php. Without it, Joomla! builds links from the host named in the request, which an attacker chooses, so the link (and its token) could point to the attacker's server. The settings page doesn't accept the setting without$live_site, and the backend shows the line to add.
The link is valid for 3 days and can be used once. Opening it shows a confirmation page; the address is only unblocked after pressing the button, and only from the blocked address itself. So mail scanners and link previews that open every link can't unblock anything. The link also works in Full Site + .htaccess mode: the web server lets exactly this request through.
BFStop can mail administrators about blocked addresses and failed logins (tab Notification). Recipients are all of:
- Email Address(es): one or more addresses, separated by semicolons;
- Select a User: one Joomla! user;
- User group notification and User group: all members of a user group (disabled accounts are skipped).
Invalid addresses are left out and logged. How many mails are sent per day:
- Blocked msgs per day (default: 5): mails about blocked addresses. The mail lists the failed logins that led to the block.
- Failed msgs per day (default: never): mails about individual failed logins. Don't set this to unlimited: an attack would send you thousands of mails.
- Failed msgs only for existing accounts (default: disabled): only mail about failed logins with a username or email address of an existing account. The others are still recorded and counted.
The Test Notification button in the toolbar of the settings sends a test mail with the saved settings. Without $live_site set, the mails name no link to the site.
Tab Advanced:
- Remaining attempts (default: disabled): after a failed login, show how many attempts are left before the address is blocked. This also helps attackers plan.
- Password reset reminder (default: when 1 attempt is left): suggest the password reset instead of risking a block; never, always, or when 1 or 2 attempts are left.
Tab Advanced:
- Blocked message: the text shown to a blocked address (HTML is allowed, filtered as safe HTML). Default: "Your IP address has been blocked because there were too many unsuccessful login attempts in a short time."
- Show IP: also show the address as BFStop sees it.
- Use HTTP Error (default: enabled): answer with status 403 (Forbidden). Switch it off only if a web server, CDN or firewall replaces error pages with its own, so that users never see the message: it is then sent with status 200. The unblock page also uses error statuses (400, 403, 404, 500) for links that can't be used, unless this is off.
The page is never cached, can't be shown in another site's frame, and asks search engines not to index it.
- Usernames Not Matching an Account (tab Advanced, default: Hash): users often type their password into the username field. With "Hash", the username of a failed login is only stored, shown, logged and mailed as typed if it belongs to an existing account or is a common username; anything else is replaced by an unreadable hash, which is the same for the same input, so attempts are still counted together. "Store as typed" keeps all usernames readable. Entries stored by 1.x stay as they were; purge them in the backend if you want them gone.
- BFStop never stores the passwords of failed logins (see FAQ 2.x).
- Failed logins are personal data (addresses, usernames). By default they are deleted after 4 weeks (see below).
- Prune old attempts (tab Advanced, default: 4 weeks): failed logins older than this number of weeks are deleted, and so are blocks that ended more than this many weeks ago (with their unblock records). Permanent blocks are never deleted automatically. 0 keeps everything.
Independent of that setting, BFStop keeps its tables below fixed limits, so that a visitor can't fill up the database: at most 200 000 failed logins, 10 000 usernames in the username statistics (those with the fewest attempts are removed first), 100 000 known addresses (each forgotten a year after its last login), and 10 000 cached reverse DNS results. Expired unblock links are deleted as well.
This happens in the daily maintenance, which also tidies the .htaccess file and the nginx deny file and prunes the log. In 2.0, it is a task of Joomla!'s Task Scheduler: the package installs the plugin Task - Brute Force Stop and the task Brute Force Stop maintenance (every 24 hours). The Task Scheduler runs tasks in a visitor's browser (lazy mode), through a web cron job, or on the command line (php cli/joomla.php scheduler:run). If the scheduler is switched off, or the task is deleted or disabled, the next request does the maintenance once it hasn't run for two days.
The backend's lists also have buttons to delete old entries by hand: Delete Old Entries in the failed logins (keeps the given number of days) and Delete Stale Usernames in the username statistics.
Tab Advanced:
- Logging (default: Error): how much BFStop writes to its log file: disabled, errors, warnings, informational messages or detailed information.
- Log File Size Limit (MB) (default: 5): once the log file is bigger, it is moved to a second file, replacing the previous one.
- Keep Log Entries (Days) (default: 28): older entries are deleted in the daily maintenance (also if logging was switched off in the meantime). 0 keeps them until the size limit is reached.
The log file is plg_system_bfstop.log.php (the previous one plg_system_bfstop.1.log.php) in Joomla!'s log folder (by default administrator/logs). The backend's Log view shows the newest entries first and has buttons to prune or clear the log. Uninstalling BFStop removes the log files.
With Logging set to at least "Informational message", each block is logged as Inserted IP address <address> into block list, which fail2ban can use (see Why No Delay Options in 2.0).
Components → Brute Force Stop has these views:
- Blocked IPs (database): all blocks, with their duration, status, the number of requests refused since the block started and the latest one. Add, edit and unblock blocks here. The form takes single addresses and networks in CIDR notation (at most /8 for IPv4, /16 for IPv6) and warns before you block your own address.
- Blocked IPs (.htaccess): the entries of the .htaccess file.
- Failed Logins: all recorded failed logins, with a button to delete old ones.
- Username Statistics (new in 2.0, #136): the usernames used in failed logins, how often, and the first and last attempt, as a "high score" of attacked usernames. Existing accounts are marked. These statistics are not affected by the purge of old failed logins; they start with the update to 2.0, seeded from the failed logins stored at that time.
- Allow List: addresses and networks that are never blocked.
- Log: BFStop's log file.
- Settings: all settings, the permissions (tab Permissions) and the versions of the installed parts (tab About).
- Information for IP Address: opened from an address in the lists; shows the address's location from the GeoIP database.
The permissions of the component are a tab of its settings page. Some actions need Configure (core.admin) in addition to the usual permission, because they can switch protection off or lock people out:
- changing the settings, viewing and clearing the log, sending the test notification;
- adding and changing entries of the allow list;
- adding entries to the .htaccess file, and removing them (with Delete);
- blocks of networks larger than /24 (IPv4) or /48 (IPv6).
Grant Configure only to people you trust with the web server's configuration: they can, among other things, choose the directory BFStop writes its .htaccess file into.
What administrators do in BFStop goes into Joomla!'s User Actions Log: blocks added, changed and lifted, allow list and .htaccess changes, settings changes (the names of the changed settings), and purging or clearing data and the log, as well as blocks lifted with an unblock link. The installation adds "Brute Force Stop" to the extensions the User Actions Log records (its option Events To Log).
Defaults are what BFStop uses while the settings have never been saved.
| Setting | Default | Description |
|---|---|---|
| Block Mode | Full Site | See Block modes. |
| Block threshold | 10 | Failed logins (2–25) an address is allowed before it is blocked, before the risk score is applied. |
| Block Duration | 1 Day | How long a block lasts: 5 minutes to 30 days, or unlimited. |
| Setting | Default | Description |
|---|---|---|
| Email Address(es) | (empty) | Addresses to notify, separated by semicolons. |
| Select a User | (none) | A user to notify. |
| User group notification | disabled | Notify all members of the User group. |
| User group | (none) | The group to notify. |
| User Block Message | disabled | Unblock emails to the blocked user. |
| Blocked msgs per day | 5 | Mails per day about blocks (never, 1–5, unlimited). |
| Failed msgs per day | never | Mails per day about failed logins. |
| Failed msgs only for existing accounts | disabled | Only mail about failed logins for existing accounts. |
| Setting | Default | Description |
|---|---|---|
| Behind a proxy / load balancer | disabled | See Proxies and load balancers. |
| Client IP header | X-Forwarded-For | The header with the client's address. |
| Proxy / load balancer IP address | (empty) | The trusted proxies. |
| Setting | Default | Description |
|---|---|---|
| Active for | Frontend, Backend, Web Services API | The parts of Joomla! BFStop protects. In the others, failed logins aren't counted and blocks aren't enforced (blocks in the web server aside). |
| Progressive Block Duration | disabled | See Repeat offenders. |
| Permanent after | 3 | See Repeat offenders. |
| Check interval | 1 Week | The time within which the failed logins of an address count. |
| Remaining attempts | disabled | See Hints. |
| Password reset reminder | When 1 attempt left | See Hints. |
| Blocked message | (standard message) | See The blocked page. |
| Show IP | disabled | Show the address on the blocked page. |
| Logging | Error | See Logging. |
| Log File Size Limit (MB) | 5 | See Logging. |
| Keep Log Entries (Days) | 28 | See Logging. |
| Usernames Not Matching an Account | Hash | See Usernames and privacy. |
| IPv6 Tracking Granularity | /56 | See IPv6. |
| Use HTTP Error | enabled | See The blocked page. |
| Prune old attempts | 4 | Weeks; see Maintenance. |
| .htaccess path | (site root) | Only with Full Site + .htaccess: the directory of the .htaccess file. |
| nginx Deny File | (empty) | Only with Full Site: see nginx deny file. |
| Setting | Default | Description |
|---|---|---|
| Detect Distributed Attacks on One Account | enabled | See Distributed attacks on one account. |
| Failed Attempts per Account | 20 | |
| Counting Window (Minutes) | 60 | |
| Risk Points While Under Attack | 3 |
| Setting | Default | Description |
|---|---|---|
| GeoIP Database Path | (empty) | See GeoIP database. |
| Setting | Default | Description |
|---|---|---|
| Enable GeoIP Signal / Home Countries / Geo Points | disabled / (empty) / 3 | See Adaptive risk scoring. |
| Enable Reverse-DNS Signal / Reverse-DNS Points | disabled / 2 | |
| Enable Known-IP Trust Signal / Known-IP Trust Points | enabled / 5 | |
| Enable Common-Username Signal / Common Usernames / Common-Username Points | enabled / admin, administrator, root, test, webmaster / 2 | |
| Enable Missing-User-Agent Signal / Missing-User-Agent Points | enabled / 2 | |
| Block Threshold Change Per Risk Point | 1 | |
| Minimum Allowed Attempts | 2 | At most the Block threshold. |
There are no delay settings any more: see Why No Delay Options in 2.0.
BFStop 2.x (upcoming)
- Download and Installation 2.x
- Configuration 2.x
- Feature Descriptions 2.x
- FAQ 2.x
- Known issues 2.x
- Upgrading to 2.0
- Why No Delay Options in 2.0
- Design Decision No Response Delays
BFStop 1.5.x (current stable)
General