title: Distributed erlang security how to?
body: <p>I want to have 2 independent erlang nodes that could communicate with each other:</p>
  
  <p>so node <strong><code>a@myhost</code></strong> will be able to send messages to <strong><code>b@myhost</code></strong>.</p>
  
  <p>Are there any ways to restrict node <strong><code>a@myhost</code></strong>, so only a function from  a <strong>secure_module</strong> could be called on <strong><code>b@myhost</code></strong>?</p>
  
  <p>It should be something like:</p>
  
  <pre><code>a@myhost&gt; rpc:call(b@myhost,secure_module,do,[A,B,C]) returns  {ok,Result}
  </code></pre>
  
  <p>and  all other calls</p>
  
  <pre><code>a@myhost&gt; rpc:call(b@myhost,Modue,Func,Args)  return {error, Reason}
  </code></pre>
  
  <p>One of the options would be to use <code>ZeroMQ</code> library to establish a communication between nodes, but would it be better if it could be done using some standard Erlang functions/modules?</p>