From 1cb43ceac59cd4f514666264cfc9bcbccbed0cb7 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Fri, 22 Sep 2023 12:10:34 -0500 Subject: [PATCH] Adjust log levels for realms/api key authc --- .../xpack/security/authc/ApiKeyAuthenticator.java | 4 ++-- .../xpack/security/authc/RealmsAuthenticator.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyAuthenticator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyAuthenticator.java index 43423c8884235..92cb6cb8ae044 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyAuthenticator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyAuthenticator.java @@ -65,12 +65,12 @@ public void authenticate(Context context, ActionListener format("Authentication using apikey failed - %s", authResult.getMessage()), authResult.getException() ); } else { - logger.warn("Authentication using apikey failed - {}", authResult.getMessage()); + logger.debug("Authentication using apikey failed - {}", authResult.getMessage()); } } listener.onResponse(AuthenticationResult.unsuccessful(authResult.getMessage(), authResult.getException())); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/RealmsAuthenticator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/RealmsAuthenticator.java index 20e8205192457..2968588b75d17 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/RealmsAuthenticator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/RealmsAuthenticator.java @@ -104,7 +104,7 @@ static AuthenticationToken extractToken(Context context) { } } } catch (Exception e) { - logger.warn("An exception occurred while attempting to find authentication credentials", e); + logger.debug("An exception occurred while attempting to find authentication credentials", e); throw context.getRequest().exceptionProcessingRequest(e, null); } if (context.getUnlicensedRealms().isEmpty() == false) { @@ -167,7 +167,7 @@ private void consumeToken(Context context, ActionListener format( "Authentication of [%s] was terminated by realm [%s] - %s", authenticationToken.principal(), @@ -178,7 +178,7 @@ private void consumeToken(Context context, ActionListener { - logger.warn( + logger.debug( () -> format( "An error occurred while attempting to authenticate [%s] against realm [%s]", authenticationToken.principal(), @@ -259,7 +259,7 @@ private static void consumeNullUser( messages.forEach((realm, tuple) -> { final String message = tuple.v1(); final String cause = tuple.v2() == null ? "" : " (Caused by " + tuple.v2() + ")"; - logger.warn("Authentication to realm {} failed - {}{}", realm.name(), message, cause); + logger.debug("Authentication to realm {} failed - {}{}", realm.name(), message, cause); }); if (context.getUnlicensedRealms().isEmpty() == false) { logger.warn(