# How to Install Limit Payload Size

**Limit Payload Size** is a *serverless* integration available at Azion Marketplace.

The integration employs a function to evaluate request data and deny payloads that exceed a predefined limit. The function validates the request payload size by checking the `Content-Length` header. The `Content-Length` header is required, making it safe to read instead of always reading the body. The users are safeguarded against attempts to change the header's value in this way, and reading the `Content-Length` header is the best course of action from a performance standpoint.

---

## Getting the integration

To install the integration, follow these steps:

1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/) > **Marketplace**.
2. On the Marketplace homepage, select the integration's card.
3. Once the integration's page opens, click the **Install** button.

You'll see a message indicating that your integration was successfully installed.

:::tip
You can search any integration by browsing through the cards, using the filters, or typing a keyword in the search bar.
:::

---

## Configuring the integration

This is an firewall integration, so, you'll have to instantiate the integration on the Firewall page. Follow the steps below to do this.

### Setting up a firewall

To instantiate the **Limit Payload Size** integration, follow the steps:

1. On the **Products menu**, select **Firewall** in the **SECURE** section.
2. Click the **+ Firewall** button.
3. Give an easy to remember name to your firewall.
4. Click the **Functions** switch to enable functions on your firewall.
5. Click the **Save** button.

Done. Now you've instantiated the firewall for your function.

### Setting up the Firewall function

To instantiate the **Limit Payload Size** integration, while still on the **Firewall** page:

1. Select the **Functions Instances** tab.
2. Click the **+ Function Instance** button.
3. Give an easy to remember name to your instance.
4. On the dropdown menu, select the **Limit Payload Size** function.
  - This action will load the **Arguments** tab.
5. On the **Arguments** tab, add the parameters.

For this integration, you only have to pass one argument in the Args JSON file:

```json
{
    "max_content_length": "10kb"
}
```

Some information about how this integration works:

- The `max_content_length` is the maximum size of the payload you'll accept. 
- This field accepts bytes, kilobytes, and megabytes as argument. 
- If you don't specify the unit of the payload size, it'll be assumed as bytes. 
- If you don't pass any argument, the function will bypass the execution. 
- Whenever the size exceeds the threshold set by the user, the integration will return a **403 error**.

6. Click the **Save** button.

### Setting up the Firewall Rules Engine

To finish, you have to set up the [Rules Engine](/en/documentation/products/secure/firewall/rules-engine/) to configure the *behavior* and the *criteria* to run the function.

Still on the **Firewall** page:

1. Select the **Rules Engine** tab.
2. Click the **+ Rule Engine** button.
3. Give a name to the rule.
4. Select a *criteria* to run and catch the domains that you want to run the integration on.
  - Example: if `Host` *matches* `yourdomain.com`.
5. Below, select a *behavior* to the *criteria*. In this case, it'll be **Run Function**. 
    - Select the adequate function according to the name you gave it during the instantiation step.
6. Click the **Save** button.

On the Console, you must now configure your domain so your firewall protects it.

7. On the **Products menu**, select **Workloads**.
8. Click on the domain you want to protect with your Limit Payload Size function.
9. In the **Settings** section, click on the `Firewall` selector and choose the firewall you created.
10. Click the **Save** button.

Done. Now the Limit Payload Size integration is running for every request made to the domain you indicated.

---