Skip to content

LogByMail 1.2.0

Choose a tag to compare

@lorentzjohan lorentzjohan released this 30 Oct 13:11
· 2 commits to main since this release
62ac7f5

LogByMail 1.2.0

Sign in to GLPI with your email address as well as with your login — now with a built-in brute-force protection and an automated test suite running on GLPI 11 and 12.

✨ Highlights

🔒 Brute-force protection (new)

GLPI does not limit password attempts on its login form. LogByMail now protects every web sign-in, with a login or an email address (an email counts on the account it belongs to, so alternating both changes nothing).

  • Per account and per IP address: 5 failures within 15 minutes lock the account for 15 minutes from this IP only — nobody can lock a colleague out from another computer.
  • Per IP address: 30 failures within 15 minutes on any accounts lock the IP (password spraying). Set to 0 to disable.
  • Locked attempts are refused before any password check, with the GLPI error page, HTTP status 429 and a Retry-After header (fail2ban friendly).
  • A successful sign-in resets the account counter; two-factor authentication keeps working as before.
  • All thresholds are configurable in Setup > Plugins > LogByMail. Counters live in the GLPI cache.
  • New log results: locked and blocked.

⚡ Performance

The plugin settings are now only read for sign-ins and for the login page: the REST API, inventory agents, CalDAV and other anonymous requests no longer trigger any database query.

🌐 Reverse proxies

The client IP follows the GLPI 12 trusted reverse proxies (GLPI_TRUSTED_REVERSE_PROXIES).

✅ Continuous integration on GLPI 11 and 12

Every commit is now tested on 4 environments (GLPI 11 and 12, PHP 8.2 / 8.3 / 8.5, MySQL and MariaDB) with the official GLPI plugin CI:

  • static analysis: PHPStan (max level) against the GLPI source code, Psalm with taint analysis;
  • code style and quality: PHP-CS-Fixer, Rector, TwigCS, licence headers;
  • 46 PHPUnit tests, including integration tests running inside GLPI on its test database: email resolution rules, sign-in through GLPI's own authentication, login form handling, log, brute-force protection with the GLPI cache, hooks, settings update and uninstall;
  • install, activation and clean uninstall of the plugin.

🔧 Other changes

  • Installation: the plugin folder can stay owned by root — the web server only reads it.
  • Line endings normalized to LF in the repository (.gitattributes).
  • Stricter typing of database rows and cache entries.

⬆️ Upgrading from 1.1.x

  1. Replace the plugins/logbymail folder.
  2. In Setup > Plugins, click Update — existing settings and users lists are kept, new settings get their default values.
  3. Clear the cache: php bin/console cache:clear.

⚠️ The brute-force protection is enabled by default. Behind a reverse proxy, declare it in GLPI_TRUSTED_REVERSE_PROXIES (GLPI 12), otherwise all users share the proxy IP: in that case set the per-IP limit to 0.

📦 Requirements

GLPI 11.x and 12.x (tested on 11.0.12 and 12.0.1)
PHP 8.2 to 8.5 (8.3 minimum with GLPI 12)
Languages English, French

🚀 Fresh install

cd /path/to/glpi/plugins
# extract the release archive here: plugins/logbymail
php bin/console plugin:install logbymail -u glpi
php bin/console plugin:activate logbymail

Full changelog: 1.1.0...1.2.0