Académique Documents
Professionnel Documents
Culture Documents
Management
As a Drupal professional you might have heard of Flood Table (user session management), but
didn’t give much thought to it.
Having little theoretical knowledge of the core behavior of Drupal is not bad. So allow me to explain
what user session management is all about? And how it can protect you from bot or malwares. I
will also share few #Tweaks that help you to understand how to Flood & Unblock user from your
site.
Drupal 6 does not provide security from login attempt attack from Core until you enable login
security contributed module. In Drupal 7, however, core has in-built functionality to handle user
account attack whether it is a bot or some sort of malware. In this scenario, Drupal protects your
account from multiple hits either from one user id or one source ip.
As shown below, we have event id (fid), event (user logged in attempt IP/logged in attempt by user
id), identifier (value for logged in user ID/IP), timestamp (event occurrence unix timestamp),
expiration (Expiration timestamp. Expired events are purged on cron run.)
The Table helps you to view locked user IP & ID in the Drupal website. In Drupal 8, you won’t find
‘FLOOD’ table by default until any of the user lock/user IP event occurs. Thereafter, Drupal create
FLOOD table.
Below is the Drupal 8 Table structure of Flood.
Let’s say you, as an admin, have been blocked due to multiple wrong password entry. And
unfortunately, you don’t have a mail server installed on the web so that you can request for
Password Reset.
In this case, you can Reset your password by running Drush command. If, somehow, you
remember your password, but unable to login due to multiple false attempts then clear your flood
table first.
When your account is locked, visit phpmyadmin using UI or login to mysql or relevant database as
a root user then search for Flood Table and clear the respective user ID/IP.
Open related database. Look for Flood table and delete specific user row from Table entry. As you
can see above table having two entries.
You don’t have ssh/putty access, but you have admin rights and you want to unlock one of the user
account, who is blocked due to multiple false attempts. In this scenario, you can download & install
Flood Unblock & Flood Control module.
Drupal Flood Unblock provides an interface to the admin so that she/he can unblock user ID/IP
either in bulk or individually. Use the following drush command to clear user ID/IP:
drupal user:password:reset
Generate hash code for your new password. By running one of the command in Drupal root
directory:
./scripts/password-hash.sh newpwd
Once received encrypted password, execute sql query to run password update. And DONE.
So far we have checked out functionality, mechanism, and recovery of Flood and Table structure.
Here are few tips that will help you to protect user account especially admin account that every
hacker tries to attack.
Okay, so you know what is the purpose of Flood Table and you're convinced that you've got
something new to learn. The goal of our blog post is to bring you valuable information to help out in
difficult situations and grow your business. Hope you enjoyed this post! Please comment below
and let me answer in case you have any doubts.