-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
- Gitea version (or commit ref): 1.4.3
- Git version: 2.17.1
- Operating system: Ubuntu 16.04
- Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
- No
- Not relevant
Description
A brute force attack on a user's password is possible using the migrate repo functionality. The standard advice for stopping brute force attacks on gitea is to use fail2ban (docs here: https://github.com/go-gitea/gitea/blob/master/docs/content/doc/usage/fail2ban-setup.md). However, the log message printed when an authentication attempt fails via "migrate repo" does not include the host / IP of the attacker, so it's not possible to set up fail2ban to ban the user.
The log message appears to be 2018/07/30 22:10:52 [...routers/repo/http.go:153 HTTP()] [E] invalid credentials
I think if we can have gitea log the IP, then we can add this error to the fail2ban filter in the gitea docs, and then fail2ban can handle this kind of login attempt as well.
Thanks!