在最低安全上下文中运行 DLR 嵌入式脚本
我需要指明正确的方向。我已将 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在不同的应用程序域中运行脚本主机,并通过 设置安全策略使用沙箱 API 的证据属性
You should run scripting host in different appdomain, and setup Security Policies via Evidence property using sandboxing API