How to strengthen bot protection on websites using HAProxy.
HAProxy is a great load balancer that takes security very seriously, including bot protection. Over the years, it has added a series of flexible building blocks that can be combined to mitigate various kinds of automated threats.
This article will help you determine whether HAProxy offers adequate bot protection for your web applications, or if you could benefit from installing the DataDome HAProxy module and take your bot protection from “good enough” to bullet-proof.
Back-end web server bot protection
HAProxy provides proxying and load balancing for web servers. There is an open source version, sometimes referred to as the community edition. The commercial version is called HAProxy Enterprise Edition or HAPEE.
Thanks to HAProxy’s ACL, map, and stick table systems, combined with its flexible configuration language, users of the open source version can set up a first line of defense against automated threats such as web scraping, vulnerability scanning, and brute force attacks.
The Enterprise Edition takes bot protection one step further with the HAProxy Antibot module. This security module protects web applications against non-legitimate HTTP clients, such as dubious browsers or malware-infected computers, by sending JavaScript challenges to suspicious clients to help distinguish between bots and human users.
HAProxy is not, however, designed specifically for bot protection. While the built-in security features will enable you to detect typical bot behaviors, such as requesting too many pages too fast or generating too many 404 errors, more sophisticated bots are now able to mimic human behavior extremely convincingly. Bot operators are also distributing their bots over hundreds of thousands of different IP addresses, launching low and slow attacks that are very difficult to detect.
To identify and block these latest-generation threats, it takes a combination of truly specialized human know-how and artificial intelligence.
How the DataDome module for HAProxy works
For website owners that need to eliminate all unwanted bot traffic, DataDome can be a useful complement to HAProxy. Our bot detection software engine compares every hit to your website with a massive in-memory pattern database, and uses a blend of statistics and machine learning to decide in less than 2 milliseconds whether access to your pages should be granted or not.
As the only SaaS bot protection solution on the market, DataDome integrates seamlessly with HAProxy and deploys in minutes: just download the DataDome HAProxy module, unzip it in your HAProxy configuration directory, enter your API key in the spoe-datadome.conf file, and copy and paste a few lines of code to your HAProxy configuration file. That’s it!
Before the regular HAProxy process, the DataDome module collects your visitors’ HTTP requests and fingerprints and makes a call to a DataDome server where our detection engine analyzes every single request in real time. Depending on the AI’s response, the module will either block the query or let HAProxy continue the regular process. (Of course, you can also create your own custom rules to let partner bots access your sites, block all traffic from countries where you aren’t doing business, etc.)
Should any errors occur during this process, or if the timeout is reached, the module will automatically disable the blocking process and allow your traffic to pass so that the user experience is preserved for legitimate users.
The DataDome solution protects all your digital vulnerability endpoints, with specific algorithms for websites, web APIs, mobile app APIs, login sections, etc. We understand how to prevent vulnerability scanning and bad bots. We maintain a global network of regional endpoints, strategically located to provide low latency and high availability for customers no matter where they are.
Key benefits
The DataDome HAProxy module provides several benefits:
- Real-time (< 2 ms) bot detection and protection
- Seamless integration into HAProxy
- Critical differentiation between human and bot activity
- Elimination of illegitimate traffic, improving overall site performance
- Real-time protection from a wide array of attacks
The DataDome HAProxy module is one of many DataDome modules, all optimized to integrate seamlessly with a different type of web infrastructure.
Getting started with the DataDome HAProxy module
Start testing DataDome with HAProxy today. It is quick and easy to get testing right away. To create an account (no credit card required), just click the FREE TRIAL button below.
Then, follow the HAProxy module installation instructions in our technical documentation. Installing the module requires just a few simple steps:
- Download the current version of the module. You can find a link to it in the DataDome documentation.
- Unzip it to your HAProxy configuration directory.
- Edit spoe-datadome.conf, replacing DATADOME_API_KEY with your API Key.
- Update your haproxy configuration file as shown in the documentation.
Your personal DataDome dashboard will be available immediately. Go there to view all your bot traffic—good and bad—in real time. Happy testing!