# Protect your applications with bot management

> Platform versions: this page applies to API v3.x only, not to API v4.x.
> Equivalent page for API v4.x: [Bot-scoring perimeter for authentication flows](/en/documentation/use-cases/secure-applications-and-networks/online-fraud-prevention.md)
> Release stage: Deprecated.

Azion's [bot management solution](/en/documentation/platform/firewall/bot-manager/) checks each request against rules for bot signatures, scripted clients, and malicious intent, distinguishing between humans and various bot categories. Each rule a request matches adds points to its score, and the request is classified by that score, allowing for the execution of predefined preventive actions based on customer-set thresholds. For how the score is built, refer to [Bot scoring](/en/documentation/platform/firewall/bot-manager/bot-scoring/). This solution preserves the user experience while countering bot activity.

Use this architecture to mitigate security risks, prevent fraud, keep access open to legitimate users, and reduce the unnecessary traffic that automated clients add to an application.

---

## Bot management architecture diagram

![Bot management architecture diagram](/assets/docs/images/uploads/application-and-network-security/light-bot-management.png?v=2)

### Bot management data flow

1. A request reaches Azion Web Platform.
2. Firewall processes the request, and a Rules Engine rule runs the Bot Manager function instance.
3. Bot Manager checks the request, including its headers and its device, browser, and network data, against its rules. Each rule the request matches adds points to the score, and Bot Manager classifies the request by comparing the score with the instance's threshold.
4. When the score reaches the threshold, Bot Manager runs the action set in the instance: `allow`, `custom_html`, `deny`, `drop`, `hold_connection`, `random_delay`, or `redirect`.
5. Data reaches the application, where Rules Engine decides: generate content immediately or route flow to Origin Application for a response.
6. Activity can be observed through Real-Time Events or by using a Data Stream connector to feed event logs into your stream processing, SIEM, and big data platforms.

### Components

- [Firewall](/en/documentation/platform/firewall/) runs the Bot Manager function instance and the other security rules.
- [Bot Manager](/en/documentation/platform/firewall/bot-manager/) scores each request and applies an action when the score reaches the threshold. It is not a firewall module: it runs as a function instance, selected by a Rules Engine rule.
  - Bot Manager ships in two editions. [Bot Manager Lite](/en/documentation/guides/application-development/integrations/bot-manager-lite/) installs from the Marketplace; the full edition is a Preview product that Azion enables on request.
- [Applications](/en/documentation/platform/applications/) is your application running on top of the Azion Web Platform.
- [Data Stream](/en/documentation/platform/data-stream/) and [Real-Time Events](/en/documentation/platform/real-time-events/) enable you to monitor all Bot Manager activity.

---

## Implementation

You can test and implement Azion Bot Manager in two ways:

- Using [Azion Templates](/en/documentation/platform/marketplace/templates/) based on the Bot Manager Lite version: pre-built and pre-configured projects designed to accelerate the implementation of bot management.
  - [Bot Manager Lite Starter Kit](/en/documentation/guides/application-development/frameworks/bot-manager-lite-starter-kit/): with this template, you are able to deploy a new stack and see the Bot Manager Lite in action. To deploy this template, select **Deploy Bot Manager Lite Starter Kit**:

    [Deploy Bot Manager Lite Starter Kit](https://console.azion.com/create/azion/bot--manager-starter-kit)

  - [Bot Manager Lite Integration Kit](/en/documentation/guides/application-development/integrations/bot-manager-lite-integration-kit/): this template integrates the Bot Manager Lite function in an existing firewall on Azion. To deploy this template, select **Deploy Bot Manager Lite Integration Kit**:

    [Deploy Bot Manager Lite Integration Kit](https://console.azion.com/create/azion/bot--manager-integration-kit)

  - [Bot Manager Lite and TOR Block Starter Kit](/en/documentation/guides/application-development/frameworks/bot-manager-lite-and-tor-block-starter-kit/): deploy a basic security suite to protect your domains from bad bots and TOR Exit Nodes requests. To deploy this template, select **Deploy Bot Manager Lite and TOR Block Starter Kit**:

    [Deploy Bot Manager Lite and TOR Block Starter Kit](https://console.azion.com/create/azion/bot--manager-and-tor-block-starter-kit)

- From scratch: create an entire stack from zero, including Bot Manager. To do so:
  1. [Create an application](/en/documentation/platform/applications/v3/) and add a domain to it.
  2. Create a firewall, enable its Functions module, and associate the firewall with the domain.
  3. Choose the edition:
     - [Install Bot Manager Lite](/en/documentation/guides/application-development/integrations/bot-manager-lite/) from Marketplace.
     - Request the full edition of Bot Manager, a Preview product that is not enabled on an account by default. To request it, refer to [Support guidelines](/en/documentation/support/).
  4. In the firewall, create a function instance of Bot Manager and set its `threshold` and `action` arguments. For every argument an instance accepts, refer to [Arguments](/en/documentation/platform/firewall/bot-manager/arguments/).
  5. Create a Firewall Rules Engine rule with the **Run Function** behavior, naming the instance. To run it only on login, signup, or checkout paths, refer to [Run Bot Manager on selected paths](/en/documentation/guides/application-security/bots-and-network/run-bot-manager-on-selected-paths/).
  6. [Monitor bot activity](/en/documentation/platform/data-stream/quickstart/) and calibrate the threshold.

---

## Related resources

- [Understand Azion Integrations](/en/documentation/platform/marketplace/integrations/)
- [Monitor and calibrate Bot Manager](/en/documentation/guides/application-security/bots-and-network/monitor-and-calibrate-bot-manager/)
- [Protect web applications from OWASP Top 10 and zero-day attacks](/en/documentation/use-cases/secure-applications-and-networks/protect-web-applications-from-owasp-top-10-and-zero-day-attacks/)
