[MDEV-575] CLOSE - TCP SECURITY - BAD Login / IP blocker - brute force security - fail2ban support Created: 2012-10-04 Updated: 2013-06-18 Resolved: 2013-06-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | roberto spadim | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | plugins | ||
| Issue Links: |
|
||||||||
| Description |
|
Implement a 'fail2ban' log, and a internal table, TCP connection blocker bad login = wrong user or wrong password, that don't give access to server and disconect Create a internal table (in memory or disk?) with: implementation:
STATUS
2) BAD_LOGIN table: 3) BAD_LOGIN log file (CSV?): 4) BAD_LOGIN table flush
5) ADD HOST TO LOG 6) ADD HOST TO INTERNAL TABLE IF now() + @@bad_login_time > STATUS bad_login_garbage_collector_max_unlock_time THEN maybe a optimization like: 7) At new IPv6 or IPv4 connection
|
| Comments |
| Comment by Jean Weisbuch [ 2012-10-04 ] |
|
You can retreive these infos from the general_log if enabled but its definitely less than optimal. Logging only authentification (having the possibility to only log failures would be even better) either to a file or to syslog would be quite handy. It would allow more granularity than the global "max_connect_errors" setting (that cover other cases than just an authentication error and as far as i know doesnt allow to retreive informations about these failures) and it could be sent directly to a parsing script or run a cron job such as fail2ban that would check the log for authentication errors and take measures such as blocking according to rules (might block at firewall level and/or at MariaDB level by running specific queries that would block the host from connecting) then unblock automatically after a certain amount of time (and would also permit to log/email these blockings) if required. That could also be a good solution to block hosts on a cluster of servers or at the router level. |
| Comment by roberto spadim [ 2012-10-04 ] |
|
yes fail2ban is a nice tool, sshguard too, but could we do a simple solution? have any plugin that could do this? the problem of fail2ban is windows port i don´t know if it run on windows server and i never tested too |
| Comment by Elena Stepanova [ 2012-10-29 ] |
|
Hi Roberto, Are you willing either to come up with a complete patch that could be merged into MariaDB, or sponsor implementation of the feature? |
| Comment by roberto spadim [ 2012-10-29 ] |
|
well i must develop one, but no idea of how much time i will spent, and when it will be done, but i can try |
| Comment by roberto spadim [ 2013-06-05 ] |
|
could i do it with audit plugins? any example? |
| Comment by roberto spadim [ 2013-06-10 ] |
|
maybe just to log it to syslog auth.log file could solve *nix problems, but windows version will not have this option (maybe bia windows log functions) |
| Comment by roberto spadim [ 2013-06-12 ] |
|
talking with sergei, i will rewrite this MDEV |
| Comment by roberto spadim [ 2013-06-12 ] |
|
now a better MDEV description |
| Comment by roberto spadim [ 2013-06-18 ] |
|
please close this one, MDEV-4644 is a better explained issue |