Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 1.38 KB

README.md

File metadata and controls

62 lines (45 loc) · 1.38 KB

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.