Appearance
Challenges and CAPTCHA Since v0.1
A challenge step sends a browser navigation to a page that runs a short proof of work and sets a token cookie. A captcha step asks for a CAPTCHA: our own self-hosted one, or Turnstile, hCaptcha or reCAPTCHA. API calls, apps and scripts are never sent these pages.
Before you begin
- Role:
operatorfor the application. Changing the secret and the keys is recorded in the audit log. - Add a
challengeorcaptchastep to the response ladder. - A third-party CAPTCHA needs outbound HTTPS from the inspection nodes to the provider, or an outbound proxy.
Set the challenge
The token lifetime, the proof-of-work size and the paths never challenged are settings of the Challenge group.
text
1. Open Applications > All applications > the application > Request checks > Bot mitigation.
2. Open the Challenge and CAPTCHA tab, Challenge section.
3. Change Token lifetime, Proof of work or Never challenge these paths.
4. Select Preview changes, then Apply.sh
waap bots set -app shop -m "challenge" challenge.token_ttl=1h challenge.work=100000 challenge.skip=/healthz,/status*yaml
bots:
challenge:
token_ttl: 1h
work: 100000
skip: ["/healthz", "/status*"]Clients that cannot run the challenge get the Clients that cannot run a challenge action (log by default, or block). The dashboard shows challenges solved of those sent.
Exclude health checks
Put health checks and status pages under Never challenge these paths. A challenge step logs there instead. Block and ban steps still apply.
Use a CAPTCHA
The self-hosted CAPTCHA needs nothing else. For a third-party provider:
text
1. Open the Challenge and CAPTCHA tab, CAPTCHA section.
2. Choose the Provider and enter the Site key. Select Preview changes, then Apply.
3. Enter the provider's secret and select Save secret.
4. Select Test with the provider.sh
waap bots set -app shop -m "captcha" captcha.provider=turnstile captcha.site_key=0x4AAA...
waap bots captcha set -app shop < secret.txt
waap bots captcha test -app shopyaml
# the secret is never in the configuration
bots:
captcha:
provider: turnstile
site_key: "0x4AAA..."Remove the secret (waap bots captcha remove -app shop) to return to the self-hosted CAPTCHA. waap bots captcha get -app shop shows the provider, site key and whether a secret is set, never the secret.
Provider outages
When the provider cannot verify, the application's failure policy decides: fail-open lets the client through with a short JavaScript-level token, fail-closed asks to try again.
Rotate the signing keys
The active node creates the signing keys when bot mitigation is turned on and rotates them every Key rotation. The Challenge tab shows when each was made, never the key. Rotate at once after a suspected leak. Tokens signed before the previous rotation stop working and their browsers are challenged again.
text
1. Open the Challenge and CAPTCHA tab, Signing keys section.
2. Select Rotate now and confirm.sh
waap bots challenge-keys list -app shop
waap bots challenge-keys rotate -app shopUse your own page
The challenge and CAPTCHA pages can be replaced. The page needs exactly once and may use , , and . At most 64 KiB.
text
1. Open the Challenge and CAPTCHA tab and the page section for the challenge or the CAPTCHA.
2. Enter or upload the HTML and select Preview changes, then Apply.
3. To go back, tick Use the built-in challenge page (or CAPTCHA page).sh
waap bots page set -app shop -kind challenge -m "own page" -f page.html
waap bots page reset -app shop -kind challengeyaml
# policy.bots.challenge.page (and captcha.page) holds the HTMLSettings reference
Challenge
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Token lifetime (challenge.token_ttl) | How long a solved challenge lets the client through. | 30m | 1m to 168h | challenge steps |
Key rotation (challenge.key_rotation) | A new signing key this often; the previous one stays valid until the next rotation. | 24h | 1h to 2160h; at least the token lifetime | challenge steps |
Bind to IPv4 network (challenge.bind.ipv4_prefix) | A token works from addresses in the same network of this size. | 24 | 8 to 32 bits | challenge steps |
Bind to IPv6 network (challenge.bind.ipv6_prefix) | Same, for IPv6. | 64 | 16 to 128 bits | challenge steps |
Bind to the TLS fingerprint (challenge.bind.tls_fingerprint) | A token works only from the TLS stack (JA4) that solved it. | true | true, false | HTTPS listeners |
Proof of work (challenge.work) | Expected SHA-256 computations to solve it. | 50000 | 1000 to 10000000 | challenge steps |
Ignored after (challenge.ignored_after) | Challenges within 10 minutes without a solve before bot.challenge.ignored is added. | 5 | up to 1000 | challenge steps |
Never challenge these paths (challenge.skip) | Paths where challenge steps log instead. | none | exact paths or prefixes ending in * | challenge steps |
Reserved path (challenge.path) | Path prefix inspection answers itself; requests under it never reach the server. | /.waap/ | a path prefix | challenge steps |
CAPTCHA
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Provider (captcha.provider) | Which CAPTCHA to show. | self | self, turnstile, hcaptcha, recaptcha | captcha steps |
Site key (captcha.site_key) | The provider's public key. | none | text | third-party providers |
Work after the button (captcha.work) | Self-hosted: computations after the button is pressed. | 300000 | 1000 to 50000000 | provider self |
Provider timeout (captcha.timeout) | How long a provider's verification may take. | 5s | 1s to 15s | third-party providers |
Outbound proxy (captcha.proxy) | Proxy for calls to the provider. | none (direct) | a URL | third-party providers |
Verification URL (captcha.verify_url) | Overrides the provider's verification endpoint, for a mirror or a test double. | none | a URL | third-party providers |
Tarpit
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Tarpit delay (tarpit.delay) | How long a tarpit step holds the refusal. | 10s | 1s to 60s | tarpit steps |
Tarpit capacity (tarpit.max_concurrent) | Refusals held at once on a node. | 200 | up to 10000 | tarpit steps; over it, steps block at once |
Examples
Challenge at 30, then a CAPTCHA at 60, with a longer token:
yaml
bots:
challenge: {token_ttl: 2h}
responses:
- { at: 30, action: challenge }
- { at: 60, action: captcha }
- { at: 90, action: block }Limits
| Limit | Value |
|---|---|
| Custom page size | 64 KiB |
| Signing keys | one signs, the previous still verifies |
| Provider call | up to 15s |
Troubleshooting
Users loop on the challenge page
- Cause: the token is bound to a network or TLS fingerprint that changes between requests.
- Fix: widen Bind to IPv4 network, or turn off Bind to the TLS fingerprint.
Third-party CAPTCHA never loads
- Cause: the inspection node cannot reach the provider.
- Check: Test with the provider or
waap bots captcha test -app shop. - Fix: allow outbound HTTPS to the provider, or set Outbound proxy.