<br><br><div class="gmail_quote">On Mon, May 4, 2009 at 12:33 PM, Marek Janda <span dir="ltr">&lt;<a href="mailto:nyx@nyx.cz">nyx@nyx.cz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you<br>
<br>
In my case, RK is generated from username and session, so it changes for every<br>
login.<br>
<br>
I&#39;m using Orbited to implement Comet (sending events from server to browser)<br>
and I&#39;m dealing with possibility (well...certainity) that some users will open<br>
multiple browser tabs and I&#39;ll need to send the message to all of them.</blockquote><div>Are you working on a project that is open source?� If so, and you&#39;d like to provide<br>a link to your project please do.� I&#39;d be interested to see how you get on with this.<br>
�<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
So I have to create uniquely named queue for every browser tab/connection and<br>
bind them all to exchange with the same RK. If I use the same queue for all<br>
tabs, message will be sent only to one of them.</blockquote><div>This is slightly off-topic for the RabbitMQ list, but from what I understand browsers<br>actually restrict the total number of connections to a given server.� It&#39;s something<br>
like 2 for Firefox, and IE has the same (all per the http 1.1 spec).<br>Are you solving this in some interesting way like creating multiple subdomains<br>(I think facebook does this) ... or some other way?<br><br><br>Anyways, love to hear how you get on tying together Orbited and RabbitMQ.<br>
<br>thanks,<br>Alex<br><br><br>�<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Possible attacker could:<br>
1) guess RK, create new queue and bind it to exchange with that RK<br>
2) guess name of existing queue and subscribe to it - unlikely, as queues are<br>
quite short-lived - after user leaves page, current queue is destroyed and new<br>
is created on next page (messages send in between are handled outside MQ)<br>
<br>
If attacker could sniff their RK, they could as well read all their messages<br>
anyway, so I don&#39;t see those two options as real danger.<br>
<br>
So unless there is some option 3) that would allow attacker to consume from<br>
exchange without knowing RKs, I think I&#39;m safe.<br>
<br>
There may be other possibilities - like dropping whole exchange and creating<br>
it with different type - I&#39;m using default amq.direct, so I&#39;m not even sure<br>
it&#39;s possible - have to try.<br>
<br>
Other ideas are welcome of course.<br>
<br>
// Users themselves don&#39;t publish anything to MQ...they just send ajax request<br>
to server and messages are published from server, so users don&#39;t need to know<br>
other user&#39;s RK.<br>
<div><div></div><div class="h5"><br>
On Monday 04 May 2009, Alexis Richardson wrote:<br>
&gt; Marek,<br>
&gt;<br>
&gt; On Mon, May 4, 2009 at 6:08 PM, Marek Janda &lt;<a href="mailto:nyx@nyx.cz">nyx@nyx.cz</a>&gt; wrote:<br>
&gt; &gt; Hello,<br>
&gt; &gt; I just need to confirm one thing.<br>
&gt; &gt;<br>
&gt; &gt; If I send some message to direct exchange, is there any way to bind queue<br>
&gt; &gt; to it that you&#39;ll get the message even without knowing it&#39;s routing key?<br>
&gt; &gt; I want to use RK as a &quot;password&quot; so that every user can subscribe only to<br>
&gt; &gt; messages addressed to him - so I need to know if there isn&#39;t some way to<br>
&gt; &gt; create wildcard match and subscribe to all messages.<br>
&gt;<br>
&gt; As I recall there are no wildcards with direct exchanges.<br>
&gt;<br>
&gt; Wildcards are appropriate for topic exchanges where they are explicit<br>
&gt; (*, #), and fanout exchanges where they are implicit since fanout<br>
&gt; implement full broadcast to all bound queues.<br>
&gt;<br>
&gt; However, note that with direct exchanges there is nothing in the spec<br>
&gt; to prevent someone who knows the password binding to a given exchange<br>
&gt; once they know the key. �So if I know your password then I can see a<br>
&gt; copy of your messages, as well as mine. �And vice versa.<br>
&gt;<br>
&gt; You may want to look at ACLs in RabbitMQ:<br>
&gt; <a href="http://www.nabble.com/ACLs-td21615692.html" target="_blank">http://www.nabble.com/ACLs-td21615692.html</a> �Users who do not have<br>
&gt; permission to manage their own bindings, and who can only send and<br>
&gt; receive messages, will not be able to add bindings and hence<br>
&gt; compromise your scheme. �I think but am not 100% that this is possible<br>
&gt; with how RabbitMQ currently implements ACLs.<br>
&gt;<br>
&gt; &gt; After reading documentation, searching the web and looking into source<br>
&gt; &gt; (well, I&#39;ve seen Erlang for the first time in my life), I think it should<br>
&gt; &gt; require the key, but I&#39;d like to be 100% sure I didn&#39;t miss anything.<br>
&gt; &gt;<br>
&gt; :-)<br>
&gt;<br>
&gt; I am hopeful that one of the RabbitMQ engineers will substantiate or<br>
&gt; correct my comments above with some detail. �It&#39;s a holiday weekend<br>
&gt; here in the UK so this may not happen instantly.<br>
&gt;<br>
&gt; &gt; Also, is it ok to send everything to one exchange or should I create more<br>
&gt; &gt; exchanges and divide users between them? From the performance POV.<br>
&gt;<br>
&gt; In the case of RabbitMQ that&#39;s somewhat moot and depends on the<br>
&gt; details of your use case. �Fanout exchanges are computationally<br>
&gt; cheaper than direct, since there is one fewer lookup step, and topic<br>
&gt; exchanges are more complex than direct. �But there may be other<br>
&gt; factors to consider.<br>
&gt;<br>
&gt; If you wanted to implement the twitter follower pattern for example,<br>
&gt; you could EITHER use one direct exchange (bind to the exchange with<br>
&gt; the key of the person you follow), OR have one fanout exchange per<br>
&gt; user (bind to the exchange of anyone you follow). �Happy to explain<br>
&gt; more if you like...<br>
&gt;<br>
&gt; alexis<br>
&gt;<br>
&gt; &gt; Thank you<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; S pozdravem<br>
&gt; &gt; Marek Janda<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; rabbitmq-discuss mailing list<br>
&gt; &gt; <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
&gt; &gt; <a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br>
<br>
</div></div><font color="#888888">--<br>
S pozdravem<br>
Marek Janda<br>
email: � � �<a href="mailto:nyx@nyx.cz">nyx@nyx.cz</a><br>
GnuPG: � � �<a href="http://nyx.nyx.cz/files/nyx.gpg" target="_blank">http://nyx.nyx.cz/files/nyx.gpg</a><br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Alex Clemesha<br><a href="http://clemesha.org">clemesha.org</a><br>