A screenshot of the Drupal 7 Recent log messages screen showing a ban link next to one log message, and an unban link next to another message.
A screenshot of the Drupal 7 [log message] Details screen showing a Ban link in the Operations row for an individual log message.
A screenshot of a Drupal 7 confirmation screen asking the administrator to confirm if they would like to ban the IP address 1.2.3.4.

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:

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!

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.

Supporting organizations: 
Supported mparker17 in upgrading the module to Drupal 10.
Supported mparker17 in upgrading the module to Drupal 10.
Partially paid mparker17 to write the Drupal 7 version of the module.

Project information

Releases