是在AppDomain沙箱的IronPython的唯一途径? [英] Is the Appdomain the only way to sandbox IronPython?

查看:145
本文介绍了是在AppDomain沙箱的IronPython的唯一途径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我指的是沙盒IronPython的

我已经从原来的海报有些不同的要求:

I have somewhat different requirements from the original poster:

具体而言,我们需要不同的功能是有限的 - 文件系统的访问是好的,大多数标准Python模块也都不错,但只有少数几个明确的.NET的DLL是被允许(我们要限制的Python脚本官方的API,我们提供)。 AFAICS,这需要挂接到Python import语句的执行情况。

Specifically, we need different functionalities to be limited - file system access is okay, most of the standard python modules are also okay, but only a few explicit .NET dlls are to be allowed (we want to restrict the python scripts to the "official" API we provide). AFAICs, this requires to hook into the implementation of the python import statement.

什么办法做到这一点?

在此先感谢!

推荐答案

是的,应用程序域是唯一的途径。如果限制通过.NET沙箱访问,则任何事情你可以做瓦特/标准库将被适当地限制为好。何必限制任何的Python脚本呢?你有没有其他方式允许他们不能做任何事情。

Yes, AppDomains are the only way. If you limit access via the .NET sandboxing then anything you could do w/ the standard library would be appropriately limited as well. So why bother restricting any of the Python scripts? They can't do anything you haven't otherwise permitted.

这篇关于是在AppDomain沙箱的IronPython的唯一途径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆