Appearance
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:
operatorfor 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: emailCrawling 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
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
name | Identifies the endpoint. | none (required) | lowercase letters, digits, dashes; unique | all |
path | The login path. | none (required) | exact path or prefix ending in * | all |
methods | Request methods counted. | POST | GET, POST, PUT, PATCH | all |
username | Where the username is. | none | form:NAME, json:/pointer, header:NAME | required for per_username |
failure_status | Statuses that mean a failed login. | 401, 403 | status 300 to 599 | all |
failure_location | A redirect to this prefix means a failure. | none | a path or an https URL prefix | all |
per_client | Failures per client: failures, per, then weight or action. | 10 in 5m, weight 40 | failures 1 to 1,000,000; per 1s to 24h; action log, challenge, captcha, block | all |
per_username | Failures for one username from any address. | 5 in 15m, action captcha | same | needs username |
global | Failed share of attempts: failure_ratio, min_attempts, per. | 0.5, 200, 5m, action captcha | ratio above 0 to 1 | all |
Behaviour
Every weight is points from 0 to 100; every window is 10s to 24h.
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Crawling (behavior.crawl.enabled) | Counts distinct paths per client. | true | true, false | all |
behavior.crawl.distinct_paths, .per, .weight | Threshold, window, points. | 300, 1m, 30 | up to 1000000 paths | crawling on |
Scanning (behavior.scan.enabled) | Counts 404, 403 and 401 answers, signature refusals and sensitive-path probes. | true | true, false | all |
behavior.scan.not_found, .per, .weight | Threshold, window, points. | 50, 1m, 40 | up to 1000000 | scanning on |
Scraping: content paths (behavior.scrape.paths) | Paths worth scraping. | none (off) | exact or prefix ending in * | all |
behavior.scrape.requests, .per, .weight | Threshold, window, points. | 120, 1m, 30 | up to 1000000 | paths set |
Scraping: only without assets (behavior.scrape.no_assets) | Count only clients that fetched no images, styles, scripts or fonts. | true | true, false | paths 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 name | paths set |
behavior.enumerate.distinct, .per, .weight | Threshold, window, points. | 50, 5m, 50 | up to 1000000 | paths 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?errorLimits
| Limit | Value |
|---|---|
| Login endpoints per application | 20 |
| Login window | 1s to 24h |
| Counters | per 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
trustandskip: [bots], or raiseper_client.
Preview refuses a login endpoint
- Cause:
per_usernameneedsusernameto say where the username is. - Fix: set
usernametoform:FIELD,json:/pointerorheader:NAME.
Related
- Bot mitigation
- Fingerprints and clients
- Sessions: the login endpoint also names the user in events.