Skip to content

Commit

Permalink
enhancement: Dovecot DATA slices messages in some statements (#1209)
Browse files Browse the repository at this point in the history
* enhancement: Dont match data since it can slice the login message

* enhancement: Update previous auth worker line also

* enhancement: Tests

* enhancement: auth line also ref: https://www.reddit.com/r/CrowdSec/comments/1hr5y61/help_please_understanding_why_dovecot_auth_fails/

* enhancement: run index workflow manually
  • Loading branch information
LaurenceJJones authored Jan 2, 2025
1 parent 1fb36a4 commit 1640d0d
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 79 deletions.
8 changes: 6 additions & 2 deletions .index.json
Original file line number Diff line number Diff line change
Expand Up @@ -8113,7 +8113,7 @@
"crowdsecurity/dovecot-logs": {
"path": "parsers/s01-parse/crowdsecurity/dovecot-logs.yaml",
"stage": "s01-parse",
"version": "0.8",
"version": "0.9",
"versions": {
"0.1": {
"digest": "3d30684b5d1ceea08ea743a2fa1697178d878bd87eb55e465432c000da162b42",
Expand Down Expand Up @@ -8146,9 +8146,13 @@
"0.8": {
"digest": "638a4596262469ddaff8d608921513f2e84cb5e822f67e902e0097812ff28ada",
"deprecated": false
},
"0.9": {
"digest": "daf37a858cc3f3359b9637552f768acc59d7f29db702399fb6e720193dfd5673",
"deprecated": false
}
},
"content": "I2NvbnRyaWJ1dGlvbiBieSBAbHRzaWNoCm9uc3VjY2VzczogbmV4dF9zdGFnZQpkZWJ1ZzogZmFsc2UKZmlsdGVyOiAiZXZ0LlBhcnNlZC5wcm9ncmFtID09ICdkb3ZlY290JyIKbmFtZTogY3Jvd2RzZWN1cml0eS9kb3ZlY290LWxvZ3MKZGVzY3JpcHRpb246ICJQYXJzZSBkb3ZlY290IGxvZ3MiCm5vZGVzOgogIC0gZ3JvazoKICAgICAgcGF0dGVybjogIiV7V09SRDpwcm90b2NvbH0tbG9naW46ICV7REFUQTpkb3ZlY290X2xvZ2luX21lc3NhZ2V9OiB1c2VyPTwle0RBVEE6ZG92ZWNvdF91c2VyfT4uKiwgcmlwPSV7SVA6ZG92ZWNvdF9yZ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pbHVyZScsICdQYXNzd29yZCBtaXNtYXRjaCcsICdwYXNzd29yZCBtaXNtYXRjaCcsICdhdXRoIGZhaWxlZCcsICd1bmtub3duIHVzZXInXSwge2V2dC5QYXJzZWQuZG92ZWNvdF9sb2dpbl9tZXNzYWdlIGNvbnRhaW5zICN9KSA/ICdhdXRoX2ZhaWxlZCcgOiAnJyIK",
"description": "Parse dovecot logs",
"author": "crowdsecurity",
"labels": null
Expand Down
2 changes: 2 additions & 0 deletions .tests/dovecot-logs/dovecot-logs.log
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Apr 29 15:54:19 mail dovecot: auth-worker(14864): conn unix:auth-worker (pid=148
Apr 29 15:54:21 mail dovecot: auth-worker(14877): conn unix:auth-worker (pid=14830,uid=109): auth-worker<5>: pam(needle,5.34.207.161): pam_authenticate() failed: Authentication failure (Password mismatch?)
Apr 18 08:31:30 mail dovecot: auth-worker(63712): conn unix:auth-worker (pid=58074,uid=109): auth-worker<4>: sql(contact,220.169.110.101): unknown user
Apr 18 08:31:30 mail dovecot: auth-worker(63712): Info: conn unix:auth-worker (pid=58074,uid=109): auth-worker<4>: sql(contact,220.169.110.101): unknown user
2024-12-31T06:56:17.784598+01:00 mail dovecot: auth-worker(10377): conn unix:auth-worker (pid=919,uid=112): auth-worker<1>: sql([email protected],192.168.1.1): unknown user (given password: Password123$)
2025-01-01T17:05:06.533969+01:00 mail2 dovecot: auth: passwd-file([email protected],192.168.1.1): unknown user (SHA1 of given password: 21bd12)
Loading

0 comments on commit 1640d0d

Please sign in to comment.