0
0
mirror of https://github.com/alerta/alerta-contrib.git synced 2024-12-04 12:27:25 +00:00
alerta_alerta-contrib/webhooks/fail2ban
2023-03-21 00:15:34 +01:00
..
alerta_fail2ban.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00
README.md Update READMEs 2020-11-20 22:39:32 +01:00
setup.py Fix multiple linting errors 2023-03-21 00:15:34 +01:00

Fail2Ban Webhook

Receive Fail2Ban ban notifications via webhook callbacks.

For help, join Slack chat

Installation

Clone the GitHub repo and run:

python setup.py install

Or, to install remotely from GitHub run:

pip install git+https://github.com/alerta/alerta-contrib.git#subdirectory=webhooks/fail2ban

Note: If Alerta is installed in a python virtual environment then plugins need to be installed into the same environment for Alerta to dynamically discover them.

Configuration

Alerta

The custom webhook will be auto-detected and added to the list of available API endpoints.

Fail2Ban

See Fail2Ban

Example Request

curl -sSL -X POST -H 'Content-Type: application/json' -d \
  '
    {
      "hostname": "foo",
      "severity": "critical",
      "attributes": {
        "bannedIp": "1.2.3.4"
      },
      "environment": "Development",
      "resource": "SSHD",
      "event": "The IP 1.2.3.4 has just been banned by Fail2Ban after 6 attempts!",
      "message": "test"
    }
  ' \
  'http://localhost:8080/api/webhooks/fail2ban?api-key=<API_KEY>'

License

Copyright (c) 2018 Milos Buncic. Available under the MIT License.