Action to use core's ban IP address

Created on 5 March 2025, about 1 month ago

Problem/Motivation

I have a spammer / bot that visits regularly and creates accounts using the same username, first name and last name. So I used ECA to compare and catch these naughty 'users' and send me an alert that also includes the their IP address. I included links back to my site to arrive at the the ban IP address page and a link to do a IP lookup:

https://pss.unc.edu/admin/config/people/ban
https://iplocation.io/ip-whois-lookup/[spamIP]
[spamIP]

Ultimately I'd like to ban these IPs from ECA as well, but I cannot see an action, to use the core's ban IP module as an ECA action. I have seen support for this sort of thing in the CrowdSec ECA module & service, but I don't need or want all that. Core can do what I'd like to do.

Proposed resolution

Could this action be added? Can I create a ECA plugin for this? Have experience with commerce plugins development.
There does not look to be documentation for plugin development yet...
https://ecaguide.org/plugins/

Thanks for ideas. It is such a cool tool for Drupal.

✨ Feature request
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States goose2000

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @goose2000
  • πŸ‡ΊπŸ‡ΈUnited States goose2000
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    That's a nice idea. The ECA Guide is WIP and we're always looking for contributors. It mentions at least that if you enable the eca_development sub-module that you will get the drush code generator that builds the basic plugin structure for you. And beyond that, you find many hundred plugin examples in ECA that you can look at to see how certain things are done.

  • πŸ‡¨πŸ‡¦Canada bdunphy

    Would this work both ways - as a way to ban an IP and also unban/unblock an IP? This is an issue I'm running into now. We have clients on dedicated IPs that we would like to ensure never make it into the ban table.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    It can certainly be developed to do both, but that should then be 2 separate action plugins.

  • πŸ‡ΊπŸ‡ΈUnited States goose2000

    +1 @bdunphy "unban/unblock an IP"

    Thinking of a use case for the unban:

    • building a never ending list of banned IPs would be bad. They are forever rotating.
    • build a que event that looks at when an IP was banned (compared to NOW). Put that into a token.
    • condition - >if the IP was banned 30 days ago....
    • Action -> unban that IP.
Production build 0.71.5 2024