Synopsis
Have you ever looked through the list of recent messages for a public website and noticed certain IP addresses repeatedly trying to do bad stuff? For example, repeatedly trying to log in with various usernames, trying to access node/add, or trying a bunch of different path prefixes to the backend / CKEditor scripts, etc.
The Database logging ban operation module aims to make it easier to ban these IPs that show ill intent by adding a "Ban" or "Unban" link (depending on the current state of the IP address) to a log message's Operations, both on the Recent log messages [overview] screen, and in an individual message's Details screen.
User stories:
As an administrator, I want to be able to ban misbehaving IP addresses from the list of database logs, so that I can curb spammers on my site.
Requirements
The Drupal 9/10 version of this module (2.0.x) requires:
- The Ban module (in Drupal core)
- The Database Logging module (in Drupal core)
The Drupal 7 version of this module (7.x-2.x) requires:
- The Database logging API module, which depends on:
- The Database logging module (in Drupal core).
Note that, unlike the Drupal 7 version, you won't see the Ban/Unban link as soon as you enable the module in the Drupal 9/10 version: you will need to edit the watchdog view at /admin/structure/views/view/watchdog, add a new field named "Ban/Unban link" (machine name dblog_ban_ban_unban_link) to the view, and save the modified view. Unlike Drupal 7, this new field is separate from the "Operations" column.
Roadmap
The 2.0.x branch is the current stable branch, and is compatible with Drupal 9.4 and higher, Drupal 10; and PHP 7.3 and higher.
Support for the 7.x-1.x branch will be dropped soon after a full 2.0.0 is released.
Support for the 7.x-2.x branch will be dropped when the maintainer(s) migrate their Drupal 7 sites onto Drupal 9/10.
Beyond that, I don't really have any new features planned. That being said, I'm open to patches so long as they don't over-complicate the module.
Known problems
Drupal 7: I don't know of any problems at this time, so if you find one, please let me know by adding an issue!
Drupal 9/10: A ban/unban link on the log message details page at /admin/reports/dblog/event/{event_id} is currently missing.
Credits
Current co-maintainers:
See the bottom of this page for a list of organizations who have supported this project.
Gittip/Flattr/Paypal
The current co-maintainers are not currently accepting donations.
However, if you are willing to pay this module's co-maintainers to work on a bug that affects your project, or add a feature you require, please contact the co-maintainers directly using the contact form on their respective Drupal.org user account pages.
Help wanted!
Maintaining a project can be a lot of work, and the current co-maintainers of this project have full-time jobs, are not paid to maintain this module, and maintain a few other projects besides this one.
More co-maintainers to help triage issues, test patches for regressions, and add features would be greatly appreciated and would help us to resolve issues faster! If you are interested in becoming a co-maintainer, please open an issue asking to become one!
Similar projects and how they are different
If you are aware of any other similar projects, please let us know by adding an issue!
Dependencies
This module does not depend on any external service (e.g. SaaS) or libraries to be fully functional.
Restrictions
This module has no artificial restrictions: the version available from Drupal.org has full functionality. No paid version is available.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Administration tools, Developer tools, Security
- Ecosystem: Database logging API
45 sites report using this module
- Created by mparker17 on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.

![A screenshot of the Drupal 7 [log message] Details screen showing a Ban link in the Operations row for an individual log message.](https://www.drupal.org/files/styles/grid-3-2x/public/project-images/dblog_ban-d7-details.png?itok=V3vi9yLP)




