---
title: Converting requests to rules
summary: null
url: >-
  https://www.fastly.com/documentation/guides/next-gen-waf/rules/converting-requests-to-rules
---

From the [Requests page](https://www.fastly.com/documentation/guides/next-gen-waf/monitoring/monitoring-requests#accessing-the-requests-page), you can convert individual requests into pre-populated rules, enabling you to take action on similar requests. To convert a request into a rule, follow these steps:

### Next Gen Waf Control Panel

1.   Log in to the [Next-Gen WAF control panel](https://dashboard.signalsciences.net).

2.   From the **Sites** menu, select a site if you have more than one site.

3. Click **Requests**.

4. Locate or [search](https://www.fastly.com/documentation/guides/next-gen-waf/reference/searching-for-requests/) for the request you want to convert into a rule.

5. Click **View request detail**.

6. Click **Convert to rule** in the upper-right corner.

7. Under **Type**, select the type of rule you want to make (**Request**, **Rate limit**, or **Signal exclusion**).

8. Under **Conditions**, select which [characteristics of the request](https://www.fastly.com/documentation/guides/next-gen-waf/rules/defining-rule-conditions/#fields) you want to convert into rule conditions. For example, selecting **IP Address** and **Path** will create conditions in the rule that look for the specific IP address and path featured in the request.

9. Click **Continue**.

10. Under **Conditions**, modify the rule as needed by adding and editing rule conditions.

11. Under **Actions**, select the [action](https://www.fastly.com/documentation/guides/next-gen-waf/rules/about-rules/#action-types) the rule should take when a request meets the rule conditions (e.g., **Block** or **Allow**). Additional actions can be added by clicking **Add action**.

12. Under **Status**, optionally disable the rule by deselecting **Always enabled**. By default, rules are automatically enabled when created unless specifically disabled.

    You can optionally set the rule to automatically disable after a set period of time. Click **Change expiration** and select a duration from the menu.

13. In the **Description** field, enter a description for the rule.

14. Click **Create site rule**.

### Fastly Control Panel

1.   Log in to the [Fastly control panel](https://manage.fastly.com).

2.   Go to **Security** > **Next-Gen WAF** > [**Requests**](https://manage.fastly.com/security/ngwaf/requests).

3.   From the workspaces bar, click the menu <span class="inline-icons"><img src="/img/icons/chevron-down.png" alt="Menu icon" /></span> to the right of the workspace name and select a workspace.

4. Locate or [search](https://www.fastly.com/documentation/guides/next-gen-waf/reference/searching-for-requests/) for the request you want to convert into a rule.

5. Click the document icon <span class="inline-icons"><img src="/img/icons/document.png" alt="Document icon" /></span> next to the request.

6. Click **Convert to rule**.

7. Select the [request characteristics](https://www.fastly.com/documentation/guides/next-gen-waf/rules/defining-rule-conditions/#fields) that the rule will be based on. For example, selecting **IP address** and **Path** will add two conditions to the rule. The conditions will look for the specific IP address and path featured in the request.

8. Click **Submit**. For each selected request characteristic, a pre-populated condition is added to the **Conditions** section.

   ![A request rule designed to block requests to the '/login' page from the IP address '198.51.100.50'](/img/ngwaf/add-request-rule.png)

9. Under **Type**, select the [type of rule](https://www.fastly.com/documentation/guides/next-gen-waf/rules/about-rules/#rule-types) you want to create (i.e., **Request**, **Rate limit**, or **Signal exclusion**).

10. _(Optional)_ Under **Conditions**, edit the rule conditions that were created based on the selected request characteristics and add additional conditions as needed.

11. Under **Actions**, select the [action](https://www.fastly.com/documentation/guides/next-gen-waf/rules/about-rules/#action-types) the rule should take when a request meets the rule conditions (e.g., **Block** or **Allow**). Additional actions can be added by clicking **Add action**.

12. Fill out the fields in the **Details** section as follows:
    - In the **Description** field, enter a description for the rule.
    - _(Optional)_ Click the **Status** switch to disable the rule.

13. Click **Create workspace rule**.

## Related content

- [Defining rule conditions](https://www.fastly.com/documentation/guides/next-gen-waf/rules/defining-rule-conditions)
- [Using an API with the Next-Gen WAF](https://www.fastly.com/documentation/guides/next-gen-waf/developer/using-an-api-with-the-next-gen-waf)
