From 2693ffeab02b10f3fd885ee910401c3eb437b083 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 22 Nov 2019 10:23:11 -0500 Subject: [PATCH] include ip in log message. only for self host --- src/Core/IdentityServer/ResourceOwnerPasswordValidator.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Core/IdentityServer/ResourceOwnerPasswordValidator.cs b/src/Core/IdentityServer/ResourceOwnerPasswordValidator.cs index 8f360d789e..cb206d0e7c 100644 --- a/src/Core/IdentityServer/ResourceOwnerPasswordValidator.cs +++ b/src/Core/IdentityServer/ResourceOwnerPasswordValidator.cs @@ -220,8 +220,11 @@ namespace Bit.Core.IdentityServer twoFactorRequest ? EventType.User_FailedLogIn2fa : EventType.User_FailedLogIn); } - _logger.LogWarning(Constants.BypassFiltersEventId, "Failed login attempt.{0}", - twoFactorRequest ? " 2FA invalid." : string.Empty); + if(_globalSettings.SelfHosted) + { + _logger.LogWarning(Constants.BypassFiltersEventId, "Failed login attempt{0}{1}", + twoFactorRequest ? ", 2FA invalid." : ".", $" {_currentContext.IpAddress}"); + } await Task.Delay(2000); // Delay for brute force. context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, customResponse: new Dictionary