如何分析 .net 程序集需要哪些权限

发布于 2024-10-31 02:30:39 字数 302 浏览 7 评论 0原文

我需要知道程序集请求哪些权限。经许可,我的意思是例如 WebPermission

背景:我有一个在沙箱中执行插件的服务。这些插件受到代码访问安全性的限制。例如:不允许他们访问文件系统或注册表。网络仅限于http,...

我想在我们的构建过程中分析这些插件,以确保只使用类,这些类被授予的权限所覆盖。

I need to know which permissions are requested by an assembly. With permission I mean for example the WebPermission

Background: I have a service which executes plugins in a sandbox. These plugins are restricted with code-access security. For example: they aren't allowed to access the file system or the registry. Networking is restricted to only http, ...

I would like to analyze these plugins in our build-process to ensure that only classes are used, which are covered by the granted permissions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甚是思念 2024-11-07 02:30:39

在 .NET 2.0 到 3.5 中,permcalc 工具允许您为程序集提取“最佳猜测”最小权限集。然而,该工具尚未针对 .NET 4.0 进行更新,例如,新的透明度方法将对分析结果产生相当大的影响。

AFAIK,.NET 4.0 没有可用的 permcalc 替代品(微软或第三方,商业或免费)。如果没有这样的工具,验证插件的最佳选择可能是在运行时权限集下运行一组适当的集成测试。

In .NET 2.0 through 3.5, the permcalc tool would have allowed you to extract a "best guess" minimum permission set for an assembly. However, the tool has not been updated for .NET 4.0 where, for example, the new transparency approach would have a considerable impact on the analysis results.

AFAIK, there is no permcalc substitute (Microsoft or third-party, commercial or free) available for .NET 4.0. In the absence of such a tool, your best bet for verifying the plug-ins would probably be an appropriate set of integration tests run under the runtime permission set.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文