Appearance
Bot mitigation policy Since v0.2
The policy.bots section scores each client and acts on the score. Paths are relative to one entry of applications.
For the structure of the file, see Configuration file. Defaults of limits are also listed in Limits and defaults. A dash in Default means the code sets no default value (the setting is empty or off).
Bot mitigation
| Key | Type | Default | Allowed values / range | Meaning | Guide page |
|---|---|---|---|---|---|
applications[].policy.bots | object | — | — | Group of settings: bots. | Bot mitigation |
applications[].policy.bots.enabled | boolean | — | — | Turns the feature on or off. | Bot mitigation |
applications[].policy.bots.mode | string | — | detect, block | empty: same as the application (detect wins) | Bot mitigation |
applications[].policy.bots.score | object | — | — | Group of settings: score. | Bot mitigation |
applications[].policy.bots.score.half_life | duration | — | — | Sets half life. | Bot mitigation |
applications[].policy.bots.responses[] | list of object | — | — | Group of settings: responses. | Bot mitigation |
applications[].policy.bots.responses[].at | integer | — | — | Sets at. | Bot mitigation |
applications[].policy.bots.responses[].action | string | — | — | What happens on a match. | Bot mitigation |
applications[].policy.bots.responses[].for | duration | — | — | ban only | Bot mitigation |
applications[].policy.bots.known_clients[] | list of object | — | — | Group of settings: known clients. | Fingerprints and clients |
applications[].policy.bots.known_clients[].name | string | — | — | The name that identifies this entry. | Fingerprints and clients |
applications[].policy.bots.known_clients[].ja3 | list of string | — | — | Sets ja3. | Fingerprints and clients |
applications[].policy.bots.known_clients[].ja4 | list of string | — | — | Sets ja4. | Fingerprints and clients |
applications[].policy.bots.known_clients[].user_agent | string | — | — | RE2 | Fingerprints and clients |
applications[].policy.bots.known_clients[].action | string | — | — | no_challenge (default) or allow | Fingerprints and clients |
applications[].policy.bots.fingerprints | object | — | — | Group of settings: fingerprints. | Fingerprints and clients |
applications[].policy.bots.fingerprints.deny_lists | list of string | — | — | Sets deny lists. | Fingerprints and clients |
applications[].policy.bots.fingerprints.allow_lists | list of string | — | — | Sets allow lists. | Fingerprints and clients |
applications[].policy.bots.fingerprints.consistency | boolean | — | — | Sets consistency. | Fingerprints and clients |
applications[].policy.bots.weights | object | — | — | Group of settings: weights. | Bot mitigation |
applications[].policy.bots.weights.ua_missing | integer | — | — | Sets ua missing. | Bot mitigation |
applications[].policy.bots.weights.tls_mismatch | integer | — | — | Sets tls mismatch. | Bot mitigation |
applications[].policy.bots.weights.http_mismatch | integer | — | — | Sets http mismatch. | Bot mitigation |
applications[].policy.bots.weights.category | integer | — | — | Category the entry belongs to. | Bot mitigation |
applications[].policy.bots.weights.automation | integer | — | — | Sets automation. | Bot mitigation |
applications[].policy.bots.weights.verify_failed | integer | — | — | Sets verify failed. | Bot mitigation |
applications[].policy.bots.weights.signature_invalid | integer | — | — | signature_invalid is added for a signed request whose signature does not verify. | Bot mitigation |
applications[].policy.bots.weights.challenge_ignored | integer | — | — | challenge_ignored is added when a client keeps getting challenges without solving them. | Bot mitigation |
applications[].policy.bots.weights.token_invalid | integer | — | — | token_invalid is added for a token that does not verify (copied from another client, forged); an expired token is not a signal. | Bot mitigation |
applications[].policy.bots.categories | object | — | — | Group of settings: categories. | Bot mitigation |
applications[].policy.bots.categories.search_engine | string | — | — | Sets search engine. | Bot mitigation |
applications[].policy.bots.categories.ai_crawler | string | — | — | Sets ai crawler. | Bot mitigation |
applications[].policy.bots.categories.seo_tool | string | — | — | Sets seo tool. | Bot mitigation |
applications[].policy.bots.categories.monitoring | string | — | — | Sets monitoring. | Bot mitigation |
applications[].policy.bots.categories.social_preview | string | — | — | Sets social preview. | Bot mitigation |
applications[].policy.bots.categories.feed_reader | string | — | — | Sets feed reader. | Bot mitigation |
applications[].policy.bots.categories.advertising | string | — | — | Sets advertising. | Bot mitigation |
applications[].policy.bots.categories.archiver | string | — | — | Sets archiver. | Bot mitigation |
applications[].policy.bots.categories.academic | string | — | — | Sets academic. | Bot mitigation |
applications[].policy.bots.categories.http_library | string | — | — | Sets http library. | Bot mitigation |
applications[].policy.bots.categories.automation | string | — | — | Sets automation. | Bot mitigation |
applications[].policy.bots.categories.scanner | string | — | — | Sets scanner. | Bot mitigation |
applications[].policy.bots.non_browser | string | — | — | non_browser replaces challenge steps for clients that cannot run a challenge (API calls, apps, anything but a page navigation): log or block. | Bot mitigation |
applications[].policy.bots.challenge | object | — | — | Group of settings: challenge. | Challenges |
applications[].policy.bots.challenge.path | string | — | — | reserved path prefix answered by inspection | Challenges |
applications[].policy.bots.challenge.token_ttl | duration | — | — | how long a token is valid | Challenges |
applications[].policy.bots.challenge.key_rotation | duration | — | — | a new signing key this often; two are valid | Challenges |
applications[].policy.bots.challenge.bind | object | — | — | what a token is bound to | Challenges |
applications[].policy.bots.challenge.bind.ipv4_prefix | integer | — | — | Sets ipv4 prefix. | Challenges |
applications[].policy.bots.challenge.bind.ipv6_prefix | integer | — | — | Sets ipv6 prefix. | Challenges |
applications[].policy.bots.challenge.bind.tls_fingerprint | boolean | — | — | Sets tls fingerprint. | Challenges |
applications[].policy.bots.challenge.work | integer | — | — | expected proof-of-work hashes | Challenges |
applications[].policy.bots.challenge.ignored_after | integer | — | — | challenges per 10 minutes before bot.challenge.ignored | Challenges |
applications[].policy.bots.challenge.skip | list of string | — | — | paths never challenged (health checks) | Challenges |
applications[].policy.bots.challenge.page | string | — | — | Sets page. | Challenges |
applications[].policy.bots.captcha | object | — | — | Group of settings: captcha. | Challenges |
applications[].policy.bots.captcha.provider | string | — | — | self, turnstile, hcaptcha, recaptcha | Challenges |
applications[].policy.bots.captcha.site_key | string | — | — | Sets site key. | Challenges |
applications[].policy.bots.captcha.work | integer | — | — | self: expected hashes after the button | Challenges |
applications[].policy.bots.captcha.timeout | duration | — | — | Time allowed before the operation is abandoned. | Challenges |
applications[].policy.bots.captcha.proxy | string | — | — | outbound proxy for provider calls | Challenges |
applications[].policy.bots.captcha.verify_url | string | — | — | the provider's verification URL (a mirror, a test double) | Challenges |
applications[].policy.bots.captcha.page | string | — | — | Sets page. | Challenges |
applications[].policy.bots.tarpit | object | — | — | Group of settings: tarpit. | Bot mitigation |
applications[].policy.bots.tarpit.delay | duration | — | — | Sets delay. | Bot mitigation |
applications[].policy.bots.tarpit.max_concurrent | integer | — | — | per node; over it, tarpit steps block at once | Bot mitigation |
applications[].policy.bots.login[] | list of object | — | — | Group of settings: login. | Logins and behavior |
applications[].policy.bots.login[].name | string | — | — | The name that identifies this entry. | Logins and behavior |
applications[].policy.bots.login[].path | string | — | — | exact, or a prefix ending in * | Logins and behavior |
applications[].policy.bots.login[].methods | list of string | POST | — | default POST | Logins and behavior |
applications[].policy.bots.login[].username | string | — | — | form:NAME, json:/pointer, header:NAME | Logins and behavior |
applications[].policy.bots.login[].failure_status | list of integer | 401 | — | default 401, 403 | Logins and behavior |
applications[].policy.bots.login[].failure_location | string | — | — | a redirect to this prefix is a failure | Logins and behavior |
applications[].policy.bots.login[].per_client | object | — | — | Group of settings: per client. | Logins and behavior |
applications[].policy.bots.login[].per_client.failures | integer | — | — | Sets failures. | Logins and behavior |
applications[].policy.bots.login[].per_client.per | duration | — | — | Sets per. | Logins and behavior |
applications[].policy.bots.login[].per_client.weight | integer | — | — | Weight of this signal in the score. | Logins and behavior |
applications[].policy.bots.login[].per_client.action | string | — | — | log, challenge, captcha, block | Logins and behavior |
applications[].policy.bots.login[].per_username | object | — | — | Group of settings: per username. | Logins and behavior |
applications[].policy.bots.login[].per_username.failures | integer | — | — | Sets failures. | Logins and behavior |
applications[].policy.bots.login[].per_username.per | duration | — | — | Sets per. | Logins and behavior |
applications[].policy.bots.login[].per_username.weight | integer | — | — | Weight of this signal in the score. | Logins and behavior |
applications[].policy.bots.login[].per_username.action | string | — | — | log, challenge, captcha, block | Logins and behavior |
applications[].policy.bots.login[].global | object | — | — | Group of settings: global. | Logins and behavior |
applications[].policy.bots.login[].global.failure_ratio | number | — | — | Sets failure ratio. | Logins and behavior |
applications[].policy.bots.login[].global.min_attempts | integer | — | — | Sets min attempts. | Logins and behavior |
applications[].policy.bots.login[].global.per | duration | — | — | Sets per. | Logins and behavior |
applications[].policy.bots.login[].global.weight | integer | — | — | Weight of this signal in the score. | Logins and behavior |
applications[].policy.bots.login[].global.action | string | — | — | What happens on a match. | Logins and behavior |
applications[].policy.bots.behavior | object | — | — | Group of settings: behavior. | Logins and behavior |
applications[].policy.bots.behavior.crawl | ? | — | — | Sets crawl. | Logins and behavior |
applications[].policy.bots.behavior.scan | ? | — | — | Sets scan. | Logins and behavior |
applications[].policy.bots.behavior.scrape | ? | — | — | Sets scrape. | Logins and behavior |
applications[].policy.bots.behavior.enumerate | ? | — | — | Sets enumerate. | Logins and behavior |
Example
yaml
version: 2
listeners:
- {name: web, address: "0.0.0.0:8080", protocol: http}
server_pools:
- name: shop
servers:
- {address: "127.0.0.1:9000", weight: 1, state: active}
applications:
- name: shop
hostnames: [shop.example.com]
listeners: [web]
server_pool: shop
policy:
bots:
mode: detect
weights: {tls_mismatch: 40}
score: {half_life: 30m}
responses:
- {at: 30, action: challenge}
- {at: 70, action: block}
- {at: 95, action: ban, for: 1h}