Bug 196943 - security/sshguard does not detect bad logins to Cyrus IMAP over TLS
Summary: security/sshguard does not detect bad logins to Cyrus IMAP over TLS
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-20 16:46 UTC by jakob.alvermark
Modified: 2015-01-26 15:12 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (feld)


Attachments
patch-src-parser-attack_scanner (1.21 KB, patch)
2015-01-20 16:46 UTC, jakob.alvermark
no flags Details | Diff
cyrus imap pattern fix (1.91 KB, patch)
2015-01-22 21:06 UTC, Mark Felder
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jakob.alvermark 2015-01-20 16:46:21 UTC
Created attachment 151913 [details]
patch-src-parser-attack_scanner

It seems it only triggers on plaintext logins.

Example when in plaintext:
Jan 20 11:00:09 hostname imap[XXXX] badlogin: badhost.baddomain.com [6.6.6.0] plaintext username SASL(-13): authentication failure: checkpass failed

Example when on TLS:
Jan 20 11:01:33 hostname imaps[XXXX] badlogin: badhost.baddomain.com [6.6.6.0] PLAIN [SASL(-13): authentication failure: Password verification failed]

Patch submitted upstream, but since they seem slow to adopt patches, I might submit here as well.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-01-20 16:46:21 UTC
Auto-assigned to maintainer feld@FreeBSD.org
Comment 2 Mark Felder freebsd_committer freebsd_triage 2015-01-22 16:22:48 UTC
Your attached patch is oddly mangled... it would delete that entire section.

I believe this is the change you're trying to make. Is this correct?

-<cyrusimap_loginerr>"] ".*"SASL".*"checkpass failed"            { BEGIN(INITIAL); return CYRUSIMAP_SASL_LOGINERR_SUFF; }
+<cyrusimap_loginerr>"] ".*"SASL".*"failed".?$                   { BEGIN(INITIAL); return CYRUSIMAP_SASL_LOGINERR_SUFF; }


If so, I'll re-roll the patch and put it in the port.
Comment 3 jakob.alvermark 2015-01-22 20:08:12 UTC
(In reply to Mark Felder from comment #2)

Maybe I should not try to patch a patch?
You got what I meant anyway, that is what I wanted. Tanks!
Comment 4 Mark Felder freebsd_committer freebsd_triage 2015-01-22 21:06:21 UTC
Created attachment 152030 [details]
cyrus imap pattern fix

Can you test this patch for me? Thanks!
Comment 5 jakob.alvermark 2015-01-23 08:53:53 UTC
(In reply to Mark Felder from comment #4)

Yes. Works as intended.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-01-23 20:16:09 UTC
A commit references this bug:

Author: feld
Date: Fri Jan 23 20:15:35 UTC 2015
New revision: 377762
URL: https://svnweb.freebsd.org/changeset/ports/377762

Log:
  Patch parser to fix matching for Cyrus IMAP login attempts which are not
  plaintext.

  PR:		196943
  Submitted by:	jakob.alvermark@bsdlabs.com

Changes:
  head/security/sshguard/Makefile
  head/security/sshguard/files/patch-src-parser-attack_scanner.l