在最低安全上下文中运行 DLR 嵌入式脚本

发布于 2024-08-23 09:33:11 字数 213 浏览 3 评论 0原文

我需要指明正确的方向。我已将 Iron Python 脚本主机嵌入到一个简单的 C# 应用程序中,但现在我需要了解锁定用户生成的 IronPython 或 IronRuby 脚本安全性的最佳实践。

具体来说,防止库导入的策略是什么?.NET 中是否有办法在不同的安全上下文中运行代码块或线程,例如防止文件系统访问?另外,是否可以为该上下文分配内置级别或角色而不是实际用户?

谢谢!

I need to get pointed in the right direction. I have embedded an Iron Python scripting host into a simple C# application, but now I need to know the best practices for locking down security on a user generated IronPython or IronRuby script.

Specifically, what are the strategies for preventing library imports and isn't there a way in .NET to run a block of code or a thread in a different security context, for instance to prevent file system access? Also, can this context be assigned a built-in level or role rather than an actual user?

Thanks!

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

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

发布评论

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

评论(1

野鹿林 2024-08-30 09:33:11

您应该在不同的应用程序域中运行脚本主机,并通过 设置安全策略使用沙箱 API 的证据属性

You should run scripting host in different appdomain, and setup Security Policies via Evidence property using sandboxing API

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