Skip to content

Logins and behaviour Since v0.1 ​

Two groups of signals look at what a client does over time. Logins watch the login endpoints you name for failed attempts per client, per username and overall. Behaviour counts distinct paths, misses, content requests and tried values per client. Both add points to the client's bot score.

Before you begin ​

  • Role: operator for the application.
  • For logins: know the endpoint's path, where the username is sent, and how a failure looks (status codes or a redirect).
  • For scraping and enumeration: know the content paths and the endpoints where trying values finds accounts.
  • If many users share one address (an office), trust it first; see Fingerprints and clients.

Watch a login endpoint ​

text
1. Open Applications > All applications > the application > Request checks > Bot mitigation.
2. Open the Logins tab and add a login endpoint: name, path, where the username is, and how a failure looks.
3. Select Preview changes, add a comment and select Apply.
sh
waap bots list set -app shop -list login -f login.yaml -m "watch the login"
yaml
# policy.bots.login
- name: web-login
  path: /login
  username: "form:email"        # or json:/user/name, header:X-User
  failure_status: [401, 403]

With no thresholds written, the defaults apply: 10 failures per client in 5 minutes add 40 to its score. 5 failures for one username in 15 minutes, from any address, require a CAPTCHA for that username. A failed share of 50% or more over at least 200 attempts in 5 minutes requires a CAPTCHA for everyone.

Apps and APIs cannot run a CAPTCHA

For app and API logins use weights or block as the threshold action.

See the live counters ​

The Logins tab (and waap bots logins -app shop -window 1h) shows attempts, failure ratio, refusals, the failing clients and the targeted usernames. Usernames are redacted to the first character and a keyed hash.

Tune crawling, scanning, scraping and enumeration ​

text
1. Open Request checks > Bot mitigation, Behavior tab.
2. Change a threshold, or add the content paths for scraping or the endpoints for enumeration.
3. Select Preview changes, then Apply.
sh
waap bots set -app shop -m "behavior" behavior.crawl.distinct_paths=500 behavior.scan.weight=50 behavior.scrape.paths=/products/*
yaml
bots:
  behavior:
    scrape:
      paths: ["/products/*"]
    enumerate:
      paths: ["/users/*", "/password-reset"]
      parameter: email

Crawling and scanning are on by default. Scraping and enumeration are off until you list paths. Clients by score (waap bots clients -app shop) shows who is near a threshold.

A shared address

An office counts as one client. Raise a threshold, or trust the office with an access rule trust with skip: [bots], if it trips.

Settings reference ​

Login endpoint ​

SettingWhat it doesDefaultAllowed valuesApplies in
nameIdentifies the endpoint.none (required)lowercase letters, digits, dashes; uniqueall
pathThe login path.none (required)exact path or prefix ending in *all
methodsRequest methods counted.POSTGET, POST, PUT, PATCHall
usernameWhere the username is.noneform:NAME, json:/pointer, header:NAMErequired for per_username
failure_statusStatuses that mean a failed login.401, 403status 300 to 599all
failure_locationA redirect to this prefix means a failure.nonea path or an https URL prefixall
per_clientFailures per client: failures, per, then weight or action.10 in 5m, weight 40failures 1 to 1,000,000; per 1s to 24h; action log, challenge, captcha, blockall
per_usernameFailures for one username from any address.5 in 15m, action captchasameneeds username
globalFailed share of attempts: failure_ratio, min_attempts, per.0.5, 200, 5m, action captcharatio above 0 to 1all

Behaviour ​

Every weight is points from 0 to 100; every window is 10s to 24h.

SettingWhat it doesDefaultAllowed valuesApplies in
Crawling (behavior.crawl.enabled)Counts distinct paths per client.truetrue, falseall
behavior.crawl.distinct_paths, .per, .weightThreshold, window, points.300, 1m, 30up to 1000000 pathscrawling on
Scanning (behavior.scan.enabled)Counts 404, 403 and 401 answers, signature refusals and sensitive-path probes.truetrue, falseall
behavior.scan.not_found, .per, .weightThreshold, window, points.50, 1m, 40up to 1000000scanning on
Scraping: content paths (behavior.scrape.paths)Paths worth scraping.none (off)exact or prefix ending in *all
behavior.scrape.requests, .per, .weightThreshold, window, points.120, 1m, 30up to 1000000paths set
Scraping: only without assets (behavior.scrape.no_assets)Count only clients that fetched no images, styles, scripts or fonts.truetrue, falsepaths set
Enumeration: paths (behavior.enumerate.paths)Endpoints where trying values finds records.none (off)exact or prefix ending in *all
Enumeration: parameter (behavior.enumerate.parameter)The query or form parameter whose distinct values are counted.empty (the last path segment)a namepaths set
behavior.enumerate.distinct, .per, .weightThreshold, window, points.50, 5m, 50up to 1000000paths set

Examples ​

Watch a JSON login and a form login:

yaml
- name: api-login
  path: /api/login
  username: "json:/user/name"
  failure_status: [401]
- name: web-login
  path: /login
  username: "form:email"
  failure_location: /login?error

Limits ​

LimitValue
Login endpoints per application20
Login window1s to 24h
Countersper node, shared between nodes every 10 seconds

Troubleshooting ​

Users on one network trip the login thresholds ​

  • Cause: a shared address counts as one client.
  • Fix: trust the address list with an access rule trust and skip: [bots], or raise per_client.

Preview refuses a login endpoint ​

  • Cause: per_username needs username to say where the username is.
  • Fix: set username to form:FIELD, json:/pointer or header:NAME.