diff options
author | Andrew Browning <ayleph@thisshitistemp.com> | 2017-08-15 02:11:06 -0400 |
---|---|---|
committer | Andrew Browning <ayleph@thisshitistemp.com> | 2017-09-20 01:48:17 -0400 |
commit | b121d89cc55551e3b2f3f160a42af998491b41d7 (patch) | |
tree | c04416df23407fbf296d1b4995ab8ec5a05cc6c5 | |
parent | eee3e41bcf572465483991e2c1b5642c362728f8 (diff) | |
download | mediagoblin-b121d89cc55551e3b2f3f160a42af998491b41d7.tar.lz mediagoblin-b121d89cc55551e3b2f3f160a42af998491b41d7.tar.xz mediagoblin-b121d89cc55551e3b2f3f160a42af998491b41d7.zip |
Fix #5460 - Log IP address for failed login
This patch logs the remote address when a login attempt fails.
-rw-r--r-- | mediagoblin/auth/views.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index 2f95fd81..fb8e7265 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import logging + import six from itsdangerous import BadSignature @@ -29,6 +31,8 @@ from mediagoblin.tools.pluginapi import hook_handle from mediagoblin.auth.tools import (send_verification_email, register_user, check_login_simple) +_log = logging.getLogger(__name__) + @allow_registration @auth_enabled @@ -105,6 +109,8 @@ def login(request): return redirect(request, "index") login_failed = True + remote_addr = request.access_route[-1] or request.remote_addr + _log.warn("Failed login attempt from %r", remote_addr) return render_to_response( request, |