Skip to main content

Login protection — stop password guessing and credential stuffing

This feature runs by default for every domain; the Login Protection tab lets you view and change it.

Login protection counts failed logins on the domain's authentication paths, per client IP and per username, and blocks when a threshold is exceeded:

  • One "failure" = a request to an authentication path for which the origin returns 401 or 403.
  • Authentication paths = common built-in login URLs (containing /login, /signin, /auth, /token, /oauth, /session, /authenticate, /register, /signup…) plus any extra paths you add.
  • The username is read from a form/JSON field (username by default).

On by default for every domain. Until you customize it, a domain uses the built-in defaults: 5 failures per IP in 5 minutes, 20 per username in 1 hour, action Block. Deleting the custom configuration returns to the built-in defaults — protection stays on.

No JS Challenge. Login protection always blocks outright (or only logs); it never returns a JavaScript challenge page. JS challenges are only available in Firewall Rules, Rate Limiting, DDoS and Bot Management — see JS Challenge.

Use it when a botnet is mass-guessing passwords on your login form, or a single account is being tried from many IPs. Example: your /account/signin is not in the built-in list — add it to "Extra authentication paths" to protect it.

Before you start​

  • The domain has been added and points to VNIS.
  • The origin returns 401 or 403 for a failed login (if the origin returns 200 with an error message in the body, the edge does not recognize it as a failure).
  • To count per username: the login request sends the username in a form body (application/x-www-form-urlencoded) or JSON body.

How to configure​

  1. Go to Domains → select a domain → Login Protection tab, in the Security · Traffic defense & scoring group. The Built-in default badge means the domain is using the built-in defaults; Custom means it has been customized. Login protection tab: an explanation box "on by default for every domain (5 per IP in 5 minutes, 20 per username in 1 hour, Block)", the Enabled switch, Failures per IP 5, Per-IP window 300, Failures per username 20, Per-username window 3600, Action on violation Block / Log only, Username form field, Extra authentication paths, Count per hostname
  2. Adjust Failures per IP, Per-IP window (seconds, max 7200), Failures per username and Per-username window (seconds, max 7200).
  3. Choose the Action on violation: Block (default) or Log only.
  4. (Optional) Change the Username form field (for example email), add Extra authentication paths (one per line), and turn on Count per hostname (wildcard domains).
  5. Click Save and wait a few seconds for it to sync to the edge. To return to the built-in defaults, delete the custom configuration with the section's delete button (protection stays on).

Configuration fields​

FieldMeaningValuesDefaultNotes
EnabledTurns login protection on or off for the domainOn/offOnOff → the warning "credential-stuffing attempts are not limited" is shown
Failures per IPNumber of failures per IP within the window before blocking1–10005Exceeded → 429 Too Many Requests + Retry-After
Per-IP window (seconds, max 7200)Counting window per IP10–7200 seconds300 (5 minutes)Maximum 7200 (2 hours)
Failures per usernameNumber of failures per username (from any IP) before locking1–1000020Exceeded → 423 Locked for that username
Per-username window (seconds, max 7200)Counting window per username60–7200 seconds3600 (1 hour)Maximum 7200
Action on violationAction when a threshold is exceededBlock / Log onlyBlockSee the table below
Username form fieldName of the form/JSON field containing the username1–64 characters: letters, digits, _ . -usernameFor example email, login
Extra authentication paths (one per line)Authentication paths added to the built-in listUp to 50 lines; each line starts with /, ≥3 characters (up to 256), no spaces, cannot be just /—Saved in lowercase automatically; matching is case-insensitive
Count per hostname (wildcard domains)For wildcard domains, count separately for each actual hostnameOn/offOff—

Action on violation:

ActionPer IPPer usernameNotes
Block429 + Retry-After (time remaining in the window)423 Locked429 is used instead of 403 to be safe with CGNAT (many people sharing an IP are only delayed and can try again). No JS challenge
Log onlyOnly logs the violation; the request still goes throughOnly logsUse it to measure before switching to Block

Configuration examples​

Example 1 — Keep the defaults (recommended for most domains).

  • Nothing to do: 5 failures per IP per 5 minutes → 429; 20 failures per username per hour → 423.

Example 2 — Non-standard login pages and login by email.

  • Extra authentication paths: /account/signin, /api/v1/auth/token · Username form field: email.
  • Result: failures on these two paths are also counted; accounts are locked by email.
  • Check: send 6 failed logins in a row from the same IP to /account/signin → the next one receives 429 with Retry-After.

Example 3 — Measure before tightening thresholds.

  • Set the action to Log only and lower Failures per IP to 3 for a few days, then review the violation logs; if there are few false positives, switch back to Block.

Example 4 — A busy office where many users share one IP.

  • Raise Failures per IP (for example 30) but keep Failures per username — an account under attack is still locked, while the whole office does not get 429 because a few people mistyped.

Order of evaluation​

  • Login protection counts based on the origin's response (401/403) on authentication paths — it does not depend on the WAF or rate limiting.
  • Firewall allow/bypass and Access Control allow skip login protection (see Firewall Rules).
  • It can be combined with Rate Limiting (which limits the total number of requests to /login, including successful ones) — the two features are independent.

Troubleshooting​

SymptomCauseFix
Saving returns a window errorWindow > 7200 or below the minimum (IP 10, username 60)Set a value within range; maximum 7200 seconds
Saving returns a path errorA line does not start with /, is just /, is shorter than 3 characters, contains spaces, or there are more than 50 linesFix each line according to the rules in Configuration fields
Saving returns a Username form field errorInvalid characters or longer than 64 charactersUse only letters, digits, _ . -
Many failed logins are not blockedThe origin returns 200 for a wrong password, or the path is not in the listMake the origin return 401/403; add the path to Extra authentication paths
Real users receive 429 on the login pageMany people sharing an IP (CGNAT/office) mistyped their passwordsRaise Failures per IP; wait for Retry-After
An account receives 423The username exceeded the failure threshold from many IPs (a sign of an attack)Wait for the window to end (1 hour by default); consider asking the user to change their password

FAQ​

  • I have never configured it — is my domain protected? Yes. The built-in defaults are on for every domain (5 per IP per 5 minutes, 20 per username per hour, Block).
  • Why is the per-IP response 429 rather than 403? To be safe for users behind CGNAT: 429 + Retry-After tells the client to wait and try again, rather than permanently blocking everyone who shares the IP.
  • Is there a JS challenge page for login forms? No. Login protection does not use JS challenges. If you want to challenge browsers before they reach the login page, use a Firewall Rule with the JS Challenge action on the login HTML page (watch the fallback behavior for POST requests — see JS Challenge).
  • Does deleting the configuration turn protection off? No. Deleting only returns to the built-in defaults (still on). To turn it off completely, switch Enabled off and click Save.
  • How are extra paths matched? Case-insensitively; a request is counted if its path contains the configured string.