ARTEMIS-1896 centralize authn failure logging
Authentication failures are currently only logged for CORE clients. This change puts the logging in a central location which all protocols use for authentication so that authentication failures are logged for all protocols.
This commit is contained in:
parent
a79798532a
commit
ef6e3948fd
|
@ -175,7 +175,6 @@ public class ActiveMQPacketHandler implements ChannelHandler {
|
|||
|
||||
response = new CreateSessionResponseMessage(server.getVersion().getIncrementingVersion());
|
||||
} catch (ActiveMQClusterSecurityException | ActiveMQSecurityException e) {
|
||||
ActiveMQServerLogger.LOGGER.securityProblemWhileCreatingSession(e.getMessage());
|
||||
response = new ActiveMQExceptionMessage(e);
|
||||
} catch (ActiveMQException e) {
|
||||
if (e.getType() == ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS) {
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.apache.activemq.artemis.core.security.Role;
|
|||
import org.apache.activemq.artemis.core.security.SecurityAuth;
|
||||
import org.apache.activemq.artemis.core.security.SecurityStore;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
|
||||
import org.apache.activemq.artemis.core.server.management.Notification;
|
||||
import org.apache.activemq.artemis.core.server.management.NotificationService;
|
||||
import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
|
||||
|
@ -149,7 +150,11 @@ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryC
|
|||
certSubjectDN = certs[0].getSubjectDN().getName();
|
||||
}
|
||||
|
||||
throw ActiveMQMessageBundle.BUNDLE.unableToValidateUser(connection.getRemoteAddress(), user, certSubjectDN);
|
||||
Exception e = ActiveMQMessageBundle.BUNDLE.unableToValidateUser(connection.getRemoteAddress(), user, certSubjectDN);
|
||||
|
||||
ActiveMQServerLogger.LOGGER.securityProblemWhileAuthenticating(e.getMessage());
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
return validatedUser;
|
||||
|
|
|
@ -1361,8 +1361,8 @@ public interface ActiveMQServerLogger extends BasicLogger {
|
|||
void negativeGlobalAddressSize(long size);
|
||||
|
||||
@LogMessage(level = Logger.Level.WARN)
|
||||
@Message(id = 222216, value = "Security problem while creating session: {0}", format = Message.Format.MESSAGE_FORMAT)
|
||||
void securityProblemWhileCreatingSession(String message);
|
||||
@Message(id = 222216, value = "Security problem while authenticating: {0}", format = Message.Format.MESSAGE_FORMAT)
|
||||
void securityProblemWhileAuthenticating(String message);
|
||||
|
||||
@LogMessage(level = Logger.Level.WARN)
|
||||
@Message(id = 222217, value = "Cannot find connector-ref {0}. The cluster-connection {1} will not be deployed.", format = Message.Format.MESSAGE_FORMAT)
|
||||
|
|
Loading…
Reference in New Issue