Save the world from evil code crusade

A

aurelianito

I want to say things like evil.rb code can write to "evil.log" but to
Setting up a list of "unsafe" methods (blacklisting) is likely to
break when more methods are added. Instead, I'd set up a list of
*safe* methods (whitelisting).

I agree. But my idea is to leave security configuration to the
administrator. I want to give him/her the tools necesary to disable
unwanted behaviour.
For the unsafe code part, I'd use safemode and proxy over the classes
you want to allow by overriding the MyClass constant with a pure
method_missing based proxy. The proxyied calls can be filtered for
security on the "outside", where only your code runs.

I'm interested with this option. How do you avoid the unsafe code to
bypass the proxy? can you show me some ruby (pseudo)code?

Thank's,
Aureliano.
 
E

Eivind Eklund

I agree. But my idea is to leave security configuration to the
administrator. I want to give him/her the tools necessary to disable
unwanted behaviour.

Same goes for the sysadmin, really. Security researchers tend to list
the use of blacklisting instead of whitelisting as one of the top five
reasons for the amounts of security problems we have.

One thing that I've personally been thinking a bit about for possible
use in FreeBSD is the ability to restrict a process to a completely
specified set of capabilities, throwing away the rest. Then, we'd
only need to trust the code that throw away the privs, not the rest.=20
If done conveniently, this could be used by all programs, for internal
compartmentization. This might be a different use for your code that
you've not yet thought of?
I'm interested with this option. How do you avoid the unsafe code to
bypass the proxy? can you show me some ruby (pseudo)code?

If you've wiped everything, there's no bypass possibilities (Ruby
object refs work as capabilities.) I'd probably implement this with
$SAFE =3D 4 for extra safety, though. Unfortunately, I lack the time to
play around with this and try to give you any decent form of code
right now.

Eivind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top