差分

提供: fukudat.net
ナビゲーションに移動検索に移動
997 バイト追加 、 2020年6月3日 (水) 22:03
ページの作成:「== Install == <pre> $ sudo apt-get install fail2ban </pre> == 設定 == /etc/fail2ban/jail.conf を /etc/fail2ban/jail.local にコピーして、適当にいじる。 /...」
== Install ==
<pre>
$ sudo apt-get install fail2ban
</pre>

== 設定 ==
/etc/fail2ban/jail.conf を /etc/fail2ban/jail.local にコピーして、適当にいじる。
/etc/fail2ban/fileter.d にフィルターが定義されているので、それを活用。なければ作る必要がある。

=== [[Postfix]] ===
/etc/fail2ban/jail.d/postfix_iptables.conf
<pre>
enabled = true
filter = postfix
action = iptables-multiport[name=postfix, port="smtp,465,submission,imap3,imaps,pop3,pop3s", protocol=tcp]
logpath = /var/log/mail.log
maxretry = 5
findtime = 3600
bantime = 3600
</pre>

=== sshd ===
/etc/fail2ban/jail.d/sshd_iptables.conf
<pre>
[sshd_iptables]
enabled = true
filter = sshd
action = iptables[name=SSH, port=XXXXX, protocol=tcp]
port = XXXXX
logpath = /var/log/auth.log
maxretry = 5
findtime = 3600
bantime = 3600
</pre>

== 参考文献 ==
* [https://bellett.moe.hm/index.php/2018/08/15/ubuntu-18-04-lts-iptables-fail2ban/ Ubuntu 18.04 LTS iptables Fail2ban 設定等]

案内メニュー