Hi, this is the first time to post in this forum.
I just started using IronPython a couple of weeks ago, and thinking if I can allow users to write their code like for calculation even partially and run it secure in a ASP form using PythonEngine. Imagine a case providing users a space to write their own functions for specific calculations in a text box and test the code in PythonEngine.
To do this, I have several possible issues, which is how to:
1. Prohibit them to import .NET libraries such as "System.IO" and access to the local files.
2. Prohibit them to run their code that could consume too much CPU and memory resources (it might make the whole process slow or hang up)
3. Provide them with debug information when their code has any problems.
For the first issue, I'm assuming that I can prohibit it by restricting "import" by checking the code before run. However, I'm not so sure if any originally available method in PythonEngine makes it possible to run malicious codes. I don't know how to work on this issue, so I would apprecaite if you know any idea of it.
The second issue, I'm assuming, can be avoided by running the code in a different thread and try-catch clause as well as put a time limitation so that execute "Abort" or "Finalize." Do you think these are enough to avoid the issue?
For the last one, I'm thinking to provide users debug information with ClrDebuggingEnabled property true in EngineOption.
I've been trying to figure out the issues above, while the documentation seems not enouch available to me. So, I appreciate if you have any idea or useful resources.
Thanks,
hirokio