> For the complete documentation index, see [llms.txt](https://kawsing.gitbook.io/opensystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled-4/fail2ban.md).

# Fail2ban

sudo apt install fail2ban

使用docker

{% embed url="<https://github.com/crazy-max/docker-fail2ban>" %}

## Fail2ban  的主要有以下三個設定檔&#x20;

&#x20;jail.(conf|local) ：用來設定 ,定義與 action 的對應關係。

filter.d/ 用來定義過濾條件 (filter) ,目錄下已定義多種既有的過濾條件,常見的軟體有 apache、nginx 、 sshd 、 vsftpd  等,記錄檔格式也可能為 Syslog 、 Common Log Format 等。&#x20;

action.d/ 用來定義動作 (action) ,目錄下已定義多種既有的動作,像是sendmail 『寄信通知』、 iptables 阻擋來源位址、使用 whois 查詢來源 domain 或 自動通知該來源 IP 的管理者。&#x20;
