Bug 1329919
Summary: | sendmail-auth.conf filter never matchs on failregex condition | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | dan |
Component: | fail2ban | Assignee: | Orion Poplawski <orion> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 25 | CC: | athmanem, axel.thimm, dan, jonathan.underwood, orion, vonsch |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | fail2ban-0.9.6-2.fc25 fail2ban-0.9.6-2.fc24 fail2ban-0.9.6-2.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-01-14 01:27:42 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: | |
Embargoed: |
Description
dan
2016-04-24 23:45:47 UTC
Results of fail2ban-regex check: fail2ban-regex "systemd-journal" -m _SYSTEMD_UNIT=sendmail.service /etc/fail2ban/filter.d/sendmail-auth.conf Running tests ============= Use failregex filter file : sendmail-auth, basedir: /etc/fail2ban Use journal match : _SYSTEMD_UNIT=sendmail.service Results ======= Failregex: 298 total |- #) [# of hits] regular expression | 1) [298] ^\s*(<[^.]+\.[^.]+>)?\s*(?:\S+ )?(?:kernel: \[ *\d+\.\d+\] )?(?:@vserver_\S+ )?(?:(?:\[\d+\])?:\s+[\[\(]?(?:sm-(mta|acceptingconnections)|sendmail)(?:\(\S+\))?[\]\)]?:?|[\[\(]?(?:sm-(mta|acceptingconnections)|sendmail)(?:\(\S+\))?[\]\)]?:?(?:\[\d+\])?:?)?\s(?:\[ID \d+ \S+\])?\s*\w{14}: (\S+ )?\[<HOST>\]( \(may be forged\))?: possible SMTP attack: command=AUTH, count=\d+$ `- Ignoreregex: 0 total Lines: 232074 lines, 0 ignored, 298 matched, 231776 missed [processed in 33.38 sec] Missed line(s): too many to print. Use --print-all-missed to print all 231776 lines Update: works fine when logpath = /var/log/maillog. Fails to properly start when logpath is removed to go against journal: Apr 25 14:54:42 ears.private systemd[1]: Starting Fail2Ban Service... -- Subject: Unit fail2ban.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit fail2ban.service has begun starting up. Apr 25 14:54:42 ears.private fail2ban-client[12630]: ERROR Failed during configuration: Bad value substitution: Apr 25 14:54:42 ears.private fail2ban-client[12630]: section: [sendmail] Apr 25 14:54:42 ears.private fail2ban-client[12630]: option : action Apr 25 14:54:42 ears.private fail2ban-client[12630]: key : logpath Apr 25 14:54:42 ears.private fail2ban-client[12630]: rawval : , chain="%(chain)s"] Apr 25 14:54:42 ears.private systemd[1]: fail2ban.service: Control process exited, code=exited status=255 Apr 25 14:54:42 ears.private systemd[1]: Failed to start Fail2Ban Service. -- Subject: Unit fail2ban.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit fail2ban.service has failed. -- -- The result is failed. Apr 25 14:54:42 ears.private systemd[1]: fail2ban.service: Unit entered failed state. Apr 25 14:54:42 ears.private audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:in Apr 25 14:54:42 ears.private systemd[1]: fail2ban.service: Failed with result 'exit-code'. Apr 25 14:54:43 ears.private systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart. Apr 25 14:54:43 ears.private systemd[1]: fail2ban.service: Start request repeated too quickly. Apr 25 14:54:43 ears.private audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:in Apr 25 14:54:43 ears.private systemd[1]: Failed to start Fail2Ban Service. -- Subject: Unit fail2ban.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit fail2ban.service has failed. -- -- The result is failed. Apr 25 14:54:43 ears.private audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:ini Apr 25 14:54:43 ears.private systemd[1]: fail2ban.service: Unit entered failed state. sendmail-auth.conf needed a journalmatch line. However, to get around the failure to start, the jail.local section for [sendmail] needs the logpath variable to be present, even if it is null: [DEFAULT] banTime = 86400 findtime = 14400 maxRetry = 3 ignoreip = 127.0.0.0/8 192.168.0.0/24 banaction = firewallcmd-ipset action = %(action_mwl)s sender = fail2ban destemail = dan [sshd] enabled = true [sendmail] enabled = true port = 25,465 filter = sendmail-auth logpath = fail2ban-0.9.5-3.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-07310f15dc I tested this and there is still an issue with the filter. As distributed, sendmail-auth.conf contains: _daemon = (?:sm-(mta|acceptingconnections)) This does not provide a match against my journal. Changing the line to read: _daemon = sendmail provides numerous matches. Here is a sample journal line: Oct 18 22:14:39 zzzz.private sendmail[15989]: u9J2ER37015989: 108.61.191.82.vultr.com [108.61.191.82] (may be forged): possible SMTP attack: command=AUTH, count=7 As you can see, the distributed "_daemon =" line will never match. This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. 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 '23'. 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 23 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. Also applies to FC24, bumping version. Filed upstream Bug verified in FC25, bumping version. fail2ban-0.9.6-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-33e3a599fa fail2ban-0.9.6-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-57b616d0bb fail2ban-0.9.6-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4cccf70ef9 fail2ban-0.9.6-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-57b616d0bb fail2ban-0.9.6-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4cccf70ef9 fail2ban-0.9.6-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-33e3a599fa fail2ban-0.9.6-2.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-fc9588cf24 fail2ban-0.9.6-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-bb1e01ca29 fail2ban-0.9.6-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-fc4bbe2631 fail2ban-0.9.6-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-bb1e01ca29 fail2ban-0.9.6-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-fc4bbe2631 fail2ban-0.9.6-2.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-fc9588cf24 This is now working under 0.9.6-2 and may be closed. fail2ban-regex "systemd-journal" /etc/fail2ban/filter.d/sendmail-auth.conf Running tests ============= Use failregex filter file : sendmail-auth, basedir: /etc/fail2ban Use systemd journal Use encoding : UTF-8 Use journal match : _SYSTEMD_UNIT=sendmail.service Results ======= Failregex: 66 total |- #) [# of hits] regular expression | 1) [66] ^(?:\[\])?\s*(?:<[^.]+\.[^.]+>\s+)?(?:\S+\s+)?(?:kernel: \[ *\d+\.\d+\]\s+)?(?:@vserver_\S+\s+)?(?:(?:(?:\[\d+\])?:\s+[\[\(]?(?:sendmail|sm-(?:mta|acceptingconnections))(?:\(\S+\))?[\]\)]?:?|[\[\(]?(?:sendmail|sm-(?:mta|acceptingconnections))(?:\(\S+\))?[\]\)]?:?(?:\[\d+\])?:?)\s+)?(?:\[ID \d+ \S+\]\s+)?\w{14}: (\S+ )?\[<HOST>\]( \(may be forged\))?: possible SMTP attack: command=AUTH, count=\d+$ `- Ignoreregex: 0 total Lines: 273223 lines, 0 ignored, 66 matched, 273157 missed [processed in 51.81 sec] fail2ban-0.9.6-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report. fail2ban-0.9.6-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report. fail2ban-0.9.6-2.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report. |