🛈 SYSTEM INFORMATION |
---|
Operating system Ubuntu Linux 20.04.3
Webmin version 1.984 Virtualmin version 6.17-3 Authentic theme version 19.84.7
Kernel and CPU Linux 5.4.0-96-generic on x86_64
Fail2ban 0.11.1
|------------------------------|-------------------------------|
Hi all,
Just reporting that in the latest version of Webmin, I have noticed a behavior that I never seen before.
Up until August of 2019 I am positive that this was not happening. I did extensive tests back then on exactly this functionality and was working well (or maybe I had too few entries that I did not see it). Since last week when I upgraded to Ubuntu 20.04 and the latest Webmin, I am seeing this problem.
Essentially, when fail2ban is running it creates iptable rules and chains.
When I go to Webmin > Networking > Linux Firewall I click <Revert configuration>
to show me all the iptables current rules. This works just fine.
The problems start as soon as you click <Apply Configuration>
. You may not notice it because it is not apparently obvious - you have to run **/usr/sbin/iptables -S**
to realize what is going on or click <Revert Configuration>
and you will see the big mess!
It duplicates ALL fail2ban chain rules and INPUT actions. You get doubling each time you click <Apply>
.
How I painfully deal with this
systemctl stop fail2ban
# Clear Fail2Ban Chains
/usr/sbin/iptables -S | grep -P '\-A f2b-.*' | cut -d ' ' -f 2 | sort -u | awk '{print /usr/sbin/iptables -F $1;}' | /bin/sh
# Clear Fail2Ban Rules
/usr/sbin/iptables -S | grep -P '\-A INPUT.*f2b-.*' | sed 's/^-A //' | awk '{print "/usr/sbin/iptables -D "$0";"}' | /bin/sh
systemctl start fail2ban
# Now click <Revert Configuration> and fail2ban will bring your rules back.
# If you have many rules you may need to click it a second time to see all of them.
Conclusion
Fail2Ban seems to be actively managing its iptables entries.
Should Webmin be disregarding F2B entries when we click <Apply Configuration>
?
Could I implement my commands to the actions of the <Apply Configuration>
button? How?
What are your thoughts?