Commit Graph

12871 Commits

Author SHA1 Message Date
Ned Batchelder
09fbbe7bfa Codejail is in its own repo now. 2013-05-06 11:39:20 -04:00
Ned Batchelder
adde939831 Clarify some comments in tests. 2013-05-06 11:39:20 -04:00
Ned Batchelder
726e8db13e Add more docs 2013-05-06 11:39:20 -04:00
Ned Batchelder
fb5343237a jail_code can execute a provided file also. 2013-05-06 11:39:20 -04:00
Ned Batchelder
9683098f3d Python should have -E, not sure of a clean way to do it, but this at least only applies it to python. 2013-05-06 11:39:20 -04:00
Ned Batchelder
bde976dad2 Refactor code_jail to accommodate non-Python code. 2013-05-06 11:39:19 -04:00
Ned Batchelder
55e910aafc Not sure why my branch was ahead of master for the version of distribute. Make them the same. 2013-05-06 11:39:19 -04:00
Ned Batchelder
bcdc11c3a5 Hint functions are now run in the sandbox. 2013-05-06 11:39:19 -04:00
Ned Batchelder
ed13f0a0f1 Catch up to new exception handling in responses. 2013-05-06 11:39:19 -04:00
Ned Batchelder
5e7d328e7f Use the Django cache for sandboxed code execution. 2013-05-06 11:39:19 -04:00
Ned Batchelder
c8b908a244 capa.safe_exec can use a cache. 2013-05-06 11:39:19 -04:00
Ned Batchelder
5e8e31b2d1 Add a cache attribute to ModuleSystem 2013-05-06 11:39:19 -04:00
Ned Batchelder
ceb6cedaae Fix merge 2013-05-06 11:39:19 -04:00
Ned Batchelder
182a1a1899 Cleanups 2013-05-06 11:39:19 -04:00
Ned Batchelder
0021b0acb3 Refactor to move assumed_imports into capa, so that code_jail is more pure. 2013-05-06 11:39:19 -04:00
Ned Batchelder
89f6ef8407 Move capa/safe_exec into its own directory, in prep for moving code here. 2013-05-06 11:39:18 -04:00
Ned Batchelder
d925604113 Clarify provenance 2013-05-06 11:39:18 -04:00
Ned Batchelder
efaa0eea03 More fixes to the merge, now all tests pass. 2013-05-06 11:39:18 -04:00
Ned Batchelder
be79810ff6 Fix one problem from the merges 2013-05-06 11:39:18 -04:00
Will Daly
f62dad2f57 Added symbolic response tests 2013-05-06 11:39:18 -04:00
Ned Batchelder
e61a6fe787 Make it possible for customresponse check functions to get extra arguments, though they need to be declared in the XML. 2013-05-06 11:39:18 -04:00
Ned Batchelder
c49b0c5027 Have to make the globals json-safe before sending them to the sandbox. 2013-05-06 11:39:18 -04:00
Ned Batchelder
7aa493ec85 A start on getting these tests to run again. 2013-05-06 11:39:18 -04:00
Ned Batchelder
283fc47a95 Jailed code importing random explicitly would get the wrong seed. 2013-05-06 11:39:17 -04:00
Ned Batchelder
f3e8d5bb7a Didn't mean to put this in 2013-05-06 11:39:17 -04:00
Ned Batchelder
478f967af4 We would fail if a global was defined with a non-jsonable value inside a jsonable one. Now we don't/ 2013-05-06 11:39:17 -04:00
Ned Batchelder
b95ea4422b Prevent a print statement from accidentally borking the sandbox. 2013-05-06 11:39:17 -04:00
Ned Batchelder
5acb225816 Print the full traceback when execution fails. 2013-05-06 11:39:17 -04:00
Ned Batchelder
839c568474 Hmm, turns out exec wants just one dict to properly simulate Python module execution. 2013-05-06 11:39:17 -04:00
Ned Batchelder
1473fe377a A unit test that demonstrates the problem we're having with some sandboxed code. 2013-05-06 11:39:17 -04:00
Ned Batchelder
d9df65eef0 Add some logging to codejail 2013-05-06 11:39:17 -04:00
Ned Batchelder
771de938c7 Update the instructions for setting up the sandbox. 2013-05-06 11:39:17 -04:00
Ned Batchelder
ec7a04fdb3 A /debug/run_python endpoint for staff to test the sandboxing of Python code. 2013-05-06 11:39:17 -04:00
Ned Batchelder
df17c0c7dd Move symmath into capa so that it's available where needed 2013-05-06 11:39:17 -04:00
Ned Batchelder
67d0670b2e Symbolic response no longer runs its checker in the Python sandbox. 2013-05-06 11:39:16 -04:00
Ned Batchelder
94f6e685df Mock the response from the snuggletex server, and unskip the SymbolicResponse test. 2013-05-06 10:55:07 -04:00
Ned Batchelder
c04f3e09c0 Test that the sandbox can't get to the network. 2013-05-06 10:55:07 -04:00
Ned Batchelder
9dbfca129c Check functions now can only return serializable data, and 'ex' and 'got' weren't used later anyway. 2013-05-06 10:55:07 -04:00
Ned Batchelder
070f184ee0 Not sure why these had capital-I's in them, since the text just above shows lowercase-i's, and uppercase doesn't work properly. 2013-05-06 10:55:06 -04:00
Ned Batchelder
81c4e4f74f Make check_function more flexible so symbolicresponse can pass in more information. 2013-05-06 10:55:06 -04:00
Ned Batchelder
42eee48ec9 A few places we used an option of 'imaginaryi', which isn't a real option. Doesn't change any behavior. 2013-05-06 10:55:06 -04:00
Ned Batchelder
a40aed58d0 Clean up 2013-05-06 10:55:06 -04:00
Ned Batchelder
4fb73248ba Try to get <symbolicresponse> test running. (Not yet) 2013-05-06 10:55:06 -04:00
Ned Batchelder
4b234a63a3 Future division is really a capa concern, not a general-purpose codejail concern. Move it. 2013-05-06 10:55:06 -04:00
Ned Batchelder
7187b10f9c Use the python_path argument to safe_exec 2013-05-06 10:55:06 -04:00
Ned Batchelder
a04317b31d Files are properly copied in both implementations of safe_exec, and a new python_path argument adds to the python path. 2013-05-06 10:55:06 -04:00
Ned Batchelder
abb9174559 Refactor how script chunks are run. 2013-05-06 10:55:06 -04:00
Ned Batchelder
12b6876753 safe_exec seeds the random module, and now we have tests for it. 2013-05-06 10:55:06 -04:00
Ned Batchelder
ab8a3050fd Don't use jailpy if it hasn't been configured. 2013-05-06 10:55:05 -04:00
Ned Batchelder
d99eadc0a2 Refactor the assumed_imports handling 2013-05-06 10:55:05 -04:00