English 中文(简体)
Is there a way to secure access to bundles in OSGi?
原标题:

I have an application consisting of several OSGi bundles. I would like to enforce that some of them only provide other bundles access to their services if a valid token (e. g. a license key) has been presented.

Here s why I would want to restrict access to those bundles:

  • Security: They don t have their own access policies because these depend on what application is using the bundle. This means they have to trust in the client bundle to have verified the permissions of the application or user they are representing. I would like to keep control over what access control schemes I trust.
  • Reliability: I allow and encourage the development of third-party modules to add functionality to my system. To be able to guarantee some reliability, I want to control at which level those extensions interact with my system. Also, I want to make sure that my own bundles are only used in combinations that have been tested.
  • Licensing: There might be functionality in some modules that can only be used with the proper license, or, I might want to ensure that customers can t swap bundles between different installations.

I have read some about the ServicePermission class and related from the OSGi framework, but it appears to me that these let the site administrator control the access policy, as opposed to the bundle manufacturer, which is what I want.

问题回答

Your use-case seems to be quite complex, so I m not sure if this answers your question fully. However you might take a look at Service Hooks, a new feature added in OSGi Release 4, Version 4.2.

With Find Hook it should be possible to "look at, and reduce, the results of the getServiceReference and getServiceReferences methods. This hook can remove Service Reference objects from the result, also effectively hiding the service from the caller." (from article written by Peter Kriens)

Using this feature you can implement your own mechanism for client bundles to "authorize" themselves to access specific services (or conversely "inspect" the client bundle to determine if access to a specific service should be granted).





相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

MALICIOUS_CODE EI_EXPOSE_REP Medium

I run findbugs against all of my code and only tackle the top stuff. I finally got the top stuff resolved and now am looking at the details. I have a simple entity, say a user: public class User ...

XSS on jsbin.com

Anyone know if jsbin.com implements any protection for XSS or other javascript attacks? I see jsbin links used fairly regularly on sites like this one and I can t find any indication from the site ...

Make md5 strong

Im making a website that will intergrate with game that only support md5 hashing metod (atm). Which ofc is not especially safe anymore. But how could i make it stronger? Should I just generate long ...

Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

热门标签