启用 Java 安全管理器 OSGi Equinox 并限制捆绑权限 [英] Enable Java Security Manager OSGi Equinox and Restrict Bundle Permissions
问题描述
我想为基于 OSGi equinox 的系统添加 Java 安全管理器.我的问题是在启用 JSM 后,每个包都从框架中获得了 BundlePermission,这导致所有包的 java.lang.AllPermission.
I want to add Java Security Manager for a OSGi equinox based system. My problem is that after enabling the JSM, every bundle get the BundlePermission from the framework, which result in java.lang.AllPermission to all the bundles.
如何限制不同策略的捆绑包?例如,根据安装位置限制某些权限.等等.
How can I restrict for bundles for different policies?, e.g restrict some permissions based on the install location. etc..
推荐答案
您应该使用 ConditionalPermissionAdmin 服务来为束设置所需的权限.请参阅 https://osgi.org/javadoc/r4v43/core/org/osgi/service/condpermadmin/ConditionalPermissionAdmin.html.
You should use the ConditionalPermissionAdmin service to set the desired permissions for the bundles. See https://osgi.org/javadoc/r4v43/core/org/osgi/service/condpermadmin/ConditionalPermissionAdmin.html.
这篇关于启用 Java 安全管理器 OSGi Equinox 并限制捆绑权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!