From: Anthony Wright Date: 2010-10-12T21:34:32+09:00 Subject: Using DRB as a secure interface Is it possible to implement a secure interface exposed to the internet using DRB? I want to pass complex structures through an external API and DRB seems like an obvious choice, but I'm concerned that DRB will allow code to pass as well as the data, or methods to be called that I didn't want to be exposed. Are my concerns well founded and if so, is there a way to secure the interface? From my simple tests, any modifications to a standard class are not passed, and non-standard classes are not passed either. I tie down the interface class by creating an "EmptyClass" and subclassing the interface class from that. class EmptyClass safe_methods = [:__send__,:__id__,:inspect,:respond_to?,:to_s,:private_methods,:protected_methods,:object_id] (instance_methods - safe_methods).each do |method| undef_method method end end I also carefully check the data in the arguments too. I tried to use $SAFE, but it got in the way rather than helped. Could anybody provide advice on securing DRB and the proper use of $SAFE for argument checking? thanks, Anthony Wright.