From: Gregory Seidman Date: 2006-02-27T22:08:22+09:00 Subject: Re: Authenticating distributed Ruby On Mon, Feb 27, 2006 at 02:03:35PM +0900, Trejkaz wrote: [...] } Of course, DRb in itself provides no real security. But because of the } nature of some of the applications I want to make possible, I do want } to provide some basic protection against some of the more obvious kinds } of attacks which occur. } } The first aspect of this is encrypting the traffic which I can use SSL } for. Although I'm not particularly keen on having to generate a } certificate just to run this lightweight server... some lighter } encryption would be preferable but I'll take what's available. Once I } have SSL up, at least I can assume that people won't be able to spy on } the messages which are being sent back and forth. } } The next aspect is some kind of basic authentication. Really, what I } want is just a secret key that the client has to pass in in order to } get access to my remote objects. But, I don't want to have to add that } secret key to every method. [...] } How do people usually do this sort of thing? Is there a } generally-accepted norm? You are working too hard. If you are using SSL, you can use client and server certificates for mutual authentication. Probably the right thing to do is to create a certificate for each of your DRb nodes and another for your application as a whole. Sign all of the node certificates with the application certificate ans register it as a certificate authority on each of your nodes. Each node uses its certificate as a client certificate as well as a server certificate, and it verifies that whatever is connecting to it or it is connecting to is also a member of the same application since the certificates are all signed by a know "authority" (i.e. the application certificate). You may find the following URLs helpful in understanding and implementing this: http://www.freebsddiary.org/openssl-client-authentication.php http://www.mindreef.com/support/soapscope/4.1/help/sslcerts.html http://www.pseudonym.org/ssl/ssl_cook.html Also, if the machines you are running the nodes on are not running anything else and have no other users, you may (emphasis on *may*) find stunnel a more efficient and more convenient way of implementing SSL authentication and encryption between nodes. This involves making the DRb instances bind to the loopback interface without any SSL anything rather than an external interface, and making and receiving connections through stunnel. } TX --Greg