You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by "jbertram (via GitHub)" <gi...@apache.org> on 2024/01/19 23:03:26 UTC
[PR] ARTEMIS-4580 security settings for FQQN not enforced on send [activemq-artemis]
jbertram opened a new pull request, #4755:
URL: https://github.com/apache/activemq-artemis/pull/4755
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ARTEMIS-4580 security settings for FQQN not enforced on send [activemq-artemis]
Posted by "tabish121 (via GitHub)" <gi...@apache.org>.
tabish121 commented on PR #4755:
URL: https://github.com/apache/activemq-artemis/pull/4755#issuecomment-1904208947
LGTM, looks to need a rebase before merging
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ARTEMIS-4580 security settings for FQQN not enforced on send [activemq-artemis]
Posted by "tabish121 (via GitHub)" <gi...@apache.org>.
tabish121 commented on code in PR #4755:
URL: https://github.com/apache/activemq-artemis/pull/4755#discussion_r1459969215
##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/FQQNSendSecurityTest.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.security;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+
+import org.apache.activemq.artemis.core.config.Configuration;
+import org.apache.activemq.artemis.core.config.impl.RoleSet;
+import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
+import org.apache.activemq.artemis.core.security.Role;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager;
+import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.util.RandomUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+public class FQQNSendSecurityTest extends ActiveMQTestBase {
+
+ private final String USER = RandomUtil.randomString();
+ private final String PASS = RandomUtil.randomString();
+ private final String ROLE = RandomUtil.randomString();
+
+ @Override
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ Configuration configuration = createDefaultInVMConfig().setSecurityEnabled(true);
+ RoleSet roles1 = new RoleSet();
+ roles1.add(new Role(ROLE, true, true, true, true, true, true, true, true, true, true));
+ RoleSet roles2 = new RoleSet();
+ roles2.add(new Role(ROLE, false, false, true, true, true, true, true, true, true, true));
+ configuration.putSecurityRoles("foo::q1", roles1);
+ configuration.putSecurityRoles("foo", roles2);
+
+ ActiveMQServer server = createServer(false, configuration);
+
+ ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName());
+ SecurityConfiguration securityConfiguration = new SecurityConfiguration();
+ securityConfiguration.addUser(USER, PASS);
+ securityConfiguration.addRole(USER, ROLE);
+ securityManager.setConfiguration(securityConfiguration);
+ server.setSecurityManager(securityManager);
+
+ server.start();
+ }
+
+ @Test
Review Comment:
Shouldn't there also be a negative test to check that when not able to send to the FQQN an exception is thrown from the sender?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ARTEMIS-4580 security settings for FQQN not enforced on send [activemq-artemis]
Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on code in PR #4755:
URL: https://github.com/apache/activemq-artemis/pull/4755#discussion_r1460196178
##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/FQQNSendSecurityTest.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.security;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+
+import org.apache.activemq.artemis.core.config.Configuration;
+import org.apache.activemq.artemis.core.config.impl.RoleSet;
+import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
+import org.apache.activemq.artemis.core.security.Role;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager;
+import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule;
+import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.util.RandomUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+public class FQQNSendSecurityTest extends ActiveMQTestBase {
+
+ private final String USER = RandomUtil.randomString();
+ private final String PASS = RandomUtil.randomString();
+ private final String ROLE = RandomUtil.randomString();
+
+ @Override
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ Configuration configuration = createDefaultInVMConfig().setSecurityEnabled(true);
+ RoleSet roles1 = new RoleSet();
+ roles1.add(new Role(ROLE, true, true, true, true, true, true, true, true, true, true));
+ RoleSet roles2 = new RoleSet();
+ roles2.add(new Role(ROLE, false, false, true, true, true, true, true, true, true, true));
+ configuration.putSecurityRoles("foo::q1", roles1);
+ configuration.putSecurityRoles("foo", roles2);
+
+ ActiveMQServer server = createServer(false, configuration);
+
+ ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName());
+ SecurityConfiguration securityConfiguration = new SecurityConfiguration();
+ securityConfiguration.addUser(USER, PASS);
+ securityConfiguration.addRole(USER, ROLE);
+ securityManager.setConfiguration(securityConfiguration);
+ server.setSecurityManager(securityManager);
+
+ server.start();
+ }
+
+ @Test
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ARTEMIS-4580 security settings for FQQN not enforced on send [activemq-artemis]
Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram merged PR #4755:
URL: https://github.com/apache/activemq-artemis/pull/4755
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org