Is there a way to block 'unknown user' from Dovecot logins? #4554
-
|
I am seeing a LOT of these attempts in my logs recently ...
... is there a way to block 'unknown user' or do something with fail2ban? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
This just means someone tried to login to Dovecot with a username that doesn't exist. If this isn't from legitimate users making mistakes or running into some other related issue, then it's most likely automated attempts to login (but not likely targeting you specifically, just low-hanging fruit with common usernames / passwords). Fail2Ban should be able to monitor for such and ban the IP, but that isn't my area of expertise in the project 😅 Just be mindful of legitimate failures also being possible depending on your users, and that automated attempts will just keep coming in via different IPs anyway. For the most part though, provided you have strong passwords (a decent amount of entropy is all that matters really), these attempts won't compromise any actual accounts it'd just be noise in the logs that you can filter out. This sort of activity is quite common for publicly exposed services regardless, like a VPS getting hammered with SSH login attempts. I've had some instances secured with a 5 random word password (all lowercase letters, no special chars), and that doesn't get compromised since the entropy is decent enough (different story if someone were to target that server specifically, but there's often more affordable attacks instead in that case). One option that could probably work better is using mTLS, which would require connecting clients to provide their own client certificate for establishing trust before proceeding. I'm pretty sure Dovecot supports this, but DMS has no official support to assist with that, and again it might add friction to your users to configure at their clients, you're effectively giving them a VIP card or stamp like at an event, so anyone that presents that is allowed to pass on through. A similar feature is IP white/allow lists when that is acceptable to restrict on. Some do this with VPNs, which would be fine for the Dovecot ports to interact with mail, but you'd still need Postfix port 25 public to receive mail from public MTAs. |
Beta Was this translation helpful? Give feedback.
Yeah, if it's not publicly accessible then the logs would only represent failed attempts from authorized clients (on your TS network).
Just ensure port 25 is reachable publicly if you want other mail servers to be able to reach you.
I think you will want to publish DMS container ports to the different networks, so port 25 might be
0.0.0.0:25:25, and other ports could be to your TS IP instead of0.0.0.0. Presumably that should go smoothly 😅If instead Docker isn't using a single network interface within the container, it can be a little tricky. I think there might be another caveat known about outbound connections if the hos…