• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

rc.local iptables overrides fail2ban rules

tkalfaoglu

Silver Pleskian
Hi there. I recently discovered some attacks that are connecting to a TCP port on the server, which it turns out is a virus planted into a few wordpress sites.

Apart from cleaning this mess up, I also wrote some iptables rules to permit connections only to wanted ports, and block everything else, I put them in /etc/rc.local

I do NOT have plesk firewall enabled; but I do have fail2ban running.

However, the rules in rc.local override fail2ban right now. I mean, something like

iptables -A INPUT -i eth0 -p tcp --destination-port 25 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --destination-port 80 -j ACCEPT
(....)
iptables -A INPUT -i eth0 -p tcp -j DROP


in rc.local overrides fail2ban and fail2ban cannot do its work - that is all port 25,80 accesses are permitted even if fail2ban bans them.

What do you suggest I do?
Many thanks, -turgut
 
Last edited:
Followup: I found a solution -- I changed fail2ban to use "route" instead of "iptables".
So it just routes the bad IP's to oblivion instead of adding a rule to the iptables. So I can play with iptables to my liking now :)
 
Back
Top