> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metlo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WAF

You can create your own WAF rules with the ability to block, rate-limit, and tag requests.

### Block

For each type of rule, you can supply different types of conditions that must be met such as
`Path`, `IP Address`, and `Request Header`. These conditions can be grouped together to specify if all or
if just one needs to be true, and you can chain together multiple groups to create a ruleset. For example,
the block rule below will block all requests that originate from the IP Address **176.185.161.186**.

<img src="https://mintcdn.com/metlo/bLaSw1tiF6Fz1nHn/images/protection/waf-block.png?fit=max&auto=format&n=bLaSw1tiF6Fz1nHn&q=85&s=5b9376926fa26a7c2821f5de5ee3c8c9" alt="3808" width="3680" height="2382" data-path="images/protection/waf-block.png" />

### Tag

For **Tag** rules, you must specify the `Tag Name` that you want applied to any requests that match
the condition set. The tag rule below will tag all requests to the login endpoint that return 401 status code
with `Unauthorized_Login`.

<img src="https://mintcdn.com/metlo/bLaSw1tiF6Fz1nHn/images/protection/waf-tag.png?fit=max&auto=format&n=bLaSw1tiF6Fz1nHn&q=85&s=65a4dacc14e86e38444049b25f690a5f" alt="3808" width="3680" height="2382" data-path="images/protection/waf-tag.png" />

### Rate Limit

For **Rate Limit** rules, you can specify the type of identifier to be used to determine the uniqueness
of the requests. The possible identifiers are `IP Address`, `User`, and `Session`; you can select any
combination of the three. In the `Action` section, you can specify the number of requests (**Threshold**)
that must match the condition set within a certain period of time (**Interval**) before Metlo starts to block
any subsequent requests from that unique identifier for the next `x` hours/minutes/seconds (**Duration**). The
rate-limit rule below will block any unique IP addresses that attempt more than 10 login requests within
a minute for the next 10 minutes.

<img src="https://mintcdn.com/metlo/bLaSw1tiF6Fz1nHn/images/protection/waf-rate-limit.png?fit=max&auto=format&n=bLaSw1tiF6Fz1nHn&q=85&s=b09d01e89af5e09ffe8d1993604d6dc8" alt="3808" width="3592" height="2294" data-path="images/protection/waf-rate-limit.png" />
