Skip to main content

Custom Headers

What custom headers do​

Some websites use a firewall or bot protection service, such as Cloudflare or AWS WAF, that blocks automated visitors. Osano's compliance check is an automated visitor, so these tools can block it and stop the scan from finishing.

Custom headers solve this. A custom header is a name and a secret value that Osano attaches to every request it makes to your website. Your firewall looks for that value and lets the request through. It works like a guest list: anyone who gives the right name at the door gets in.

Custom headers work even if your firewall doesn't support Osano's verified bot identity.

On Cloudflare? Try Verified Bots first. It needs no secret value and no custom rule.

Before you start​

You'll need:

  • An Osano account that shows Custom headers in your account menu (see Step 1).
  • Access to your firewall settings, or the person on your team who manages them. This is often IT, security, or your web developer.
  • A secret value. Choose something long and hard to guess, like a password: for example, 20 or more random letters and numbers. Don't reuse a real password.

Step 1: Open Custom headers​

  1. In Osano, select your name in the bottom-left corner.
  2. Select Custom headers from the menu.

You can also get there from Compliance Check. Select Custom headers in the top-right corner of the page, or select New Site and then Manage Header Groups at the bottom of the dialog.

If you don't see Custom headers, contact Osano Support.

Step 2: Create a header group​

A header group holds the header your firewall will look for. Most websites need one group with one header.

Select New Header Group, then fill in the form:

  • Group name: A name that helps you recognize the group, such as the name of your firewall (for example, "Cloudflare"). Only your team sees this name.
  • Jurisdiction scope: Leave this as it is.
  • Header name: The label your firewall will look for. We recommend X-Osano-Scan.
  • Header value: Your secret value. Select the eye icon to show or hide it.

Select Save. Save a copy of the header name and value somewhere secure, such as a password manager. You'll need both in Step 4.

After you save, your group appears on the page with 0 domains. You can come back to this page at any time to change the group's name, headers, or values.

If your firewall needs more than one header, select Add Another Header. Most firewalls need only one.

Step 3: Assign the group to your website​

Osano sends your headers only to the websites you assign. You can assign them in either of two ways.

Option A: From the Custom headers page​

  1. On your header group, select Assign Domains.
  2. Search for your website, then check the box next to it.
  3. Select Save.

The group's count updates, for example to 1 domain. The next time you open Assign Domains, your website is listed under Assigned to this group.

Option B: From your website's settings​

  1. Go to Compliance Check and open your website.
  2. Select the ⋮ menu next to Scan, then select Edit.
  3. Under Header groups (optional), select your header group.
  4. Select Save.

You can also choose a header group when you add a new website with New Site.

Good to know​

  • Assigning a group to example.com also covers www.example.com.
  • A website can use more than one header group. Checking a website adds this group and keeps any others it already has. Unchecking it removes only this group.

Step 4: Add a rule to your firewall​

You set up this rule in your firewall, not in Osano. If someone else manages your firewall, send them:

  • The header name
  • The header value, shared securely (not in a regular email or chat message)
  • Your website address, with and without www
  • A link to this page

The rule tells your firewall: if a request is for my website and it carries this header with this exact value, let it through. For example:

(host is example.com OR www.example.com)
AND (X-Osano-Scan equals your configured value)

Replace example.com, X-Osano-Scan, and your configured value with your own settings.

Rule checklist​

  • Copy the value exactly. The value must match character for character, including capital letters, with no extra spaces. Header names are not case-sensitive.
  • Include both addresses. Add your website with and without www (for example, example.com and www.example.com).
  • Allow everything the scan needs. That includes your web pages, the files they load, /robots.txt, and /.well-known/gpc.json if your site has one. Osano sends the header only to your website and its www address. Files served from another subdomain or site behind the same firewall (for example, cdn.example.com) arrive without the header, so this rule alone won't let them through.
  • Put this rule first. Firewalls check rules in order, so place this rule above the rule that blocks the scan.

Cloudflare​

  • Create a custom rule with the Skip action.
  • Write the header name in lowercase in the rule expression (for example, x-osano-scan).
  • Choose which protections to skip. Skip supports Super Bot Fight Mode. See the available Skip options for product limits.
  • A custom rule can't skip Bot Fight Mode. If Bot Fight Mode blocks the scan, turn it off, or use Super Bot Fight Mode instead, which supports Skip.

AWS WAF​

Another provider​

Search its documentation for a "custom rule," "exception," or "allow rule" that matches a request header, then follow the checklist above.

Keep your header value private​

Treat the header value like a password. Anyone who has it can use it to get through your firewall rule.

  • Don't put the value in support tickets, screenshots, or shared documents.

  • If the value is exposed, replace it in this order:

    1. Add the new value to your firewall rule next to the old one.
    2. Enter the new value in Osano and select Save.
    3. Wait until scans on every site using the group have run with the new value, then remove the old value from your firewall rule.

    A scan keeps the header value it was queued with, so a queued or running scan on any of those sites can still send the old value. Removing it sooner can block those scans.

  • In AWS WAF, set up data protection for the header on the web ACL before the first scan sends it. It hides the value in logs, sampled requests, and Security Lake. Don't use log redaction in its place. It covers logs only, not sampled requests or Security Lake.

Check that it worked​

  1. Go to Compliance Check, open your website, and select Scan.
  2. Wait for the scan to finish.
  3. Confirm the scan finished without the alert "Your site's bot protection blocked this scan".
  4. In your firewall's event log, confirm your new rule matched the scan and your pages loaded.

Troubleshooting​

I don't see Custom headers in my account menu. Contact Osano Support.

The scan is still blocked. Check that:

  • The value in your firewall rule exactly matches the value in Osano.
  • The header group is assigned to the right website.
  • The rule includes your website both with and without www.
  • The rule sits above the rule that blocks the scan.

I lost the header value. Open Custom headers, find your group, and select the eye icon to show the value.

For more help, see Check the result or contact Osano Support.