소스 검색

api: Log API authorization failures. (#7575)

André Colomb 4 년 전
부모
커밋
130d14cec9
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      lib/api/api_auth.go

+ 3 - 0
lib/api/api_auth.go

@@ -35,6 +35,9 @@ func emitLoginAttempt(success bool, username, address string, evLogger events.Lo
 		"username":      username,
 		"remoteAddress": address,
 	})
+	if !success {
+		l.Infof("Wrong credentials supplied during API authorization from %s", address)
+	}
 }
 
 func basicAuthAndSessionMiddleware(cookieName string, guiCfg config.GUIConfiguration, ldapCfg config.LDAPConfiguration, next http.Handler, evLogger events.Logger) http.Handler {