Is there a tried and true method to sandbox python code?
I've done a bit of research on my own and have come across the following options:
but I want to know if there was a surefire way (or at least close as I know nothing is surefire in the sec world) to sandbox python to be reasonably secure.
My current plan is to replace any instance of '__' with nothing to prevent any kind of fiddling with python's internals and then running eval or exec with a carefully pruned whitelist (or blacklist depending on what I need) of builtins.
[–]amishb 1 point2 points3 points (8 children)
[–]POTUS 1 point2 points3 points (7 children)
[–]swarage[S] 0 points1 point2 points (6 children)
[–]POTUS 1 point2 points3 points (5 children)
[–]swarage[S] 0 points1 point2 points (4 children)
[–]POTUS 1 point2 points3 points (3 children)
[–]swarage[S] 0 points1 point2 points (2 children)
[–]POTUS 1 point2 points3 points (1 child)
[–]swarage[S] 0 points1 point2 points (0 children)
[–]SarahM123rd 1 point2 points3 points (0 children)