是在AppDomain沙箱的IronPython的唯一途径?是在、途径、AppDomain、IronPython

由网友(牵着蜗牛去散步)分享简介:我指的是沙盒IronPython的。 我已经从原来的海报有些不同的要求:I have somewhat different requirements from the original poster:具体而言,我们需要不同的功能是有限的 - 文件系统的访问是好的,大多数标准Python模块也都不错,但只有少数几个...

我指的是沙盒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.

阅读全文

相关推荐

最新文章