Skip to content

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 ​

KeyTypeDefaultAllowed values / rangeMeaningGuide page
applications[].policy.botsobject——Group of settings: bots.Bot mitigation
applications[].policy.bots.enabledboolean——Turns the feature on or off.Bot mitigation
applications[].policy.bots.modestring—detect, blockempty: same as the application (detect wins)Bot mitigation
applications[].policy.bots.scoreobject——Group of settings: score.Bot mitigation
applications[].policy.bots.score.half_lifeduration——Sets half life.Bot mitigation
applications[].policy.bots.responses[]list of object——Group of settings: responses.Bot mitigation
applications[].policy.bots.responses[].atinteger——Sets at.Bot mitigation
applications[].policy.bots.responses[].actionstring——What happens on a match.Bot mitigation
applications[].policy.bots.responses[].forduration——ban onlyBot mitigation
applications[].policy.bots.known_clients[]list of object——Group of settings: known clients.Fingerprints and clients
applications[].policy.bots.known_clients[].namestring——The name that identifies this entry.Fingerprints and clients
applications[].policy.bots.known_clients[].ja3list of string——Sets ja3.Fingerprints and clients
applications[].policy.bots.known_clients[].ja4list of string——Sets ja4.Fingerprints and clients
applications[].policy.bots.known_clients[].user_agentstring——RE2Fingerprints and clients
applications[].policy.bots.known_clients[].actionstring——no_challenge (default) or allowFingerprints and clients
applications[].policy.bots.fingerprintsobject——Group of settings: fingerprints.Fingerprints and clients
applications[].policy.bots.fingerprints.deny_listslist of string——Sets deny lists.Fingerprints and clients
applications[].policy.bots.fingerprints.allow_listslist of string——Sets allow lists.Fingerprints and clients
applications[].policy.bots.fingerprints.consistencyboolean——Sets consistency.Fingerprints and clients
applications[].policy.bots.weightsobject——Group of settings: weights.Bot mitigation
applications[].policy.bots.weights.ua_missinginteger——Sets ua missing.Bot mitigation
applications[].policy.bots.weights.tls_mismatchinteger——Sets tls mismatch.Bot mitigation
applications[].policy.bots.weights.http_mismatchinteger——Sets http mismatch.Bot mitigation
applications[].policy.bots.weights.categoryinteger——Category the entry belongs to.Bot mitigation
applications[].policy.bots.weights.automationinteger——Sets automation.Bot mitigation
applications[].policy.bots.weights.verify_failedinteger——Sets verify failed.Bot mitigation
applications[].policy.bots.weights.signature_invalidinteger——signature_invalid is added for a signed request whose signature does not verify.Bot mitigation
applications[].policy.bots.weights.challenge_ignoredinteger——challenge_ignored is added when a client keeps getting challenges without solving them.Bot mitigation
applications[].policy.bots.weights.token_invalidinteger——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.categoriesobject——Group of settings: categories.Bot mitigation
applications[].policy.bots.categories.search_enginestring——Sets search engine.Bot mitigation
applications[].policy.bots.categories.ai_crawlerstring——Sets ai crawler.Bot mitigation
applications[].policy.bots.categories.seo_toolstring——Sets seo tool.Bot mitigation
applications[].policy.bots.categories.monitoringstring——Sets monitoring.Bot mitigation
applications[].policy.bots.categories.social_previewstring——Sets social preview.Bot mitigation
applications[].policy.bots.categories.feed_readerstring——Sets feed reader.Bot mitigation
applications[].policy.bots.categories.advertisingstring——Sets advertising.Bot mitigation
applications[].policy.bots.categories.archiverstring——Sets archiver.Bot mitigation
applications[].policy.bots.categories.academicstring——Sets academic.Bot mitigation
applications[].policy.bots.categories.http_librarystring——Sets http library.Bot mitigation
applications[].policy.bots.categories.automationstring——Sets automation.Bot mitigation
applications[].policy.bots.categories.scannerstring——Sets scanner.Bot mitigation
applications[].policy.bots.non_browserstring——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.challengeobject——Group of settings: challenge.Challenges
applications[].policy.bots.challenge.pathstring——reserved path prefix answered by inspectionChallenges
applications[].policy.bots.challenge.token_ttlduration——how long a token is validChallenges
applications[].policy.bots.challenge.key_rotationduration——a new signing key this often; two are validChallenges
applications[].policy.bots.challenge.bindobject——what a token is bound toChallenges
applications[].policy.bots.challenge.bind.ipv4_prefixinteger——Sets ipv4 prefix.Challenges
applications[].policy.bots.challenge.bind.ipv6_prefixinteger——Sets ipv6 prefix.Challenges
applications[].policy.bots.challenge.bind.tls_fingerprintboolean——Sets tls fingerprint.Challenges
applications[].policy.bots.challenge.workinteger——expected proof-of-work hashesChallenges
applications[].policy.bots.challenge.ignored_afterinteger——challenges per 10 minutes before bot.challenge.ignoredChallenges
applications[].policy.bots.challenge.skiplist of string——paths never challenged (health checks)Challenges
applications[].policy.bots.challenge.pagestring——Sets page.Challenges
applications[].policy.bots.captchaobject——Group of settings: captcha.Challenges
applications[].policy.bots.captcha.providerstring——self, turnstile, hcaptcha, recaptchaChallenges
applications[].policy.bots.captcha.site_keystring——Sets site key.Challenges
applications[].policy.bots.captcha.workinteger——self: expected hashes after the buttonChallenges
applications[].policy.bots.captcha.timeoutduration——Time allowed before the operation is abandoned.Challenges
applications[].policy.bots.captcha.proxystring——outbound proxy for provider callsChallenges
applications[].policy.bots.captcha.verify_urlstring——the provider's verification URL (a mirror, a test double)Challenges
applications[].policy.bots.captcha.pagestring——Sets page.Challenges
applications[].policy.bots.tarpitobject——Group of settings: tarpit.Bot mitigation
applications[].policy.bots.tarpit.delayduration——Sets delay.Bot mitigation
applications[].policy.bots.tarpit.max_concurrentinteger——per node; over it, tarpit steps block at onceBot mitigation
applications[].policy.bots.login[]list of object——Group of settings: login.Logins and behavior
applications[].policy.bots.login[].namestring——The name that identifies this entry.Logins and behavior
applications[].policy.bots.login[].pathstring——exact, or a prefix ending in *Logins and behavior
applications[].policy.bots.login[].methodslist of stringPOST—default POSTLogins and behavior
applications[].policy.bots.login[].usernamestring——form:NAME, json:/pointer, header:NAMELogins and behavior
applications[].policy.bots.login[].failure_statuslist of integer401—default 401, 403Logins and behavior
applications[].policy.bots.login[].failure_locationstring——a redirect to this prefix is a failureLogins and behavior
applications[].policy.bots.login[].per_clientobject——Group of settings: per client.Logins and behavior
applications[].policy.bots.login[].per_client.failuresinteger——Sets failures.Logins and behavior
applications[].policy.bots.login[].per_client.perduration——Sets per.Logins and behavior
applications[].policy.bots.login[].per_client.weightinteger——Weight of this signal in the score.Logins and behavior
applications[].policy.bots.login[].per_client.actionstring——log, challenge, captcha, blockLogins and behavior
applications[].policy.bots.login[].per_usernameobject——Group of settings: per username.Logins and behavior
applications[].policy.bots.login[].per_username.failuresinteger——Sets failures.Logins and behavior
applications[].policy.bots.login[].per_username.perduration——Sets per.Logins and behavior
applications[].policy.bots.login[].per_username.weightinteger——Weight of this signal in the score.Logins and behavior
applications[].policy.bots.login[].per_username.actionstring——log, challenge, captcha, blockLogins and behavior
applications[].policy.bots.login[].globalobject——Group of settings: global.Logins and behavior
applications[].policy.bots.login[].global.failure_rationumber——Sets failure ratio.Logins and behavior
applications[].policy.bots.login[].global.min_attemptsinteger——Sets min attempts.Logins and behavior
applications[].policy.bots.login[].global.perduration——Sets per.Logins and behavior
applications[].policy.bots.login[].global.weightinteger——Weight of this signal in the score.Logins and behavior
applications[].policy.bots.login[].global.actionstring——What happens on a match.Logins and behavior
applications[].policy.bots.behaviorobject——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}