Odoo 20 · Community & Enterprise
Login Bot Guard for Odoo
Cloudflare-style bot detection for the Odoo login page. Every login attempt gets a bot score from 1 to 99, then is allowed, challenged or blocked. Stop credential stuffing, brute force and headless browsers without locking out your real users.
Your login page is under attack, all the time
Any Odoo exposed to the internet receives scripted logins with leaked passwords. Odoo's built-in cooldown only slows one IP at a time.
Bot score on every attempt
Each login POST is scored from 1 (certainly a bot) to 99 (human), with a breakdown of exactly which signals lowered it.
Catches scripts and headless browsers
Honeypot field, signed one-time page nonce, JavaScript proof token, webdriver and headless checks, automation User-Agents and submit timing.
Spots attack patterns
Credential stuffing (one IP, many logins), distributed attacks (one login, many IPs) and brute force, measured over rolling time windows.
Challenges instead of lockouts
Doubtful attempts get a Cloudflare Turnstile challenge (or a built-in fallback). Someone hammering your username never locks you out.
Under attack mode
When failed logins jump above the normal level for that hour, the guard gets stricter for everyone and notifies the administrators.
Reveals nothing to attackers
Blocked requests get the standard "Wrong login/password" page, so a bot cannot tell it was detected or whether the login exists.
How it works
The login page carries a few traps
A signed one-time nonce, a hidden honeypot field and a small script that proves a real browser rendered the page.
Signals lower the score from 99
Headers, timing, browser traits, IP and login history and your IP lists. Every weight is configurable.
Allow, challenge or block
Then log the attempt with its score and reasons, so you can see who is knocking and block an IP in one click.
| Bot score | Action (default thresholds) |
|---|---|
| 50 – 99 | Allow: normal Odoo login |
| 10 – 49 | Challenge: Cloudflare Turnstile, or a built-in math question without Turnstile keys |
| 1 – 9 | Block: generic "Wrong login/password" and a short progressive delay |
A challenge for doubtful logins
Real users solve it in a second and log in. With Cloudflare Turnstile most never see a puzzle at all.
Left: Cloudflare Turnstile (shown with Cloudflare's test key). Right: built-in fallback when no Turnstile keys are set.
Every attempt logged
Colored by action, with filters for blocked, challenged and failed attempts, grouping by IP, login or day, and a Block IP button.
See exactly why
Each attempt shows its signal breakdown: here a headless browser farm going after the admin account.
Dashboard
Allowed, challenged and blocked attempts per day. Attack waves stand out immediately.
IP allow, deny and suspicious lists
IPv4 and IPv6 CIDR ranges. Allow-list your office and integrations, block abusers temporarily, import Tor or datacenter ranges.
Fully configurable
Settings › Login Guard: thresholds, every signal weight, velocity windows, under attack mode, Turnstile and Cloudflare options.
What is checked
Default penalties, subtracted from 99. Set any of them to 0 to disable a signal.
| Signal | Triggers when | Penalty |
|---|---|---|
| Honeypot | The invisible form field is filled in | 98 |
| No page visit | The POST does not carry a valid, unused, signed nonce from the login page of the same session | 98 |
| Automation User-Agent | Empty, or python-requests, curl, wget, Go-http-client, HeadlessChrome, PhantomJS, Scrapy, Selenium, Puppeteer... (editable list) | 98 |
| Credential stuffing | The same IP tried 5+ different logins in 10 minutes | 70 |
| WebDriver | The browser reports navigator.webdriver (Selenium, Puppeteer, Playwright) | 60 |
| Distributed attack | The same login was tried from 5+ IPs in 30 minutes (leads to a challenge, never a lockout) | 60 |
| Brute force | 10+ failed logins from the same IP in 10 minutes | 50 |
| Too fast | Submitted less than 800 ms after the page was served | 40 |
| No JavaScript proof | The probe token is missing, invalid or expired (visitors without JavaScript can still log in) | 35 |
| Missing client hints | A Chrome/Edge User-Agent over HTTPS without Sec-CH-UA / Sec-Fetch headers | 30 |
| Suspicious IP range | The IP is in one of your imported lists (Tor, datacenters...) | 30 |
| Headless traits | No window.chrome or plugins on desktop Chrome, no languages, zero screen size | 20 each |
| Missing headers | No Accept-Language (20) or no Accept (15) header | 15–20 |
| Cloudflare bot score | Optional: blends the bot score forwarded by Cloudflare Bot Management into ours | blend |
Setup guide
Protection starts as soon as the module is installed. Turnstile is optional and takes about 5 minutes.
Install and check
Install Login Bot Guard
Copy the module into your addons path, update the Apps list and install it. It is enabled with sensible defaults right away.
Allow-list your office and integrations
Go to Settings › Login Guard › IP Rules and add Allow rules for your office NAT address and for servers that log in with scripts. Allow-listed IPs skip scoring.
Behind nginx or another proxy? Enable proxy mode
Set proxy_mode = True in the Odoo configuration and forward X-Forwarded-For / X-Forwarded-Host.
Get your free Cloudflare Turnstile keys (optional)
Turnstile is free. Your domain does not need to be on Cloudflare. Without keys, the built-in math challenge is used.
Open Turnstile
Log in (or sign up for free) at dash.cloudflare.com and choose Turnstile in the left sidebar.
Add a widget
Click Add widget, give it a name, add the hostname your users open Odoo on (e.g. erp.example.com, no https:// and no path) and choose Managed mode. Then click Create.
Paste the keys in Odoo
Copy the Site Key and Secret Key into Settings › Login Guard › Turnstile Challenge and save.
Allow outbound HTTPS
The Odoo server verifies each answer with challenges.cloudflare.com. This is the only external call, and only when a challenge is submitted.
1x00000000000000000000AA with secret key 1x0000000000000000000000000000000AA always pass.Site behind Cloudflare? (optional)
Enable Trust Cloudflare Headers to use CF-Connecting-IP as the visitor IP. On Bot Management plans, forward Cloudflare's bot score in a header (default CF-Bot-Score, via a Transform Rule) and it is blended into ours.
Features
- Bot score 1–99 with a per-signal breakdown for every attempt
- Configurable allow / block thresholds and signal weights
- Cloudflare Turnstile challenge, built-in fallback without keys
- Under attack mode based on the hourly baseline of failed logins, with manager notification (when Discuss is installed)
- IPv4 / IPv6 allow, deny and suspicious lists, with temporary blocks that expire automatically
- Bulk import of IP ranges (Tor exit nodes, datacenters...)
- Dashboard, filters and grouping by IP, login, action or day
- Automatic log cleanup (default 90 days)
- "Login Guard Manager" access group, given to administrators automatically
- Covered by automated tests (unit and full HTTP login flows)
Good to know
- Works on top of Odoo's own login cooldown, which keeps working unchanged.
- Protects the /web/login page. The JSON-RPC login (
/web/session/authenticate) used by mobile apps and integrations is not scored: restrict it at your proxy if you don't use it. - Password reset and signup pages are not covered yet.
- Low overhead: cached settings and IP lists, a couple of indexed queries per login.
- Only depends on base and web. No extra Python packages. On-premise and Odoo.sh.
Need help?
Questions, installation help or customisation: get in touch and we will get back to you.
Developed by Md. Abdullah Al Mamun
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 1389 |
| Technical Name |
login_bot_guard |
| License | OPL-1 |
| Website | http://aamsoftvalley.com |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module