From 95e952c946d818f5dfc0442960e9bc9493d21b4a Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 27 Nov 2017 16:13:07 +0100 Subject: [PATCH] Add readme file for systemd integration. Some minor changes on jail values. --- .gitignore | 1 + 0.10.2/README.sytemd | 28 ++++++++++++++++++++++++++++ 0.10.2/jail.local | 5 ++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 0.10.2/README.sytemd diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/0.10.2/README.sytemd b/0.10.2/README.sytemd new file mode 100644 index 0000000..34af2c0 --- /dev/null +++ b/0.10.2/README.sytemd @@ -0,0 +1,28 @@ +# - Configure fail2ban as systemd service +# - + +cat << EOF > /etc/systemd/system/fail2ban.service +[Unit] +Description=Fail2Ban Service +Documentation=man:fail2ban(1) +After=network.target iptables.service firewalld.service ip6tables.service ipset.service +PartOf=iptables.service firewalld.service ip6tables.service ipset.service + +[Service] +Type=simple +ExecStartPre=/bin/mkdir -p /var/run/fail2ban +ExecStart=/usr/local/bin/fail2ban-server -xf start +# if should be logged in systemd journal, use following line or set logtarget to sysout in fail2ban.local +# ExecStart=/usr/local/bin/fail2ban-server -xf --logtarget=sysout start +ExecStop=/usr/local/bin/fail2ban-client stop +ExecReload=/usr/local/bin/fail2ban-client reload +PIDFile=/var/run/fail2ban/fail2ban.pid +Restart=on-failure +RestartPreventExitStatus=0 255 + +[Install] +WantedBy=multi-user.target +EOF + +systemctl daemon-reload +systemctl enable fail2ban.service diff --git a/0.10.2/jail.local b/0.10.2/jail.local index d2c17c0..48e7108 100644 --- a/0.10.2/jail.local +++ b/0.10.2/jail.local @@ -93,7 +93,10 @@ bantime = 10800 [dovecot] enabled = true -action = %(action_mbu)s +# - Take care to allowh 'whois' requests from this mashine. Maybe +# - you have configure your firewall +action = %(action_mwl)s +#action = %(action_mbu)s port = pop3,pop3s,imap2,imaps,submission,465 filter = dovecot[mode=sql] #mode = sql