Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Abusive Traffic

5 sites Security covered Drupal 10–11
View on drupal.org

This module detects abusive traffic by analyzing IP addresses and notifying you via email when a configured threshold is exceeded. It leverages the Acquia Cloud API to generate and parse Apache access logs, then prompts you to block identified spam IPs.

INTRODUCTION

The abusive traffic module helps identify abusive traffic (aka spam users) by IP address. The module will send an email to you so you can review if they are actually spam, or not. You should then block them via the ban module or a .htaccess rule (better option).

The module has drush commands which leverages the Acquia Cloud API (v2) to:

- Identifiy the application_uuid (to save to secrets)
- Generate an Apache Access log file of the last 1 hour
- Download and parse the Apache Access log file
- An email will be sent if the number of hits is greater than the threshold value you set.

WARNING

In a perfert world, you would have a WAF and a CDN to help be proactive with spammers. That isn't always the case, so that is why this module exists.

REQUIREMENTS

Acquia Cloud Next hosting.

INSTALLATION

Install as you would normally install a contributed Drupal module.
See: https://www.drupal.org/node/895232 for further information.

You will need to create an Acquia Cloud API Token - https://docs.acquia.com/acquia-cloud-platform/develop-apps/api/auth and save it to a secrets file. See https://docs.acquia.com/secrets#section-secretssettingsphp-file for how to setup the secrets file. Once you have your api key and api secret, save them to the secrets file with these names:

- abusive_traffic_acquia_client_id.key
- abusive_traffic_acquia_client_secret.key

Once you have these two secret settings saved, you need to save the abusive_traffic_acquia_application_uuid.key too. To get a list of all of the application UUIDs that you have access to, run drush abusive_traffic:list-applications. You will see the application name and application UUID output for you to save to the secret settings.

CONFIGURATION

Go to /admin/config/system/abusive-traffic and set:

- Threshold of when to send an email (start at 100 to see what you get)
- IP ignorelist - these IPs you have already blocked or know are traffic that is not spam.
- Email list - comma seperated list of who receives the email when the threshold is crossed.

SCHEDULED JOBS

The module is meant to have 2 cronjobs (scheduled jobs) to each run every hour. There should be a 5-10 minute gap between the two cronjobs to allow for the Apache Access log file to be generated.

- drush abusive_traffic:generate-log
- This will generate a log file with logs of the last 1 hour.
- drush abusive_traffic:get-log
- This will get the latest generated log file, save a copy to the private file directory, and send an email if there is an IP address over the threshold.

BLOCKING ABUSIVE TRAFFIC IPS

If you find IP addresses that are spamming your site, you should ban them using a .htaccess rule - https://docs.acquia.com/acquia-cloud-platform/architecture/security/rest.... You can also implement the ban module to block IP addresses without a code deployment, but these users can still cause issues on your site. They might still be counted on your Acquia Views/Visits data. Make sure to deploy updates to your .htacess file to block them for good.

KNOWN BAD ACTORS

I found out that the 47.76.* IP addresses are known to be bad in a call with an Acquia rep. They are owned from Alibaba and the IP addresses rotate. I suggest banning this range. It's your choice though.

MAINTAINERS

Current maintainers for Drupal 10:

- Nate Millin - https://www.drupal.org/u/nmillin

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
2
Tracked since
Oct 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Slowing

Releases

Version Type Core Release date
1.0.2 Stable 10–11 Apr 21, 2025
1.0.1 Stable 10–11 Oct 8, 2024