<p dir="ltr"><br>
On 13 Nov 2013 12:11, "Christian Heimes" <<a href="mailto:christian@python.org">christian@python.org</a>> wrote:<br>
><br>
> Am 13.11.2013 01:47, schrieb Glenn Linderman:<br>
> > If it is an implementation issue, then perhaps a different<br>
> > implementation would help. Or perhaps a "safe compiler".<br>
> ><br>
> > If it is a language design issue, then a different implementation<br>
> > wouldn't help, it would require a new language, or a restricted subset.<br>
> > I'm not sure whether some of the onerous sounding restrictions result<br>
> > from language or implementation issues; some of them certainly sounded<br>
> > like implementation issues.<br>
> ><br>
> > A restricted subset, compiled by a validating compiler, might still be a<br>
> > useful language, even if the execution speed has to be reduced by a<br>
> > validating runtime.<br>
><br>
> A limited and well-defined subset of Python may do the trick, perhaps a<br>
> project based on RPython. Zope has a long history of restricted Python<br>
> code with safe-guards and security proxies. Any project must start with<br>
> a proper threat model and goals. Does sandboxed code need to access<br>
> frame objects and use compile()? Could we perhaps use a limited<br>
> subinterpreters with reduced / modified builtins to archive isolation?</p>
<p dir="ltr">Brett Cannon also spent some time exploring exploring the idea of a security capability based model for a Python implementation.</p>
<p dir="ltr">> CPython still has a couple of crashers, too. These must be resolved. You<br>
> don't want sandboxed code to generate a segfault, do you?</p>
<p dir="ltr">Indeed - it would be interesting to see if any of those have been resolved by the various edge case fixes in recent months.</p>
<p dir="ltr">> > Is there technology in the smartphone OSes that could be applied? iOS<br>
> > seems to not even provide a file system to its apps, and there is<br>
> > limited sharing of data from one app to the next. Android provides an<br>
> > explicit subset of system services to its apps.<br>
><br>
> On Linux seccomp may be a feasible way to prevent syscalls. Seccomp<br>
> basically can limit the capability of a thread so it can no longer do<br>
> certain syscalls. Chrome uses it for sandboxing.</p>
<p dir="ltr">Yeah, there's a reason our standard answer to "How do I sandbox Python code?" has been "Use a subprocess and the OS provided process sandboxing facilities" for quite some time.</p>
<p dir="ltr">Sandboxing software *at all* is difficult, doing it cross-platform is even harder.</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> Christian<br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>