User Agent Setting

How to Set Up User-Agent Blocking?

  • Sites → Sites Settings → Firewall → User Agent Setting → Create

Add User Agent Field Descriptions

  • URL: Specify the domain being accessed. You can enter a direct domain or use regex for matching:

    • Example:

      • gerrard.cdn-cname.com

      • https?:\/\/gerrard.cdn-cname.com(.*)

  • User-Agent: Specify the User-Agent you want to block; must be in regex format.

  • Protect Mode: There are three options:

    • DENY: Rejects connections with the specified User-Agent. The client will see a 403 Forbidden error.

    • DROP: Drops connections with the specified User-Agent. The client will see a Connection reset by peer error.

    • DROP + Blacklist: Drops connections with the specified User-Agent and adds the source IP to the blacklist.

Blocking Example

  • Example Domain: gerrard.cdn-cname.com

  • User-Agent to Block: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36

  • Command Test: curl -v -k https://gerrard.cdn-cname.com -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36'

  • Test for Blocking Success

Last updated