Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Facets 3.0.6 Minor update available for module facets (3.0.6). Release: Facets 3.0.5 Minor update available for module facets (3.0.5). Release: Flag 5.1.0 Minor update available for module flag (5.1.0). Release: Block Layout Accordion 1.0.2 Minor update available for module block_layout_accordion (1.0.2). Release: Canvas interactive toggle 1.0.2 Minor update available for module canvas_interactive_toggle (1.0.2). Release: Views HTTP Client 1.0.2 Minor update available for module views_http_client (1.0.2). Release: Block Layout Accordion 1.0.1 Minor update available for module block_layout_accordion (1.0.1). Release: Canvas interactive toggle 1.0.1 Minor update available for module canvas_interactive_toggle (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Ban

1,851 sites Security covered Drupal 11 · not 10
View on drupal.org

This module allows site administrators to block specific IP addresses from accessing the site. It is designed to be fast and lightweight, intercepting requests quickly to help mitigate attacks.

Ban was a core module from Drupal 8 to 11 and has moved to contrib for Drupal 12.

#1570102: [Policy] Deprecate Ban module

Ban allows administrators to ban visitors or requests to their site from individual IP addresses.
The Ban module is made to be extremely fast and lightweight, so that in cases of DDoS the Ban middleware intercepts fast and with little memory footprint.

Post-Installation

To ban an IP address

  1. Navigate to /admin/config/people/ban.
  2. Enter an IP address (for example, 10.0.0.1).
  3. Click Add.

Drupal will prevent you from banning your own IP address.

To remove the ban from an IP address in the UI

  1. Navigate to the ban page (see above).
  2. Beside an IP address, click Delete.

Ban Drush (drush) & Drupal CLI (dr) Commands

Available commands for the "ban" namespace:
  ban:ban        Ban an IP address.
  ban:flush      Unban all IP addresses.
  ban:list       List all banned IP addresses.
  ban:unban      Unban a specific IP address.
  ban:unban-all  Unban all IP addresses.

(Drupal CLI support from >= 1.1.0 #3606943: Add dr support in Ban)

  • Perimeter module uses ban to block IPs that accessed configured URLs
  • Crowdsec module uses ban to ban IPs by attack signals
  • Autoban module allows automatizing IP ban using watchdog table by the module rules.
  • For more advanced features and sophisticated levels of IP based protection, it is also worth considering system installed alternatives such as fail2ban

Alternative modules

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
7
Tracked since
Jul 2025
Latest release
1 month ago
Releases (12 mo)
5 ▲ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.1.0 Stable 11 Jul 17, 2026
1.1.0-beta3 Pre-release 11 May 7, 2026
1.1.0-beta2 Pre-release 11 Apr 2, 2026
1.1.0-beta1 Pre-release 11 Mar 19, 2026
1.1.x-dev Dev 11 Feb 24, 2026
1.0.0 Stable 11 Jul 29, 2025
1.0.x-dev Dev 11 Jul 24, 2025