You can configure a User-Agent blacklist or whitelist to authenticate and filter visitors. This can restrict access to Dynamic Route for CDN (DCDN) resources and improve DCDN security. This topic describes how to configure a User-Agent blacklist or whitelist.

Background information

If you need to implement access control based on the User-Agent field, you must configure a User-Agent blacklist or whitelist to filter requests.
  • User-Agent blacklist: The User-Agent fields in the blacklist cannot be used to access resources.

    If your User-Agent field is added to the blacklist, a request with the User-Agent field can be sent to a DCDN node. However, the DCDN node rejects the request and returns a 403 error. The requests that contain the User-Agent fields in the blacklist are recorded in DCDN logs.

  • User-Agent whitelist: Only User-Agent fields in the whitelist can be used to access resources.

Procedure

  1. Log on to the DCDN console.
  2. In the left-side navigation pane, click Domain Names.
  3. On the Domain Names page, find the domain name that you want to manage, and click Configure in the Actions column.
  4. In the left-side navigation pane on the details page of the specified domain, click Access Control.
  5. On the right side of the page that appears, click the User-Agent Black/White List tab.
  6. Turn on User-Agent Black/White List, and configure a User-Agent Blacklist or Whitelist as prompted.
    Configure User-Agent rules
    Parameter Description
    Type
    The following two types are supported:
    • Blacklist

      The User-Agent fields in the blacklist cannot be used to access the current resources.

    • Whitelist

      Only User-Agent fields in the whitelist can be used to access the current resources.

    Blacklists and whitelists are mutually exclusive. The most recent configuration takes effect.

    Rules When you configure the User-Agent fields, separate values with vertical bars (|). The User-Agent fields can contain wildcards (*), such as *curl*|*IE*|*chrome*|*firefox*
  7. Click OK.