[#964] Bastion or SecurityManager for Ruby? — Clemens Hintze <clemens.hintze@...>

Hi,

15 messages 1999/12/10

[#989] a question about to_i — Friedrich Dominicus <Friedrich.Dominicus@...>

Sorry, I'm quite new to ruby. But I encounterd the following problem. If

17 messages 1999/12/19

[ruby-talk:00967] Re: Bastion or SecurityManager for Ruby?

From: matz@... (Yukihiro Matsumoto)
Date: 1999-12-10 14:54:06 UTC
List: ruby-talk #967
Hi,

In message "[ruby-talk:00964] Bastion or SecurityManager for Ruby?"
    on 99/12/10, Clemens Hintze <clemens.hintze@alcatel.de> writes:

|My question now: Is there any possibility to restrict the access to
|certain commands within my embedded interpreter? I think especially
|for commands like: open, system, require, socket, loading
|extensions... and the like.

How about removing them explicitly by rb_remove_method().

  void rb_remove_method(VALUE klass, const char *name);

The socket interface is implemented by extension, so that prohibiting
require restricts them.

The other possibility is using `safe level', by setting it level 3
using `rb_set_safe_level(3)', the untrusted script should run safely.
open, system, require, etc. will cause SecurityError exception.
Notice `safe level' feature may not be complete, it's still under
development. 

Hope this helps.

							matz.

In This Thread