You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Fearless <vi...@voila.fr> on 2013/03/25 18:40:21 UTC
[SECURITY] permissions.perm files
Hi,
First of all, thanks for your work.
I am trying to enable security in Felix 4.0.1 by launching the following
command :
java -Djava.security.policy=all.policy -Dorg.osgi.framework.security="osgi"
-Djava.library.path=. -jar bin/felix.jar
The file all.policy contains :
grant {
permission java.security.AllPermission;
};
I put a file named permissions.perm in the directory OSGI-INF/ of my bundle
containing all the permissions my bundle must have.
When I deploy it, I can see that my bundle still has all the permissions ;
to check the permissions, here is what I am doing in Java :
System.getSecurityManager().checkPermission(... // my permissions here);
Whatever the permission is, this method never throws an exception...
In my opinion, my permissions.pem is not used/interpreted.
Did I miss or misunderstand something?
I have searched for this problem for days and I wasn't able to find any
solutions to this...
Best regards,
Frls
--
View this message in context: http://apache-felix.18485.n6.nabble.com/SECURITY-permissions-perm-files-tp5002699.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: [SECURITY] permissions.perm file ignored
Posted by Karl Pauls <ka...@gmail.com>.
Well, I can't reproduce this problem on MacOS 10.8.4. For me, downloading
felix 4.2.1 and framework.security 2.2.0 (installed by putting it into the
'bundle' dir) seems to work with:
$ java -Djava.security.policy=My.policy
-Dorg.osgi.framework.security="osgi" -jar bin/felix.jar
where:
$ cat My.policy
grant {
permission java.security.AllPermission;
};
$ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
so you'll have to give me some more informations and help me to reproduce
your problem...
regards,
Karl
On Fri, Jul 12, 2013 at 12:34 PM, Roland <wg...@ids.de> wrote:
> Hi,
> ok
>
> grant {
> permission java.security.AllPermission;
> };
>
> ERROR: Error creating bundle cache. (java.security.AccessControlException:
> access denied (java.io.FilePermission .\felix-cache read))
> java.security.AccessControlException: access denied (java.io.FilePermission
> .\felix-cache read)
> at
>
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
> at
> java.security.AccessController.checkPermission(AccessController.java:549)
> at
> java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
> at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
> at java.io.File.exists(File.java:731)
> at
>
> org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:1546)
> at java.security.AccessController.doPrivileged(Native Method)
> at
>
> org.apache.felix.framework.util.SecureAction.fileExists(SecureAction.java:308)
> at
> org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:124)
> at org.apache.felix.framework.Felix.init(Felix.java:640)
> at org.apache.felix.framework.Felix.start(Felix.java:893)
>
> Thanks!
> Roland
>
>
>
> --
> View this message in context:
> http://apache-felix.18485.x6.nabble.com/SECURITY-permissions-perm-file-ignored-tp5002699p5004279.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
--
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls
Re: [SECURITY] permissions.perm file ignored
Posted by Roland <wg...@ids.de>.
Hi,
ok
grant {
permission java.security.AllPermission;
};
ERROR: Error creating bundle cache. (java.security.AccessControlException:
access denied (java.io.FilePermission .\felix-cache read))
java.security.AccessControlException: access denied (java.io.FilePermission
.\felix-cache read)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at
java.security.AccessController.checkPermission(AccessController.java:549)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
at java.io.File.exists(File.java:731)
at
org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:1546)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.felix.framework.util.SecureAction.fileExists(SecureAction.java:308)
at
org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:124)
at org.apache.felix.framework.Felix.init(Felix.java:640)
at org.apache.felix.framework.Felix.start(Felix.java:893)
Thanks!
Roland
--
View this message in context: http://apache-felix.18485.x6.nabble.com/SECURITY-permissions-perm-file-ignored-tp5002699p5004279.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: [SECURITY] permissions.perm file ignored
Posted by Karl Pauls <ka...@gmail.com>.
can you post the stack trace or the content of your My.policy file?
regards,
Karl
On Friday, July 12, 2013, Roland wrote:
> Hi Karl,
> I installed the framework.security-bundle and configured
> -Djava.security.policy=My.policy -Dorg.osgi.framework.security="osgi"but I
> got following exception: "java.security.AccessControlException: access
> denied (java.io.FilePermission .\felix-cache read)". So I stored a
> permissions.perm to the OSGI-INF-directory but without any
> success...(java.io.FilePermission .\felix-cache read,write)
>
> Any suggestions?
> Many Thanks
> Roland
>
>
>
> --
> View this message in context:
> http://apache-felix.18485.x6.nabble.com/SECURITY-permissions-perm-file-ignored-tp5002699p5004277.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org <javascript:;>
> For additional commands, e-mail: users-help@felix.apache.org<javascript:;>
>
>
--
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls
Re: [SECURITY] permissions.perm file ignored
Posted by Roland <wg...@ids.de>.
Hi Karl,
I installed the framework.security-bundle and configured
-Djava.security.policy=My.policy -Dorg.osgi.framework.security="osgi"but I
got following exception: "java.security.AccessControlException: access
denied (java.io.FilePermission .\felix-cache read)". So I stored a
permissions.perm to the OSGI-INF-directory but without any
success...(java.io.FilePermission .\felix-cache read,write)
Any suggestions?
Many Thanks
Roland
--
View this message in context: http://apache-felix.18485.x6.nabble.com/SECURITY-permissions-perm-file-ignored-tp5002699p5004277.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: [SECURITY] permissions.perm files
Posted by Karl Pauls <ka...@gmail.com>.
Did you install the framework.security provider?
regards,
Karl
On Mon, Mar 25, 2013 at 6:40 PM, Fearless <vi...@voila.fr> wrote:
> Hi,
>
> First of all, thanks for your work.
>
> I am trying to enable security in Felix 4.0.1 by launching the following
> command :
>
> java -Djava.security.policy=all.policy -Dorg.osgi.framework.security="osgi"
> -Djava.library.path=. -jar bin/felix.jar
>
> The file all.policy contains :
>
> grant {
> permission java.security.AllPermission;
> };
>
> I put a file named permissions.perm in the directory OSGI-INF/ of my bundle
> containing all the permissions my bundle must have.
>
> When I deploy it, I can see that my bundle still has all the permissions ;
> to check the permissions, here is what I am doing in Java :
>
> System.getSecurityManager().checkPermission(... // my permissions here);
>
> Whatever the permission is, this method never throws an exception...
>
> In my opinion, my permissions.pem is not used/interpreted.
>
> Did I miss or misunderstand something?
>
> I have searched for this problem for days and I wasn't able to find any
> solutions to this...
>
> Best regards,
>
> Frls
>
>
>
>
> --
> View this message in context:
> http://apache-felix.18485.n6.nabble.com/SECURITY-permissions-perm-files-tp5002699.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
--
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls