> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/start-scanning/overview-scan-settings/custom-headers.md).

# Custom headers

When performing a dynamic application security testing (DAST) scan, your scanner acts like an automated user, navigating your site and testing for vulnerabilities. However, modern security infrastructures (such as Web Application Firewalls) or complex authentication requirements can block these automated requests unless they are properly identified.

This page explains why you need custom headers and how to set them up in Snyk API & Web.

## What are custom headers used for?

In a DAST scan, custom headers serve three primary purposes:

1. **Identifying requests** - Because all requests include the defined custom headers, you can use them for many purposes, such as bypassing Web Application Firewalls. By adding a unique custom header (for example, `X-SnykApiWeb-Scan: true`), you can tell your Web Application Firewall to allow the scanner's traffic while still protecting the site from malicious bots.
2. **Authentication and authorization** - Some APIs require specific headers for every request to prove identity, such as `Authorization: Bearer <token>` or custom API keys.
3. **Environment signaling** - You can use headers to trigger specific behaviors in your application during a scan, such as disabling certain checks like CAPTCHAs or preventing the app from sending real emails during the test.

## Configure custom headers

In Snyk API & Web, you can configure custom headers at the **Target** level. This ensures that every request sent by the crawler and scanner to that specific application includes your required headers.

### Step-by-step configuration

1. Log in to Snyk API & Web.
2. From the Targets list, locate the target you want to configure and click the **gear icon** to navigate to the respective Settings.
3. Click the **Scanner** tab of the Target settings.
4. Locate the **CUSTOM HEADERS** module:
   * Enter the custom header name (for example, `X-Scan-Origin`).
   * Enter the corresponding value (for example, `Snyk-DAST-Scanner`).
   * Choose whether to test this header during the scan. When the check box is clear (default), the scanner sends the header as-is with every request but does not test it for vulnerabilities. When the check box is selected, the scanner also treats the header value as an attack surface and runs security checks against it.
5. Click **Add** to save the custom header.

You can also set up static custom headers for authentication purposes. Visit the [authentication documentation](/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/configure-targets/configure-authentication.md) for more details.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-api-web/start-scanning/overview-scan-settings/custom-headers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
