|
1 | | -# fail2slack |
| 1 | +# fail2slack.py |
2 | 2 |
|
3 | | -A friendly little script that can package up your fail2ban vault statuses and send them to you over slack. |
| 3 | +[](https://travis-ci.org/asdfdotdev/fail2slack) [](https://codecov.io/gh/asdfdotdev/fail2slack) |
4 | 4 |
|
5 | | -## Setup |
| 5 | +A Python package for sending fail2ban jail status updates to Slack. |
6 | 6 |
|
7 | | -Create fail2slackconfig.py |
| 7 | +## Compatibility |
8 | 8 |
|
9 | | -``` |
10 | | -$ cp fail2slackconfig.dist.py fail2slackconfig.py |
11 | | -``` |
12 | | - |
13 | | -[Setup your Slack webhook](https://api.slack.com/incoming-webhooks) and add it to the config file: |
| 9 | +[](https://pypi.org/project/fail2slack) [](https://pypi.org/project/fail2slack) |
14 | 10 |
|
15 | | -``` |
16 | | -webhook_url = 'https://hooks.slack.com/YOUR/WEBHOOK/URL' |
17 | | -``` |
| 11 | +fail2slack is developed for, and tested with, recent versions of Python. |
18 | 12 |
|
19 | | -Select the vaults you want to report on: |
| 13 | +## Installation |
20 | 14 |
|
21 | 15 | ``` |
22 | | -vaults = [ |
23 | | - 'apache-auth', 'apache-badbots', 'apache-botsearch', |
24 | | - 'apache-fakegooglebot', 'apache-modsecurity', 'apache-nohome', |
25 | | - 'apache-noscript', 'apache-overflows', 'apache-shellshock', |
26 | | - 'php-url-fopen', 'sshd' |
27 | | -] |
| 16 | +pip install fail2slack |
28 | 17 | ``` |
29 | 18 |
|
30 | | -## Usage |
31 | | - |
32 | | -fail2slack should play nicely with Python v2 & v3. It can be run as a file or from the shell. |
| 19 | +Install fail2slack using the Python package installer. |
33 | 20 |
|
34 | | - |
35 | | -## Output |
36 | | - |
37 | | -The current failed/banned counts will be compiled for all selected vaults and sent via the webhook. |
| 21 | +## Usage |
38 | 22 |
|
39 | 23 | ``` |
40 | | -vault-name |
41 | | - Failed: CURRENT (TOTAL), Banned: CURRENT (TOTAL) |
| 24 | +usage: fail2slack [-h] [-w WEBHOOK] [-d DELIVERY] [-j JAILS [JAILS ...]] |
| 25 | +
|
| 26 | +optional arguments: |
| 27 | + -h, --help show this help message and exit |
| 28 | + -w WEBHOOK, --webhook WEBHOOK |
| 29 | + Slack webhook URL. Required if delivery method is 1. |
| 30 | + -d DELIVERY, --delivery DELIVERY |
| 31 | + Delivery method: 0 = print, 1 = Slack webhook. |
| 32 | + -j JAILS [JAILS ...], --jails JAILS [JAILS ...] |
| 33 | + Jails to include in status report. Required. |
42 | 34 | ``` |
43 | 35 |
|
44 | | -## Providing Feedback |
| 36 | +## Tests |
| 37 | + |
| 38 | +For instructions on running test check out the [README](./test#readme). |
| 39 | + |
| 40 | +## Contributing |
45 | 41 |
|
46 | | -Please reference our [code of conduct](./.github/CODE_OF_CONDUCT.md) and [contributing](./.github/CONTRIBUTING.md) guides. |
| 42 | +If you'd like to contribute to fail2slack please reference our [code of conduct](./.github/CODE_OF_CONDUCT.md) and [contributing](./.github/CONTRIBUTING.md) guides. |
0 commit comments