This repository has been archived by the owner on Jul 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created Sandboxing Ruby: The Good, the Bad, and the Fugly (markdown)
- Loading branch information
dscataglini
committed
Oct 1, 2011
1 parent
47e4a24
commit cda4cb9
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Motivation | ||
We launched rails for zombies and we let people run code on heroku. Our initial method for sandboxing was regex based. | ||
Zedshaw took us down quickly with a 1 liner. We then had to learn more about sandboxing. | ||
|
||
### $SAFE | ||
Using $SAFE global, unfortunately rails doesn't work with any level higher than 0 | ||
|
||
### rubycop | ||
looks at the ast | ||
|
||
### jail/jruby_sandbox | ||
isolates Namespaces | ||
create a sandbox evaluate a sandbox | ||
Blocks dangerous operations with Sandbox.safe | ||
Protects secrets | ||
Limits resource utilization | ||
sandboxeval %{while;true;end}, timeout: 5 # | ||
Can give sandbox "capabilitites | ||
sandbox.ref(Foo) | ||
foo = sandbox.eval('Foo.new') | ||
foo.bar | ||
|
||
please go to http://sandboxbreaker3000.heroku.com and try to break it. | ||
|
||
|