Add IP address to failed login attempts

This commit is contained in:
Bryan Ashby 2018-12-27 14:16:59 -07:00
parent 3864d957c9
commit 8d46a305c5
1 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ function userLogin(client, username, password, cb) {
const config = Config();
if(config.users.badUserNames.includes(username.toLowerCase())) {
client.log.info( { username : username }, 'Attempt to login with banned username');
client.log.info( { username, ip : client.remoteAddress }, 'Attempt to login with banned username');
// slow down a bit to thwart brute force attacks
return setTimeout( () => {
@ -42,7 +42,7 @@ function userLogin(client, username, password, cb) {
err = Errors.BadLogin('To many failed login attempts', ErrorReasons.TooMany);
}
client.log.info( { username : username, error : err.message }, 'Failed login attempt');
client.log.info( { username, ip : client.remoteAddress, reason : err.message }, 'Failed login attempt');
return cb(err);
}