使用 cURL 進行 Fail2ban 操作禁令

使用 cURL 進行 Fail2ban 操作禁令

我的 Ubuntu 伺服器郵件是在職的。我用下面的命令進行了驗證。

echo "Mail is working on this server." | mail -s subject <[email protected]>

在我的整個jail.local

前任。入侵者ip=1.1.1.1

[sshd]
port       = 2222
destemail  = [email protected]
sendername = fail2ban
mta        = mail
action     = %(action_mwl)s
actionban  = curl -s https://www.app.com/ssh/ban?ip=1.1.1.1

當使用禁止憑證的 ssh 嘗試失敗 5 次時,IP 似乎被禁止,我也收到了電子郵件,但不知道為什麼curl 沒有觸發我的 api。

我錯過了什麼嗎?


我試過了

[sshd]
port       = 2222
destemail  = [email protected]
sendername = fail2ban
mta        = mail
bantime    = 1m
maxretry   = 1
action     = %(action_mwl)s
banaction  = %(curlAction)s <<<< ADDED ⭐️

捲曲操作.conf

[Definition]
actionstart =
actionstop = 
actioncheck = 
actionban = curl -s https://www.app.com/ssh/ban?ip=1.1.1.1
actionunban = 

相關內容