mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
Add Discord webhook notification action
This commit is contained in:
parent
ef65652671
commit
fda4701633
1 changed files with 51 additions and 0 deletions
51
config/action.d/discord-webhook.conf
Normal file
51
config/action.d/discord-webhook.conf
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# Fail2Ban configuration file for Discord Webhook notifications
|
||||
#
|
||||
# Author: JY
|
||||
#
|
||||
#
|
||||
# [Usage]
|
||||
#
|
||||
# To enable this action, add the following to your jail.local file:
|
||||
#
|
||||
# [DEFAULT]
|
||||
# action = %(action_)s
|
||||
# discord-webhook[webhook="YOUR_DISCORD_WEBHOOK_URL"]
|
||||
#
|
||||
# Or for a specific jail:
|
||||
#
|
||||
# [sshd]
|
||||
# action = discord-webhook[webhook="YOUR_DISCORD_WEBHOOK_URL"]
|
||||
#
|
||||
|
||||
[Definition]
|
||||
|
||||
# Option: actionstart
|
||||
actionstart = curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content": ":white_check_mark: [Fail2Ban] Jail **<name>** has been started on **<fq-hostname>**."}' \
|
||||
<webhook>
|
||||
|
||||
# Option: actionstop
|
||||
actionstop = curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content": ":octagonal_sign: [Fail2Ban] Jail **<name>** has been stopped on **<fq-hostname>**."}' \
|
||||
<webhook>
|
||||
|
||||
# Option: actioncheck
|
||||
actioncheck =
|
||||
|
||||
# Option: actionban
|
||||
actionban = curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content": ":lock: [Fail2Ban] **BANNED** \n**Jail:** <name>\n**IP:** <ip>\n**Failures:** <failures>\n**Host:** <fq-hostname>"}' \
|
||||
<webhook>
|
||||
|
||||
# Option: actionunban
|
||||
actionunban = curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"content": ":unlock: [Fail2Ban] **UNBANNED** \n**Jail:** <name>\n**IP:** <ip>\n**Host:** <fq-hostname>"}' \
|
||||
<webhook>
|
||||
|
||||
[Init]
|
||||
|
||||
# Default name of the jail
|
||||
name = default
|
||||
|
||||
# Discord Webhook URL (Override this in your jail.local)
|
||||
webhook = https://discord.com/api/webhooks/your-default-webhook
|
||||
Loading…
Reference in a new issue