0

all.

I am trying to enable Felix framework security features on Apache Karaf(version 3.0 +), but I could not find any official (or even unofficial) instructions on doing this.

The system.properties file (in Karaf/etc folder), in fact, contains following contents.

    #
    # Security properties
    #
    # To enable OSGi security, uncomment the properties below,
    # install the framework-security feature and restart.
    #
    java.security.policy=${karaf.etc}/all.policy
    org.osgi.framework.security=osgi
    org.osgi.framework.trust.repositories=${karaf.etc}/trustStore.ks

When I uncomment those two properties and execute Karaf, it gives the following error message:

 Exception in thread "CM Configuration Updater" java.security.AccessControlException: access denied ("org.osgi.framework.AdaptPermission" "org.osgi.framework.wiring.BundleRevision" "adapt")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
    at java.security.AccessController.checkPermission(AccessController.java:559)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at org.apache.felix.framework.BundleImpl.checkAdapt(BundleImpl.java:1058)
    at org.apache.felix.framework.BundleImpl.adapt(BundleImpl.java:1066)

In all.policy file, it looks like it is giving all the permissions required to all components:

grant {
   permission java.security.AllPermission;
}; 

I've done some googling to find anyone else ran into this issue, and I found this one: https://issues.apache.org/jira/browse/KARAF-3400 It says this issue actually arises due to a bug.

Is it really a bug or some minor configuration error? Is there anyone succeeded in enabling felix security on Karaf version 3.0+?

sdner
  • 1
  • 2
  • Works fine on a fresh download of karaf 3.0.3 . Any more information? Is this a fresh install? Specific karaf version? – Sheena Artrip Mar 29 '15 at 06:14
  • I've tried karaf version 3.0.2, 3.0.3, and 4.0.0 M2 (fresh install), and all of them resulted the access control exception shown above. Have you installed felix security feature ? you have to manually install it by "install framework-security" on the karaf console. Those exceptions were thrown right after the installation of the feature. – sdner Mar 29 '15 at 14:37

0 Answers0