This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Fail2ban for Sentora (Centos 7)
#11
RE: Fail2ban for Sentora (Centos 7)
Hi,
first Sorry, my english isn't good,
After install if you se this errors in your log: cat /var/log/messages |grep fail2ban |grep ERROR |cut -d: -f 4
ERROR  Found no accessible config files for 'fail2ban' under /etc/fail2ban
ERROR  No section
ERROR  Found no accessible config files for 'filter.d/sentora-ssh' under /etc/fail2ban
ERROR  Unable to read the filter
ERROR  Errors in jail 'ssh'. Skipping...
ERROR  Found no accessible config files for 'filter.d/sentora-apache' under /etc/fail2ban
ERROR  Errors in jail 'apache'. Skipping...
ERROR  Found no accessible config files for 'filter.d/sentora-proftpd' under /etc/fail2ban
ERROR  Errors in jail 'proftpd'. Skipping...
ERROR  Found no accessible config files for 'filter.d/sentora-postfix' under /etc/fail2ban
ERROR  Errors in jail 'postfix'. Skipping...
ERROR  Found no accessible config files for 'filter.d/sentora-dovecot' under /etc/fail2ban
ERROR  Errors in jail 'dovecot'. Skipping...
ERROR  Found no accessible config files for 'action.d/iptables' under /etc/fail2ban
ERROR  Error in action definition iptables[name=SSH, port="22"]
ERROR  Found no accessible config files for 'action.d/iptables-multiport' under /etc/fail2ban
ERROR  Error in action definition iptables-multiport[name=Postfix, port="80,443"]
ERROR  Error in action definition iptables[name=FTP, port="21"]
ERROR  Error in action definition iptables-multiport[name=Postfix, port="25,465"]
ERROR  Error in action definition iptables-multiport[name=Dovecot, port="143,993,110,995"]

You need to force reinstall fail2ban:

for rpm in $(rpm -qa |grep fail2ban)
do
yum reinstall $rpm -y
done

After need to run the script of bbspike (Very thanks for you script Smile)

echo ""
echo "############################################################"
echo "#  Fail2Ban for Sentora 1.0.0  #"
echo "############################################################"

echo -e "\nChecking that minimal requirements are ok"

# Ensure the OS is compatible with the launcher
if [ -f /etc/centos-release ]; then
   OS="CentOs"
   VERFULL=$(sed 's/^.*release //;s/ (Fin.*$//' /etc/centos-release)
   VER=${VERFULL:0:1} # return 6 or 7
elif [ -f /etc/lsb-release ]; then
   OS=$(grep DISTRIB_ID /etc/lsb-release | sed 's/^.*=//')
   VER=$(grep DISTRIB_RELEASE /etc/lsb-release | sed 's/^.*=//')
else
   OS=$(uname -s)
   VER=$(uname -r)
fi
ARCH=$(uname -m)

echo "Detected : $OS  $VER  $ARCH"

if [[ "$OS" = "CentOs" && ("$VER" = "6" || "$VER" = "7" ) ]] ; then
   echo "Ok."
else
   echo "Sorry, this OS is not supported."
   exit 1
fi
systemctl stop firewalld
systemctl mask firewalld
yum install unzip
yum install wget
yum install iptables-services
systemctl enable iptables
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 465 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 110 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 995 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 143 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 993 -j ACCEPT
service iptables save
yum install fail2ban
mkdir /etc/sentora/panel/modules/fail2ban
cd /etc/sentora/panel/modules/fail2ban
wget http://park.webimproved.nl/fail2ban/sent...il2ban.zip
unzip sentora-fail2ban.zip
cp -f /etc/sentora/panel/modules/fail2ban/centos.jail.local /etc/fail2ban/
mv /etc/fail2ban/centos.jail.local /etc/fail2ban/jail.local
cp -f /etc/sentora/panel/modules/fail2ban/*.conf /etc/fail2ban/filter.d/
chmod 777 /etc/fail2ban/jail.local
cp -f /etc/sentora/panel/modules/fail2ban/sentora-fail2ban-centos /etc/cron.daily/
chkconfig --level 23 fail2ban on
systemctl start iptables
service fail2ban start

after install check if you fail2ban its running:
Exec: systemctl status fail2ban.service

You see:
● fail2ban.service - Fail2Ban Service
  Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; enabled; vendor preset: disabled)
  Active: active (running) since jue 2016-02-04 22:58:44 CET; 4min 54s ago
    Docs: man:fail2ban(1)
 Process: 121255 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=0/SUCCESS)
Main PID: 121258 (fail2ban-server)
  CGroup: /system.slice/fail2ban.service
          └─121258 /usr/bin/python2 -s /usr/bin/fail2ban-server -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/fail2ban.pid -x -b
Reply
Thanks given by:


Messages In This Thread
Fail2ban for Sentora (Centos 7) - by bbspike - 06-28-2015, 07:06 AM
RE: Fail2ban for Sentora - by Tango - 09-10-2015, 02:09 AM
RE: Fail2ban for Sentora - by Me.B - 09-10-2015, 05:56 PM
RE: Fail2ban for Sentora - by bbspike - 09-10-2015, 06:59 PM
RE: Fail2ban for Sentora - by Tango - 09-11-2015, 08:29 PM
RE: Fail2ban for Sentora - by bbspike - 09-12-2015, 04:01 PM
RE: Fail2ban for Sentora - by bbspike - 10-18-2015, 06:11 AM
RE: Fail2ban for Sentora - by Tango - 10-19-2015, 06:52 PM
RE: Fail2ban for Sentora - by bbspike - 10-20-2015, 03:16 AM
RE: Fail2ban for Sentora (Centos 7) - by kmlreverser - 02-05-2016, 08:06 AM
RE: Fail2ban for Sentora (Centos 7) - by Jettaman - 01-07-2020, 10:05 AM
RE: Fail2ban for Sentora (Centos 7) - by Vedran B - 01-14-2020, 07:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Secure Sentora With SSLForFree Chris L 1 4 ,728 01-22-2020, 09:19 PM
Last Post: ralphharder
[How To] Update from PHP v5.4.16 to v5.6.31 (Includes suhosin patch) [CentOS] betatester3.0 5 17 ,154 03-18-2019, 01:23 AM
Last Post: BigBang
Timeout for Sentora Admin Panel minufreelance 12 45 ,632 11-24-2018, 12:33 PM
Last Post: fearworks

Forum Jump:


Users browsing this thread: 4 Guest(s)