| Summary: | Fail2Ban can't ban IPs when FirewallD is running in Fedora 24 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Benjamin Xiao <ben.r.xiao> | ||||
| Component: | firewalld | Assignee: | Rashid Khan <rkhan> | ||||
| Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 24 | CC: | dan, twoerner | ||||
| Target Milestone: | --- | Keywords: | Reopened | ||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2017-08-08 16:51:00 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
Easier way to reproduce would probably be to purposely ban an ip using "fail2ban-client set <jail> banip <ip>" Could this be related? I am investigating similar behavior and decided to disable both firewalld and fail2ban services, then reboot and first enable firewalld. I see that iptables commands are failing at startup. The commands seem to be from direct.xml which correspond to the jail.local configured bans. ug 27 12:00:49 zzz.private systemd[1]: Starting firewalld - dynamic firewall daemon... Aug 27 12:00:50 zzz.private systemd[1]: Started firewalld - dynamic firewall daemon. Aug 27 12:00:50 zzz.private audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=firewalld comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' Aug 27 12:00:52 zzz.private /firewalld[2664]: WARNING: '/usr/sbin/iptables -w -I INPUT_direct 1 -p tcp -m multiport --dports ssh -m set --match-set fail2ban-sshd src -j REJECT --reject-with icmp-port-unreachable' failed: Aug 27 12:00:52 zzz.private /firewalld[2664]: WARNING: '/usr/sbin/iptables -w -I INPUT_direct 2 -p tcp -m multiport --dports ftp,ftp-data,ftps,ftps-data -m set --match-set fail2ban-vsftpd src -j REJECT --reject-with icmp-port-unreachable' failed: Aug 27 12:00:52 zzz.private /firewalld[2664]: WARNING: '/usr/sbin/iptables -w -I INPUT_direct 3 -p tcp -m multiport --dports imaps,pop3s -m set --match-set fail2ban-dovecot src -j REJECT --reject-with icmp-port-unreachable' failed: Aug 27 12:00:52 zzz.private /firewalld[2664]: WARNING: '/usr/sbin/iptables -w -I INPUT_direct 4 -p tcp -m multiport --dports 25,465 -m set --match-set fail2ban-sendmail src -j REJECT --reject-with icmp-port-unreachable' failed: ~ ~ 7 substitutions on 7 lines I was able to eliminate the errors above and to get a clean start on firewalld (and on fail2ban) by stopping both services and then removing the fail2ban related rules from direct.xml. It seems that they must have been put there at some point when I used the firewalld GUI to make a runtime configuration permanent. Brilliant! That worked! Thanks so much! Don't understand why closed...I presented a workaround but this issue will reoccur whenever someone is running fail2ban and chooses to make a runtime fw config permanent. I suggest that a better way to address is to have firewalld ignore any fail2ban added direct rules when making a runtime config permanent. Comments? Sorry, I thought it was just a config issue on my end, but yes I think if this problem will reoccur then it should be fixed. This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '24'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |
Created attachment 1194562 [details] Output of journalctl -f when restarting Fail2Ban Description of problem: Fail2Ban tries to set firewall rules to ban IP addresses, but FirewallD fails with ERROR: COMMAND_FAILED Version-Release number of selected component (if applicable): firewalld-0.4.3.3-1.fc24 fail2ban 0.9.3-3.fc24 How reproducible: Every time Steps to Reproduce: 1. Install owncloud 2. Configure fail2ban to block owncloud invalid logins 3. Purposely fail login until IP is banned. 4. Verify that IP is banned with "fail2ban-client status <owncloud_jail>" 5. Verify that site is still accessible because IP hasn't been blocked by firewalld Actual results: Banned IPs aren't blocked by Firewalld Expected results: Banned IPs can no longer connect Additional info: