diff --git a/common/src/main/java/io/brokerqe/claire/ArtemisConstants.java b/common/src/main/java/io/brokerqe/claire/ArtemisConstants.java index 8aeda7e..03a3998 100644 --- a/common/src/main/java/io/brokerqe/claire/ArtemisConstants.java +++ b/common/src/main/java/io/brokerqe/claire/ArtemisConstants.java @@ -190,9 +190,8 @@ static String getArtemisStartingServerVersionString(String version) { // Audit Log patterns String LOG_AUDIT_AUTHENTICATION_SUCC_PATTERN = ".* AMQ601715: User %s\\(%s\\)@.* successfully authenticated"; - String LOG_AUDIT_AUTHENTICATION_FAIL_PRODUCE_PATTERN = ".* AMQ601264: User %s\\(%s\\).* gets security check failure.*AMQ229032: User: %s does not have permission='SEND' on address %s.*"; + String LOG_AUDIT_AUTHENTICATION_FAIL_PRODUCE_PATTERN = ".* AMQ601264: User %s\\(%s\\).* gets security check failure.*(AMQ229213|AMQ229032): User: %s does not have permission='SEND' (for queue %s )?on address %s.*"; String LOG_AUDIT_AUTHENTICATION_FAIL_CONSUME_PATTERN = ".* AMQ601264: User %s\\(%s\\).* gets security check failure.*AMQ229213: User: %s does not have permission='CONSUME' for queue %s on address %s.*"; - // 2023-10-18 09:07:00,454 [AUDIT](Thread-12 (activemq-netty-threads)) AMQ601264: User anonymous@192.168.0.2:59866 gets security check failure: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ229213: User: alice does not have permission='CONSUME' for queue myQueue on address myAddress] String LOG_AUDIT_CREATE_ADDRESS_PATTERN_CORE = ".* AMQ601262: User %s\\(%s\\).* is creating address on target resource:.*with parameters:.*%s::%s.*"; String LOG_AUDIT_CREATE_ADDRESS_PATTERN_AMQP = ".* AMQ601262: User %s\\(%s\\)@.* is creating address on target resource:.* with parameters:.*name=%s.*"; String LOG_AUDIT_CREATE_QUEUE_PATTERN = ".* AMQ601065: User %s\\(%s\\).*is creating a queue on target resource:.*with parameters.* name=myQueue.*address=myAddress.*"; diff --git a/standalone-suite/src/test/java/io/brokerqe/claire/logging/audit/AuditLogTests.java b/standalone-suite/src/test/java/io/brokerqe/claire/logging/audit/AuditLogTests.java index 6a7800b..073f21e 100644 --- a/standalone-suite/src/test/java/io/brokerqe/claire/logging/audit/AuditLogTests.java +++ b/standalone-suite/src/test/java/io/brokerqe/claire/logging/audit/AuditLogTests.java @@ -74,7 +74,6 @@ public class AuditLogTests extends AbstractSystemTests { void setupEnv() { String artemisName = "artemis"; ArtemisConfigData artemisConfigData = new ArtemisConfigData(); - String tuneFile; LOGGER.info("Creating artemis instance: " + artemisName); if (isMinimumTestVersion(ArtemisVersion.VERSION_2_28)) { artemisConfigData.withTuneFile("tune.yaml.jinja2"); @@ -100,7 +99,7 @@ void setupEnv() { bobFormattedAuth = String.format(ArtemisConstants.LOG_AUDIT_AUTHENTICATION_SUCC_PATTERN, ArtemisConstants.BOB_NAME, ArtemisConstants.ROLE_RECEIVERS); bobFormattedSent = String.format(ArtemisConstants.LOG_AUDIT_RECEIVED_MESSAGE_PATTERN, ArtemisConstants.BOB_NAME, ArtemisConstants.ROLE_RECEIVERS, queue); - bobFormattedRecv = String.format(ArtemisConstants.LOG_AUDIT_AUTHENTICATION_FAIL_PRODUCE_PATTERN, ArtemisConstants.BOB_NAME, ArtemisConstants.ROLE_RECEIVERS, ArtemisConstants.BOB_NAME, address); + bobFormattedRecv = String.format(ArtemisConstants.LOG_AUDIT_AUTHENTICATION_FAIL_PRODUCE_PATTERN, ArtemisConstants.BOB_NAME, ArtemisConstants.ROLE_RECEIVERS, ArtemisConstants.BOB_NAME, queue, address); adminFormattedAuth = String.format(ArtemisConstants.LOG_AUDIT_AUTHENTICATION_SUCC_PATTERN, ArtemisConstants.ADMIN_NAME, ArtemisConstants.ROLE_ADMIN); adminFormattedAddressCore = String.format(ArtemisConstants.LOG_AUDIT_CREATE_ADDRESS_PATTERN_CORE, ArtemisConstants.ADMIN_NAME, ArtemisConstants.ROLE_ADMIN, address, queue); adminFormattedAddressAmqp = String.format(ArtemisConstants.LOG_AUDIT_CREATE_ADDRESS_PATTERN_AMQP, ArtemisConstants.ADMIN_NAME, ArtemisConstants.ROLE_ADMIN, address, queue); @@ -131,8 +130,9 @@ void webConsoleLoginLogoutTest() { protected void checkAuditLogs(List checkPatternLogs) { String auditLog = TestUtils.readFileContent(auditLogPath.toFile()); - LOGGER.debug("auditLog: {}", auditLog); + LOGGER.trace("auditLog: {}", auditLog); for (String patternLog : checkPatternLogs) { + LOGGER.debug("Checking audit log: {}", patternLog); assertThat(auditLog).containsPattern(patternLog); } }