You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Achim Nierbeck <ac...@ptv.de> on 2010/10/04 11:15:03 UTC

Tricky question about SecurityManager

Hi, 

I have a special Problem I would like to solve with the SecurityManger. But
first my Problem I have: 
I have a bundle containing a third party library I have to use. This Library
does call system.Exit(?) if it looses it's connection to a corresponding
server. I know that this is really bad (actually mean) but the quickes way
of shipping around this problem is using the service wrapper and do a
restart. But this is not a nice way of doing especially this system.exit
forces a hard shutdown :(
I googled around and found that there is one solution for this, use a
security manager which disallows System.Exit. 
Now the tricky part, how do I specify a securityManager just for this bundle
preventing it from using System.Exit?

Thank you in Advance 
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Tricky-question-about-SecurityManager-tp1628642p1628642.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Tricky question about SecurityManager

Posted by Achim Nierbeck <bc...@googlemail.com>.
Just for your Information, 
I tried working on this last night, and it looks like it's no easy task
since the activation of the SecurityManager does work right away, but
somehow the destination for the policy file is not passed. 
I already had to patch the main class. But I will keep on up with this. 


Guillaume Nodet wrote:
> 
> Yeah, afaik, that's the way it should be done.  I have actaully never
> setup
> a security manager for OSGi (i have hardly used such  this security
> layer),
> so i'm not really sure how to help.
> 
> I know Felix Framework has a special extension for the security bits, see
> https://svn.apache.org/repos/asf/felix/trunk/framework.security/
> This module implements the ConditionalPermissionAdmin and PermissionAdmin
> afaik which are both described in the OSGi r4 core spec.
> 
> I'd think the best place to ask would be on felix users/dev list, are
> people
> familiar with the security bits may hang over there.
> 
> I think it would be interesting to have a nice howto describing how to set
> up those security bits in Karaf ;-)
> 
> On Mon, Oct 4, 2010 at 11:15, Achim Nierbeck <ac...@ptv.de>
> wrote:
> 
>>
>> Hi,
>>
>> I have a special Problem I would like to solve with the SecurityManger.
>> But
>> first my Problem I have:
>> I have a bundle containing a third party library I have to use. This
>> Library
>> does call system.Exit(?) if it looses it's connection to a corresponding
>> server. I know that this is really bad (actually mean) but the quickes
>> way
>> of shipping around this problem is using the service wrapper and do a
>> restart. But this is not a nice way of doing especially this system.exit
>> forces a hard shutdown :(
>> I googled around and found that there is one solution for this, use a
>> security manager which disallows System.Exit.
>> Now the tricky part, how do I specify a securityManager just for this
>> bundle
>> preventing it from using System.Exit?
>>
>> Thank you in Advance
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Tricky-question-about-SecurityManager-tp1628642p1628642.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
> 
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
> 
> 
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Tricky-question-about-SecurityManager-tp1628642p1641500.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Tricky question about SecurityManager

Posted by Guillaume Nodet <gn...@gmail.com>.
Yeah, afaik, that's the way it should be done.  I have actaully never setup
a security manager for OSGi (i have hardly used such  this security layer),
so i'm not really sure how to help.

I know Felix Framework has a special extension for the security bits, see
https://svn.apache.org/repos/asf/felix/trunk/framework.security/
This module implements the ConditionalPermissionAdmin and PermissionAdmin
afaik which are both described in the OSGi r4 core spec.

I'd think the best place to ask would be on felix users/dev list, are people
familiar with the security bits may hang over there.

I think it would be interesting to have a nice howto describing how to set
up those security bits in Karaf ;-)

On Mon, Oct 4, 2010 at 11:15, Achim Nierbeck <ac...@ptv.de> wrote:

>
> Hi,
>
> I have a special Problem I would like to solve with the SecurityManger. But
> first my Problem I have:
> I have a bundle containing a third party library I have to use. This
> Library
> does call system.Exit(?) if it looses it's connection to a corresponding
> server. I know that this is really bad (actually mean) but the quickes way
> of shipping around this problem is using the service wrapper and do a
> restart. But this is not a nice way of doing especially this system.exit
> forces a hard shutdown :(
> I googled around and found that there is one solution for this, use a
> security manager which disallows System.Exit.
> Now the tricky part, how do I specify a securityManager just for this
> bundle
> preventing it from using System.Exit?
>
> Thank you in Advance
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Tricky-question-about-SecurityManager-tp1628642p1628642.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com