[JBoss Microcontainer Development] New message: "Security problems with org.jboss.test:jboss-test 1.1.5.GA"
by Flavia Rainone
JBoss development,
A new message was posted in the thread "Security problems with org.jboss.test:jboss-test 1.1.5.GA":
http://community.jboss.org/message/530163#530163
Author : Flavia Rainone
Profile : http://community.jboss.org/people/flavia.rainone@jboss.com
Message:
--------------------------------------------------------------
I'm not sure if this belongs to this forum, but I couldn't find a more appropriate forum for this either.
In JBoss AOP, we are currently using jboss:jboss-test: 1.0.3.GA. We can't upgrate because whenever we try to upgrade we start seeing several Security Errors at all points of our testsuite that try to access the System Properties.
An example of this:
java.lang.reflect.InvocationTargetException
at org.jboss.test.AbstractTestDelegate.getDelegate(AbstractTestDelegate.java:73)
at org.jboss.test.AbstractTestSetup.setUp(AbstractTestSetup.java:62)
at org.jboss.test.AbstractTestCaseWithSetup.setUp(AbstractTestCaseWithSetup.java:103)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1252)
at java.lang.System.getProperties(System.java:580)
at org.jboss.test.aop.AOPTestDelegate$1.run(AOPTestDelegate.java:51)
at org.jboss.test.aop.AOPTestDelegate$1.run(AOPTestDelegate.java:48)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.test.aop.AOPTestDelegate.<init>(AOPTestDelegate.java:47)
at org.jboss.test.aop.AOPTestWithSetup.getDelegate(AOPTestWithSetup.java:53)
This is AOPTestDelegate constructor implementation:
public AOPTestDelegate(Class<?> clazz)
{
super(clazz);
systemProps = AccessController.doPrivileged(new PrivilegedAction<Properties>()
{
public Properties run()
{
line 47>>> return (Properties)System.getProperties().clone();
}
});
}
Another example:
access denied (java.util.PropertyPermission org.jboss.test.logging.LogginPlugin read)
java.security.AccessControlException: access denied (java.util.PropertyPermission org.jboss.test.logging.LogginPlugin read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
at java.lang.System.getProperty(System.java:686)
at org.jboss.test.logging.LoggingPlugin.getInstance(LoggingPlugin.java:47)
at org.jboss.test.AbstractTestDelegate.setUpLogging(AbstractTestDelegate.java:158)
at org.jboss.test.AbstractTestDelegate.setUp(AbstractTestDelegate.java:125)
at org.jboss.test.AbstractTestSetup.setUp(AbstractTestSetup.java:63)
at org.jboss.test.AbstractTestCaseWithSetup.setUp(AbstractTestCaseWithSetup.java:103)
at org.jboss.test.aop.annotatedAdviceParams.Arg2TestCase.setUp(Arg2TestCase.java:62)
This last example is even more serious, because it happens on AbstractTestCaseWithSetup.setUp execution.
I couldn't find any refrences for how to solve this apart from a hack Adrian mentioned in another http://community.jboss.org/thread/88629?tstart=-2.
Does anybody know why these tests have no permission to access the System Properties? How do we work around this issue?
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/530163#530163
16 years, 1 month
[JBoss ESB Development] New message: "Re: Camel integration input requested"
by Hans Wolffenbuttel
JBoss development,
A new message was posted in the thread "Camel integration input requested":
http://community.jboss.org/message/530162#530162
Author : Hans Wolffenbuttel
Profile : http://community.jboss.org/people/h.wolffenbuttel
Message:
--------------------------------------------------------------
Hi Edgar,
The gateway/listener is placed inside a service right? Why not use the internal parameters for the destination instead of configured parameters?
so instead of:
<listener name="ApacheCamel" busidref="ApacheCamel" is-gateway="true">
<property name="gatewayClass" value="org.jboss.soa.esb.listeners.gateway.camel.ApacheCamelListener"></property>
<property name="protocol-uri" value="irc:breakingwoods@irc.freenode.net/#esbtest"></property>
<property name="destination-category" value="sample-apachecamelESBService"></property>
<property name="destination-name" value="sample-apachecamelESBServiceListener"></property>
</listener>
this would be:
<listener name="ApacheCamel" busidref="ApacheCamel" is-gateway="true">
<property name="gatewayClass" value="org.jboss.soa.esb.listeners.gateway.camel.ApacheCamelListener"></property>
<property name="protocol-uri" value="irc:breakingwoods@irc.freenode.net/#esbtest"></property>
</listener>
where as the retrieval of the parameters would be changed from:
String serviceCategory = listenerConfig.getRequiredAttribute(DESTINATION_CATEGORYNAME_TAG);
String serviceName = listenerConfig.getRequiredAttribute(DESTINATION_SERVICENAME_TAG);
to:
String serviceCategory = ListenerUtil.getValue(config, ListenerTagNames.SERVICE_CATEGORY_NAME_TAG) ;if (Util.isNullString(serviceCategory)){ throw new ConfigurationException("No service category defined!") ;}String serviceName = ListenerUtil.getValue(config, ListenerTagNames.SERVICE_NAME_TAG) ;
if (Util.isNullString(serviceName)){ throw new ConfigurationException("No service name defined!") ;}
Or am I missing something here?
Regards,
Hans
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/530162#530162
16 years, 1 month
[Security Development] New message: "Keeping the state of Caller principal in JBoss AppServer when authenticating from standalone WebServer"
by Eric Loh
JBoss development,
A new message was posted in the thread "Keeping the state of Caller principal in JBoss AppServer when authenticating from standalone WebServer":
http://community.jboss.org/message/530097#530097
Author : Eric Loh
Profile : http://community.jboss.org/people/eric1lyk
Message:
--------------------------------------------------------------
Dear experts,
I have problems understanding how i can maintain the Authentication Principal in the JBoss Appserver for subsequent invokations of an EJB3 Stateless session bean from a standalone client.
I have EJB3 Stateless session beans deployed on JBoss 5.1.0 AS
My Client is deployed on a Apache Tomcat Webserver (version 6.0.20)
My Client (deployed on Tomcat Webserver) uses the following Login Config to do authentication.
*myapp-login {*
* com.myapp.services.authentication.client.jaas.OasisLoginModule requisite debug="true"*
* facadeJndiName="myApp/authentication"*
* java.naming.factory.initial="org.jnp.interfaces.NamingContextFactory"*
* java.naming.factory.url.pkgs="org.jboss.naming:org.jnp.interfaces"*
* java.naming.provider.url="jnp://localhost:1099";*
* *
* org.jboss.security.ClientLoginModule sufficient debug="true"*
* multi-threaded="true";*
*};*
I realised that *org.jboss.security.ClientLoginModule is required so that the CallerPrincipal gets propagated from my Client to JBoss AppServer*
*org.jboss.security.ClientLoginModule sufficient debug="true"*
After I login, i created an InitialContext to lookup the EJB3 stateless session bean deployed in JBoss.
I try to test if the Stateless session bean can obtain the principal that i propagated frmo the Tomcat Webserver to JBoss AS
The first time i called, the context.getCallerPrincipal() was able to return the principal that i set inside the Callbackhandler.
*@Stateless*
*public class AuthenticationComponentFacadeBean extends AbstractComponentFacade<IAuthenticationComponentServiceLocator> implements IAuthenticationComponentFacade*
*{ *
* @Resource*
* SessionContext context;*
*
*
* @Override*
* public char[] resetPassword(MyCredentials credential) throws AuthenticationException*
* {*
* if (context.getCallerPrincipal() != null)*
* {*
* System.out.println("principal: " + context.getCallerPrincipal());*
* }*
But, in subsequent invocations when i create the InitialContext again, I am getting NullPointerException
*15:16:50,538 INFO [STDOUT] 2010-03-05 15:16:50,538 [ERROR] - [AuthenticationComponentFacadeBean] java.lang.NullPointerException*
* at org.jboss.ejb3.security.helpers.EJBContextHelper.getCallerPrincipal(EJBContextHelper.java:99)*
i.e. The CallerPrincipal gets lost in subsequent invocations.
Can someone tell me how i can maintain the CallerPrincipal inside JBoss AppServer until i perform a logout operation to invalidate my session?
*What is the correct way to do it?*
*
*
*Should I invoke the ClientLoginModule at my Client on Tomcat Webserver everytime i lookup a stateless session bean so that it will keep the CallerPrincipal there?*
*Is there a way to keep the CallerPrincipal without invoking the ClientLoginModule everytime i do a lookup?*
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/530097#530097
16 years, 1 month