Re: Some questions

Bzzzz <[email protected]> Wed, 12 Nov 2014 22:30:42 +0100
Newsgroups gmane.comp.python.pyro
Organization Anyone, anywhere BUT in banana demokratik republik of france
Message-ID <[email protected]>
On Wed, 12 Nov 2014 22:08:23 +0100
Irmen de Jong <[email protected]> wrote:

> On 12-11-2014 19:59, Bzzzz wrote:
> 
> > I've upgraded to 4.30 and try to use HMAC signature; my client is
> > working with one block of code, but not with the other one - I
> > followed the docs but I may not have understood it correctly:
> 
> Any particular part that you are having troubles with? I try my best
> to write the docs but can always use help and improvements :)

Not at all, but I have quite a twisted mind, so sometimes I
misunderstand simple explanations when not having problems
with difficult ones.

> > doesn't:
> > --------
> > DB = Pyro4.core.Proxy( "PYRONAME:rpc.server" )
> >     (BTW, as NS also have the same hmac key, how is it able to answer
> >     that without throwing an error as there's no key in parms?)
> 
> Creating a proxy doesn't do anything fancy yet. It gives you a proxy
> in an unconnected state, and only validated the syntax of the Uri. No
> network has been touched yet.
> 
> > DB._pyroHmacKey = conf_cli.HMAC_KEY
> >     Here, when calling the remote object, I've got this error:
> > cannot connect: hmac key config not symmetric
> 
> Hmmmmmmmm you may have hit a snag here.

Just to be sure I understood correctly; this line:
   DB = Pyro4.core.Proxy( "PYRONAME:rpc.server" )
is normally supposed to replace all the block that work?
(I issue the remote call just after the hmac setting).

> There's the _pryoHmacKey property on the proxy. It will probably also
> be used when Pyro's internals are resolving the PYRONAME uri you're
> using in the proxy. This means you need to have a name server started
> with the same hmac as the other servers you are using from that proxy,
> or it won't be able to connect to the name server. Will investigate
> soon.

But they _already_ all have the same hmac key: server, client and NS!

> Suggestions:
> - rollback to 4.29 and stick with the previous way of using hmacs, if
> that worked for you.  If the above is indeed a problem I'll try to
> have it fixed somehow for 4.31

I don't know how to do so; my former version, 4.23-1 IIRC, was from the
debian official sid pkg and this one comes from a pypi link.
With this old version, hmac was working correctly.

This is not a problem today, as I'm in the dev stage, however, it will
be for the production svr (I try to have the lower network traffic
possible to have this working correctly even on an ADSL link).

> > My other question is: if I log Pyro4 at debug level, I can see 
> > clients' IP addresses; how can I retrieve them into my server?
> 
> What do you want to achieve? Why not pass some identification token
> explicitly in the pyro remote calls? There's no official way of
> getting the information you're asking from within your Pyro server
> classes.

I use Pyro as a server to access a database, so I wanna be able to
blacklist possible attackers (either directly or by issuing a weird
log that'll be intercepted  and processed by fail2ban).

Jean-Yves

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk