Serving challenges with interstitial pages

IMPORTANT: This guide only applies to customers who have deployed Bot Management with post-cache inspection. If you've deployed Bot Management with pre-cache inspection (ContentGuard) or are using Fastly DDoS Protection, check out our Getting started with client challenges guide instead.

With interstitial pages, you can deploy client challenges without touching your application code. Fastly serves a temporary page to run the challenge before loading the requested content. All configuration happens in the control panel, and you can choose from dynamic, non-interactive, and interactive challenge types.

HINT: Have a React or single-page application? Embed a dynamic challenge within your web application. React and single-page applications don't handle interstitial pages well.

Prerequisites

Before setting up client challenges, you must deploy Bot Management using post-cache inspection on each CDN service where you intend to use them. Compute services are not supported.

Adding challenges

To serve a challenge on an interstitial page, complete the following steps:

  1. Fastly control panel
  2. Next-Gen WAF control panel
  1. Log in to the Fastly control panel.
  2. Go to Security > Next-Gen WAF > Rules.
  3. From the workspaces bar, click the menu Menu icon to the right of the workspace name and select a workspace.
  4. Click Add workspace rule.

  5. In the Type area, select Request to challenge all requests matching your conditions or Rate limit to challenge requests only when they exceed a defined threshold. For more information, check out our About rules guides.

  6. In the Conditions area, define where the rule should send the challenge. For example, to send a challenge to all request traffic destined for www.example.com/login, create the following conditions:

    ConditionFieldOperatorValue
    1MethodEqualsGET
    2DomainEqualswww.example.com
    3PathEquals/login
  7. (Optional) In the Conditions area, add conditions to restrict when the rule should send the challenge. For example, if you don't want to send challenges to requests with the VERIFIED-BOT signal, add the following condition:

    • From the first Field menu, select Signal.
    • From the first Operator menu, select Does not exist where.
    • Select All to specify that a request must meet every condition.
    • From the second Field menu, select Signal ID.
    • From the second Operator menu, select Equals.
    • From the Value menu, select Verified Bot.

    In the Fastly control panel, the settings would appear like this:

    Verified bots condition group

  8. In the Actions area, define the type of challenge the rule should send.

    Challenge typeActions area
    Dynamic challengeFrom the Action type menu, select Dynamic challenge.
    Non-interactive challengeFrom the Action type menu, select Browser challenge and leave the Allow Interactive switch disabled.
    Interactive challengeFrom the Action type menu, select Browser challenge and enable the Allow Interactive switch.
  9. Fill out the fields in the Details area as follows:

    • In the Description field, enter a description for the rule.
    • Leave the Status switch for the rule enabled.
  10. Click Create workspace rule.

After adding a challenge, you can optionally: