# 4.4 HTTP Header Filtering

#### 📘 Overview

The **HTTP Header Filtering** module allows you to filter incoming HTTP requests based on the **name and value** of specific HTTP headers.\
This is useful for blocking or allowing requests based on exact or expected header content.

***

#### 🛠️ How It Works

You can define a simple rule by providing:

* A **Header Title** (e.g., `Origin`, `Authorization`, `X-Custom-Header`)
* A **Header Content** (exact match string)

Once the rule is created, incoming requests will be matched against this rule and **filtered accordingly**.

***

#### ⚙️ How to Add a Header Filter

1. Go to **Security Rules > HTTP Header Filtering**
2. Click **Create Header Filtering**
3. Fill out:
   * `Enter Header Title`
   * `Enter Header Content`
4. Click **Filter**
5. The rule will take effect immediately

<figure><img src="/files/BdUr9N1xw6KmcDaxHNzp" alt=""><figcaption></figcaption></figure>

***

#### 🔐 Why It Matters

Many attacks exploit improperly validated or missing headers, including:

* CSRF attacks (missing Origin / Referer headers)
* Host Header Injection
* API key misuse

Header filtering adds a layer of control at the gateway level to prevent such attacks early.

***

🎯 **HTTP Header Filtering is a quick way to enforce header presence and exact values, adding lightweight security to your application endpoints.**


---

# Agent Instructions: 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:

```
GET https://docs.shieldsguard.com/getting-started/4.-security-rules/4.4-http-header-filtering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
