Thursday, February 7, 2019

Robolectric isolation is between SDK levels, not for security

The CS class I'm on staff for grades some parts of student submissions using Robolectric-based tests. Since we're automatically accepting and running student code (which could attempt all sorts of things), we want to isolate the testing environment from the host machine. We noticed that Robolectric runs tests inside a sandbox, but on further inspection that appears to only isolate tests at different SDK levels from each other. Tested code can still freely read and write files on the host. It also doesn't appear to be possible to restrict the code with a Java security policy and still let Robolectric work at all. So for now, we're running untrusted code inside Docker containers.

No comments:

Post a Comment