Security
v1.8.0
Security
- Mises à jour et support inclus pendant 12 mois
- Clé de licence livrée immédiatement par email
- Garantie satisfait ou remboursé 30 jours
- Documentation complète incluse
- Compatible avec les thèmes Hyvä
- Installation prête pour Composer
Wimakeit Security
Votre admin Magento et votre boutique sont ciblés quotidiennement — des bots inondent les routes de recherche, sondent les endpoints REST et GraphQL, scrape votre contenu, testent des numéros de carte volés et bouclent sur des listes de credentials. Une attaque soutenue sature votre pool php-fpm et met tout le site hors ligne. Ce module arrête ça, entièrement à l'intérieur de l'application — sans accès à la configuration du serveur web, sans changement d'infrastructure.
Il a été conçu à partir d'un incident réel : un botnet distribué de ~2 000 IPs, chacune envoyant une requête de recherche par minute, a saturé un pool de 52 workers php-fpm et provoqué une panne complète. Le module traite maintenant ce scénario en quelques millisecondes par requête bloquée, avant même que le moteur de recherche soit instancié.
À qui ça s'adresse
- Marchands sur un hébergement mutualisé ou managé où la configuration nginx/Apache est verrouillée — toute la protection s'exécute au niveau PHP.
- Boutiques ayant subi des floods de recherche, du sondage d'endpoints REST (scrapers de pages CMS), des bots de carding sur le checkout invité, ou des tentatives de brute force sur la page de login admin.
- Agences qui veulent un module configurable couvrant toutes les menaces courantes liées aux bots et la sécurité admin, avec intégration fail2ban et export de configuration edge inclus.
- Équipes ops qui ont besoin de logs actionnables et d'une checklist de sécurité — pas seulement d'une règle firewall.
Bénéfices clés
- Protection contre les floods de recherche — rate limiting par IP (30 req/60s par défaut) plus un circuit breaker sitewide : quand le taux global de recherche dépasse un seuil, seuls les vrais navigateurs (cookie form_key lié à une session) sont servis. La seule défense qui fonctionne contre les botnets distribués à ~1 requête/IP.
- Guards REST & GraphQL — throttle ou blocage total sur le sondage d'endpoints CMS, les bots de carding sur
/V1/guest-carts, et tout le trafic GraphQL ; les décisions interviennent avant le routing, l'authentification et le parsing des requêtes. - Bad Bot Guard — bannit par User-Agent sur toutes les routes frontend : scanners malveillants (sqlmap, nikto…), harvesters d'emails, scrapers SEO agressifs et crawlers IA. Quatre catégories indépendantes avec un mode dry-run pour valider les listes avant de les activer.
- Admin Email OTP — après un login par mot de passe réussi, un code à 6 chiffres est envoyé à l'adresse email de l'admin. Des credentials volés seuls ne permettent pas d'accéder à l'admin. Aucune app d'authentification requise, aucun QR code à scanner.
- Admin Login Guard — journalise chaque tentative de connexion, banne automatiquement les IPs qui dépassent le seuil d'échecs (TTL progressif : 5 min → 1h → 24h), envoie des alertes en cas de brute force.
- Gestion des bans IP — liste de bans persistante avec grid admin (filtrable, mass-unban), exports toutes les 5 minutes au format nginx / Apache / plain pour un blocage au niveau edge. Intégration fail2ban complète incluse.
- Security Checker — audit en 16 points (credentials admin, 2FA, HTTPS, cache, fichiers exposés, configuration SMTP, statut OTP…) disponible dans l'UI admin, via CLI (
wimakeit:security:check), et en cron quotidien. - Honeypot — lien footer invisible qui banne tout crawler qui le suit, à un coût quasi nul sur le trafic légitime.
Compatibilité
- Magento 2.4.x / Mage-OS
- PHP 8.1, 8.2, 8.3, 8.4
- Nécessite
wimakeit/module-core^3.0 - Suggère
wimakeit/module-smtppour une livraison fiable de l'Admin Email OTP (fonctionne aussi avec les paramètres SMTP natifs de Magento) - Compatible avec Redis, OpenSearch, Varnish Full Page Cache
- Fonctionne avec les frontends Luma et Hyvä
Installez ce module via Composer. Assurez-vous que votre auth.json est configuré avec vos identifiants Wimakeit.
$ composer require wimakeit/module-security:^1.8.0
$ bin/magento setup:upgrade
$ bin/magento setup:di:compile
Installation notes
The standard composer require + setup:upgrade + setup:di:compile flow applies. The points below cover what's specific to this module.
Required dependency
This module requires wimakeit/module-core ^3.0. Composer will pull it automatically from the Wimakeit registry as long as the registry is declared in your project's composer.json.
Recommended dependency
For reliable Admin Email OTP delivery, install wimakeit/module-smtp. Without a working SMTP transport, OTP codes may not be delivered and the admin could be effectively locked out after enabling the feature. The module works with native Magento SMTP settings too (Stores → Configuration → Advanced → System → Mail Sending Settings).
ACL permissions
Six ACL resources are created under System → Permissions → User Roles:
| Resource | Default |
|---|---|
Wimakeit_Security::overview (Security Overview page) | Administrator only |
Wimakeit_Security::stress (Under Attack mode — arm/release) | Administrator only |
Wimakeit_Security::bans (IP Bans grid + mass unban) | Administrator only |
Wimakeit_Security::login_log (Admin Login Log grid) | Administrator only |
Wimakeit_Security::checker (Security Checker page) | Administrator only |
Wimakeit_Security::config (module configuration) | Administrator only |
Configuration
All config is under Stores → Configuration → Wimakeit → Security. Defaults are safe for production — change only what you need.
General
| Setting | Default |
|---|---|
| Enable Search Guard | Yes |
| IP Whitelist | (empty) — one entry per line, supports exact IP, wildcard (203.0.113.*), IPv4/IPv6 CIDR |
| Trust Verified Search Engine Bots | Yes — Googlebot, Bingbot, etc. are exempt after forward-confirmed reverse DNS |
| Enable Debug Logging | No — leave off in production; blocked requests always log to wimakeit_security.log |
Per-IP Rate Limit
| Setting | Default |
|---|---|
| Enable | Yes |
| Max Requests per Window | 30 |
| Window (seconds) | 60 |
Sitewide Circuit Breaker (Stress Mode)
| Setting | Default |
|---|---|
| Enable | Yes |
| Global Threshold (requests/minute) | 120 — total search requests across all IPs |
| Stress Mode Duration (seconds) | 600 — auto-extended while the flood lasts |
| Alert Email | (empty) — leave empty to disable alert emails |
REST API Guard
| Setting | Default |
|---|---|
| Enable | Yes |
| Guarded Path Fragments | /V1/cmsPage, /V1/cmsBlock, /V1/guest-carts |
| Block Guarded Paths Entirely | No — throttle mode (note: full-block on /V1/guest-carts breaks guest checkout) |
| Max Requests per Window (per IP) | 20 |
| Window (seconds) | 60 |
GraphQL Guard
| Setting | Default |
|---|---|
| Enable | Yes |
| Max Requests per Window (per IP) | 60 — generous for headless/PWA storefronts |
| Window (seconds) | 60 |
Auto-Ban
| Setting | Default |
|---|---|
| Enable | Yes |
| Violations Before Ban | 3 |
| Violation Window (seconds) | 600 |
Honeypot
| Setting | Default |
|---|---|
| Enable | No — add Disallow: /wsecurity/ to robots.txt before enabling |
Admin Login Guard
| Setting | Default |
|---|---|
| Enable | Yes |
| Max Failed Attempts | 5 |
| Window (seconds) | 600 |
Admin Login OTP
| Setting | Default |
|---|---|
| Enable Admin Email OTP | Yes |
| Code Validity (seconds) | 300 (5 minutes) |
| Max Invalid Attempts (dropdown: 3 / 5 / 10) | 5 |
| Bypass OTP for Whitelisted IPs | Yes |
To use Admin Email OTP, each admin user must have a valid email address set in System → Permissions → All Users. Users without an email address will be logged in normally (with a warning in the security log) rather than being locked out.
Bad Bot Guard
| Setting | Default |
|---|---|
| Enable | Yes |
| Block Malicious Scanners | Yes — sqlmap, nikto, nmap, masscan… |
| Block Email/Content Harvesters | Yes — apache-badbots list |
| Block Aggressive Scrapers / SEO Bots | No — AhrefsBot, SemrushBot, MJ12bot… |
| Block AI Crawlers | No — GPTBot, ClaudeBot, CCBot… |
| Custom User-Agent Patterns | (empty) — one substring per line |
| Dry-Run (log only, do not ban) | No |
Query Validation
| Setting | Default |
|---|---|
| Enable | Yes |
| Max Query Length (characters) | 128 — set 0 to disable |
| Max Word Count | 12 — set 0 to disable |
Cron jobs (registered automatically)
| Job | Schedule | Purpose |
|---|---|---|
wimakeit_security_export_bans | every 5 min | Export active bans to var/wimakeit_security/ (nginx / Apache / plain) |
wimakeit_security_daily_check | daily 4 AM | Run security checklist, log degraded items |
wimakeit_security_daily_maintenance | daily 3:30 AM | Purge login log and stats older than 90 days; delete expired ban rows |
No setup needed — just make sure Magento cron is running.
Optional: fail2ban integration
A ready-to-use fail2ban filter and jail example are included in docs/fail2ban/. fail2ban tails var/log/wimakeit_security.log and bans attacking IPs at the iptables/nftables level before they hit PHP. Recommended when the module's in-application bans are insufficient (e.g. the attacking IP has already consumed a full php-fpm slot before being blocked).
Optional: edge configuration export
Run bin/magento wimakeit:security:edge-config to generate nginx / .htaccess snippets that mirror the current module configuration (banned IPs, guarded paths, honeypot route). Paste these into your vhost for kernel-level enforcement independent of PHP.
- Version
- v1.8.0
- Licence
- Abonnement annuel
- Support
- 12 mois
- Dernière mise à jour
- 16 juin 2026
- Magento
- Magento 2.4.4 Magento 2.4.5 Magento 2.4.6 Magento 2.4.7 Mage-OS 2.0 Mage-OS 2.1
- PHP
- PHP 8.1 PHP 8.2 PHP 8.3
- Hyvä
- Compatible
- Package
-
wimakeit/module-security
Vérifier la compatibilité
Indiquez votre stack pour vérifier la compatibilité du module.
Changelog
Categories: Security, Feature, Fix, Perf, Admin, Deps.
[1.7.1] - 2026-06-15
Fix
- The Admin OTP verification page now displays as a clean, centered login card. It previously rendered with a broken layout and an on-screen error because it loaded the full admin dashboard chrome on a mid-login page.
[1.7.0] - 2026-06-15
Feature
- Admin Email OTP is now enabled by default, with code validity shortened to 5 minutes (was off / 10 minutes) — new installs get post-login email verification out of the box, provided a working SMTP transport is configured.
Admin
- Max Invalid Attempts is now a dropdown (3 / 5 / 10) instead of a free-text field. Shipped defaults: OTP enabled, code validity 300s, max attempts 5.
Fix
- Admin OTP verification form could not be displayed: it failed with a fatal error on every load, so an admin with OTP enabled could never enter their code. The verification form now renders correctly, including the "incorrect code" message on a wrong attempt.
[1.6.0] - 2026-06-15
Feature
- Admin Email OTP: after a correct password login, a 6-digit code is emailed to the admin's registered address before access is granted. Stolen credentials alone can no longer access the admin panel — the attacker would also need the admin's mailbox.
- Code is cryptographically random, stored SHA-256-hashed with a configurable TTL (default 10 min). After a configurable number of wrong attempts (default 3), the code is invalidated and the admin is logged out.
- Whitelisted IPs (General → IP Whitelist) can optionally bypass OTP, useful for trusted office networks.
- Admin users without a registered email address are logged in normally with a warning — no lock-out scenario.
Admin
- New config group Stores → Configuration → Wimakeit → Security → Admin Login OTP: enable toggle, code validity (seconds), max invalid attempts, whitelist bypass option.
- Security Checker gains two new items: Admin Email OTP enabled (WARN when off) and SMTP configured (WARN when OTP is active but no SMTP transport is detected).
[1.5.2] - 2026-06-12
Security
- ACL privilege separation: the Under Attack mode (stress enable/disable) and the Overview page now have dedicated ACL resources, so a sub-permission no longer implicitly grants the ability to arm or release stress mode.
Fix
- Search route double-block fixed: a bad-bot User-Agent on a search URL was blocked by the Bad Bot Guard and then again by the Search Guard, overwriting the response and double-counting the ban hit.
- "Blocked While Banned" hit counter now only increments against currently active bans, not expired rows.
- Log sanitizer applied consistently to the
action=field and caught DB exception messages.
Admin
- Bad Bot Guard config group now has a unique sortOrder; removed the misleading "(UTC)" suffix from IP Bans grid date columns (the UI already renders them in the admin timezone).
[1.5.1] - 2026-06-12
Admin
- Security Overview page rebuilt with native Magento admin components: status pills (
grid-severity-*),admin__page-sectionblocks, message notices, anddata-gridtables instead of inline-styled custom HTML. - Security Checker and Admin Login Log status badges now use native PASS/WARN/FAIL pills.
[1.5.0] - 2026-06-12
Feature
- IP Bans grid: replaced the static bans table with a full Magento UI component listing — per-column filters (IP, provenance, date ranges), sorting, pagination, column controls, bookmarks, and a mass Unban action (CSRF-safe via UI framework). Expired bans are now visible too, with an active/expired status column.
- Provenance column: shows the ban reason (search throttle, REST/GraphQL, admin brute force, honeypot, bad-bot category) as a filterable select.
- Blocked While Banned counter: a persistent hit count per ban row, incremented each time an already-banned IP is rejected — shows how hard a banned IP keeps hammering.
[1.4.0] - 2026-06-12
Feature
- Bad Bot Guard: site-wide predispatch guard across all frontend routes that bans bots by User-Agent. Four switchable categories: malicious scanners (sqlmap, nikto, nmap…), email/content harvesters (apache-badbots list, modernised), aggressive SEO scrapers (AhrefsBot, SemrushBot, MJ12bot…), AI crawlers (GPTBot, ClaudeBot, CCBot…). Each category is an independent admin toggle.
- Scanners are banned 24h immediately; other categories use the progressive TTL. Bans feed into the existing export pipeline and fail2ban log.
- Custom User-Agent substrings (one per line) on top of built-in categories.
- Dry-Run mode: logs matches (
BAD-BOT-DRYRUN) without blocking — validate a list against real traffic before arming it. - Verified search engines and whitelisted IPs are never banned regardless of User-Agent.
[1.3.2] - 2026-06-12
Fix
- Hotfix:
setup:di:compilefailed because Block classes redeclared a$formKeyproperty already defined inMagento\Backend\Block\Template. Removed the redundant injection; the base class already providesgetFormKey().
[1.3.1] - 2026-06-11
Security
- Log-injection / fail2ban spoofing fixed: CR/LF in a search query, user agent, or username was written verbatim into the fail2ban-parsed log, letting an attacker forge a log line and have fail2ban ban an arbitrary IP. All logged fields now pass through a sanitizer; query validation rejects control characters (HTTP 400).
- Array request params (
?q[]=) handled: array values are now treated as empty instead of casting to the string "Array" and bypassing validation. - CSRF hardening: the Under Attack enable/disable and IP Unban actions are now POST + form key instead of GET links.
- Email alert escaping: attacker-supplied username in the brute-force alert email is HTML-escaped.
- Honeypot abuse mitigated: embedded sub-resource requests (
Sec-Fetch-Dest: image) no longer trigger a ban, preventing a third-party<img>tag from banning your visitors.
Perf
- No session start on the guard hot path: the trusted-client check no longer forces a session, avoiding a Redis session-write storm under flood and fixing breakage in the stateless GraphQL area.
- Reverse-DNS flood protection: a per-minute budget caps blocking DNS lookups so spoofed-crawler floods cannot tie up workers.
AlertMaileris now lazy-loaded via Proxy so the mail stack is not instantiated on every guarded request.
Fix
banned_untilcolumn changed todatetime(removes the year-2038 ceiling on ban expiry).- GraphQL now returns 403 (not 429) for banned IPs, matching the semantics of the other guards.
- Admin login ban now triggers on the configured Nth failure (was N+1).
- Expired-ban purge moved to the daily maintenance cron (was the 5-minute export cron).
[1.3.0] - 2026-06-11
Feature
- GraphQL Guard: plugin on the GraphQL front controller (before query parsing and schema generation) — per-IP rate limit on all
/graphqlrequests (default 60/60s), auto-ban on repeat offenders. Search-shapedproducts(search:)queries also feed the sitewide circuit breaker and are rejected during stress mode. - Advanced search guarded: predispatch observer added on
catalogsearch/advanced/result(same engine cost as standard search, obvious fallback target). - Carding protection:
/V1/guest-cartsadded to the REST API Guard default paths — bots loop onpayment-informationto test stolen card numbers. Default API limit raised to 20/60s so a legitimate guest checkout never trips it. - IPv6 support: whitelist CIDR matching now handles IPv6 (binary comparison via inet_pton); verified-bot forward confirmation resolves AAAA records.
- Client IP resolution checker: detects the proxy/CDN misconfiguration trap where per-IP limits and bans would target the proxy itself instead of the real client.
[1.2.0] - 2026-06-11
Feature
- Admin Login Guard: every login attempt (success and failure) logged to a dedicated table, browsable under Wimakeit → Security → Admin Login Log. IPs exceeding the failure threshold (default 5 / 10 min) are auto-banned (progressive TTL) and blocked with HTTP 429 at predispatch. Alert email on ban. Whitelisted IPs are never banned.
- Block statistics: hourly aggregated counters shown on the Security Overview page — 24h bar chart and 7-day totals by reason (throttled, stress-blocked, banned, REST/GraphQL, honeypot, admin brute force, bad-bot…).
- Under Attack mode: one-click manual stress mode activation (1h) from the Overview page, before the automatic threshold trips; release button when active.
Admin
- Daily maintenance cron purges the login log and statistics older than 90 days.
[1.1.0] - 2026-06-11
Feature
- REST API Guard: throttles or fully blocks configured REST paths — defaults
/V1/cmsPageand/V1/cmsBlock(recurring bot probing targets) — via a plugin on the webapi front controller, before routing, authentication, and deserialization. - Auto-ban: repeat throttle offenders get persistent bans with progressive TTL (5 min → 1h → 24h), stored in
wimakeit_security_ban(cache-first hot path). - Ban exports (cron, every 5 min):
var/wimakeit_security/banned_ips_nginx.conf,banned_ips_apache.conf,banned_ips.txt. - Honeypot (off by default): invisible
rel="nofollow"footer link to/wsecurity/trap; followers are banned 24h. Verified bots and whitelisted IPs are exempt. - Security Checker: 13 checks covering admin usernames, 2FA, admin URL, secret keys, anonymous Web API access, template symlinks, production mode, cache types, HTTPS, HttpOnly cookies, search_query table bloat, exposed files, and guard status. Available in admin UI, CLI (
wimakeit:security:check), and as a daily cron. - CLI
wimakeit:security:edge-config: ready-to-paste nginx/.htaccess snippets matching the current module configuration.
[1.0.0] - 2026-06-11
Feature
- Initial release — Search Guard designed after the 2026-06-10 botnet flood on
catalogsearch/result. - Predispatch guard on the native search results page and Wimakeit Search autocomplete.
- Per-IP rate limit (fixed window, cache-backed) with HTTP 429 and
Retry-After. - Sitewide circuit breaker (stress mode): above a global req/min threshold, only clients with a session-bound form_key cookie are served — stops distributed botnets at ~1 request/IP.
- Query validation (control characters, max length, max word count) with HTTP 400.
- IP whitelist (exact IP, wildcard, IPv4 CIDR).
- Verified search engine bot exemption (forward-confirmed reverse DNS, cached 24h).
- Dedicated parsable log
var/log/wimakeit_security.log(fail2ban-ready). - CRITICAL log entry and optional alert email on stress mode activation.
Vous avez trouvé un bug ? Faites-nous-en part.
Un court formulaire s'ouvre dans un nouvel onglet — le nom du module et votre langue sont déjà pré-remplis. Décrivez ce que vous avez tenté, ce qui n'a pas fonctionné, et nous vous répondrons sous un jour ouvré.
Signaler un bug pour SecurityBesoin d'aide ?
Notre équipe est disponible pour vous accompagner dans l'intégration.